Skip to content

Commit

Permalink
Show version hash in tooltip instead
Browse files Browse the repository at this point in the history
  • Loading branch information
NoahStolk committed Jan 12, 2024
1 parent 1addeb6 commit bb95e82
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 4 deletions.
5 changes: 4 additions & 1 deletion src/DevilDaggersInfo.Web.Client/Components/Tooltip.razor
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<span class="tooltip @(Position.ToString().ToLower()) whitespace-nowrap font-calibri text-sm" title="@(Text)">
<span class="tooltip @(Position.ToString().ToLower()) whitespace-nowrap font-calibri @TextSizeClass" title="@(Text)">
@ChildContent
</span>

Expand All @@ -12,4 +12,7 @@

[Parameter]
public TooltipPosition Position { get; set; }

[Parameter]
public string TextSizeClass { get; set; } = "text-sm";
}
14 changes: 13 additions & 1 deletion src/DevilDaggersInfo.Web.Client/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,26 @@ namespace DevilDaggersInfo.Web.Client;
public static class Program
{
public static string? Version { get; private set; }
public static string? VersionHash { get; private set; }
public static string? BuildTime { get; private set; }

public static async Task Main(string[] args)
{
Assembly executingAssembly = Assembly.GetExecutingAssembly();
Version = executingAssembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion;
BuildTime = executingAssembly.GetCustomAttribute<BuildTimeAttribute>()?.BuildTime;

string? informationalVersion = executingAssembly.GetCustomAttribute<AssemblyInformationalVersionAttribute>()?.InformationalVersion;
string[]? split = informationalVersion?.Split('+');
if (split is not { Length: 2 })
{
Version = informationalVersion;
}
else
{
Version = split[0];
VersionHash = split[1];
}

WebAssemblyHostBuilder builder = WebAssemblyHostBuilder.CreateDefault(args);

#if DEBUG
Expand Down
7 changes: 6 additions & 1 deletion src/DevilDaggersInfo.Web.Client/Shared/MainLayout.razor
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
@using DevilDaggersInfo.Web.Client.Components;
@inherits LayoutComponentBase

<div class="flex flex-col sm:flex-row">
Expand All @@ -11,7 +12,11 @@
</div>
<footer class="flex-shrink-0 pt-3">
<p>&copy; DevilDaggers.info 2017-@DateTime.UtcNow.Year</p>
<p>Version @Program.Version (@Program.BuildTime)</p>
<p>
Version
<Tooltip Position="TooltipPosition.Right" Text="@Program.VersionHash" TextSizeClass="@string.Empty"><span class="cursor-pointer">@Program.Version</span></Tooltip>
(@Program.BuildTime)
</p>
<p><a class="link" href="//devildaggers.com/" target="_blank">Devil Daggers</a> is created by <a class="link" href="//sorath.com/" target="_blank">Sorath</a></p>
<p><a class="link" href="//devildaggers.info/" target="_blank">DevilDaggers.info</a> is created by <a class="link" href="//noahstolk.com/" target="_blank">Noah Stolk</a></p>
<p><a class="link" href="@Constants.DiscordUrl" target="_blank">Discord server</a></p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ <h3 class="text-red text-xl pt-4 pb-2 font-goethe">New Tools</h3>
<iframe class="absolute top-0 left-0 w-full h-full" src="https://www.youtube.com/embed/4dF4V5eocXY" title="New Tools" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>

<p class="para">For the past few months I have been working on a new app. Its goal is to eventually replace all the current tools (all editors and the custom leaderboards recorder) and include a lot of QOL improvements. The new app is cross-platform will simply be called DDINFO TOOLS.</p>
<p class="para">For the past few months I have been working on a new app. Its goal is to eventually replace all the current tools (all editors and the custom leaderboards recorder) and include a lot of QOL improvements. The new app is cross-platform will simply be called ddinfo-tools.</p>
<p class="para">It is currently in development and an alpha build for Windows can be downloaded <a class="link" href="/tools">here</a>. A Linux build will be available later if anyone wants to help test it.</p>
<p class="para">At this point, only support for custom leaderboards has been fully implemented. There is also a working survival editor (still a work in progress) which includes some new stuff as well, such as a 3D editor, full undo and redo support, more editing tools, etc.</p>

Expand Down

0 comments on commit bb95e82

Please sign in to comment.