Skip to content

Commit

Permalink
chore: Changed NPC and Weapon icons
Browse files Browse the repository at this point in the history
  • Loading branch information
Jorixon committed Mar 30, 2024
1 parent 02cf5d9 commit 2176bfb
Show file tree
Hide file tree
Showing 5 changed files with 66 additions and 22 deletions.
Binary file added src/GIMI-ModManager.WinUI/Assets/NPC_Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/GIMI-ModManager.WinUI/Assets/Weapon_Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 14 additions & 0 deletions src/GIMI-ModManager.WinUI/Assets/convert.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import os, sys
from PIL import Image

for infile in os.listdir("./"):
print(infile)

f, e = os.path.splitext(infile)
outfile = f + ".png"
if infile != outfile:
try:
with Image.open(infile) as im:
im.convert("RGBA").save(outfile)
except OSError:
print("cannot convert", infile)
14 changes: 14 additions & 0 deletions src/GIMI-ModManager.WinUI/GIMI-ModManager.WinUI.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -490,8 +490,13 @@
<Content Remove="Assets\Games\Honkai\Images\Characters\yanqing.webp" />
<Content Remove="Assets\Games\Honkai\Images\Characters\yukong.webp" />
<Content Remove="Assets\Games\Honkai\weapons.json" />
<Content Remove="Assets\Icon_Inventory_Weapons.webp" />

<Content Remove="Assets\ModPanePlaceholder.webp" />

<Content Remove="Assets\NPC_Icon.png" />

<Content Remove="Assets\Weapon_Icon.png" />
</ItemGroup>
<ItemGroup>
<None Remove="Assets\easterEgg.mp3" />
Expand Down Expand Up @@ -564,6 +569,9 @@
<None Update="appsettings.json">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
<None Update="Assets\Weapon_Icon.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Assets\ModPanePlaceholder.webp">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down Expand Up @@ -646,6 +654,9 @@
<Content Update="Assets\Fonts\zh-cn2.ttf">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
<None Update="Assets\Icon_Inventory_Weapons.webp">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Assets\Games\Genshin\Images\Npcs\Npc_Slimes.webp">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
Expand Down Expand Up @@ -732,6 +743,9 @@
<None Update="Assets\Games\Honkai\weapons.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="Assets\NPC_Icon.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<Page Update="Views\ModSelector.xaml">
<Generator>MSBuild:Compile</Generator>
</Page>
Expand Down
60 changes: 38 additions & 22 deletions src/GIMI-ModManager.WinUI/Views/ShellPage.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -88,33 +88,49 @@ private void GameServiceOnInitialized(object? sender, EventArgs e)
NavigationHelper.SetNavigateTo(categoryViewItem, typeof(CharactersViewModel).FullName!);


if (category.ModCategory == ModCategory.Character)
switch (category.ModCategory)
{
categoryViewItem.Icon = new FontIcon() { Glyph = "\uE716" };

ViewModel.NavigationViewService.MenuItems!.Insert(index, categoryViewItem);
}
else if (category.ModCategory == ModCategory.NPC)
{
categoryViewItem.Icon = new FontIcon() { Glyph = "\uE8D5" };

ViewModel.NavigationViewService.MenuItems!.Insert(index, categoryViewItem);
}
else if (category.ModCategory == ModCategory.Object)
{
categoryViewItem.Icon = new FontIcon() { Glyph = "\uE8FC" };

ViewModel.NavigationViewService.MenuItems!.Insert(index, categoryViewItem);
}
else
{
categoryViewItem.Icon = new FontIcon() { Glyph = "\uF142" };
ViewModel.NavigationViewService.MenuItems!.Insert(index, categoryViewItem);
case ModCategory.Character:
categoryViewItem.Icon = new FontIcon() { Glyph = "\uE716" };

ViewModel.NavigationViewService.MenuItems!.Insert(index, categoryViewItem);
break;
case ModCategory.NPC:
categoryViewItem.Icon = new BitmapIcon()
{
UriSource = new Uri($"{App.ASSET_DIR}/NPC_Icon.png"),
ShowAsMonochrome = true
};

ViewModel.NavigationViewService.MenuItems!.Insert(index, categoryViewItem);
break;
case ModCategory.Object:
categoryViewItem.Icon = new FontIcon() { Glyph = "\uE8FC" };

ViewModel.NavigationViewService.MenuItems!.Insert(index, categoryViewItem);
break;
case ModCategory.Weapons:
categoryViewItem.Icon = new BitmapIcon()
{
UriSource = new Uri($"{App.ASSET_DIR}/Weapon_Icon.png"),
ShowAsMonochrome = false
};

ViewModel.NavigationViewService.MenuItems!.Insert(index, categoryViewItem);
break;


case ModCategory.Ui:
case ModCategory.Gliders:
case ModCategory.Custom:
default:
categoryViewItem.Icon = new FontIcon() { Glyph = "\uF142" };
ViewModel.NavigationViewService.MenuItems!.Insert(index, categoryViewItem);
break;
}

index++;


//const string menuName = "Categories";
//if (NavigationViewControl.MenuItems[1] is NavigationViewItem { Tag: not null } menuItem &&
// menuItem.Tag.Equals(menuName))
Expand Down

0 comments on commit 2176bfb

Please sign in to comment.