Skip to content

Commit

Permalink
feat: add monster renders option
Browse files Browse the repository at this point in the history
  • Loading branch information
DorielRivalet committed Jan 17, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent 76eb2c8 commit 45b86ed
Showing 7 changed files with 179 additions and 67 deletions.
6 changes: 6 additions & 0 deletions MHFZ_Overlay/App.config
Original file line number Diff line number Diff line change
@@ -604,6 +604,12 @@
<setting name="QuestIDY" serializeAs="String">
<value>50</value>
</setting>
<setting name="EnableMonsterRenders" serializeAs="String">
<value>True</value>
</setting>
<setting name="EnableMonsterHPBarsAutomaticColor" serializeAs="String">
<value>True</value>
</setting>
</MHFZ_Overlay.Settings>
</userSettings>
</configuration>
93 changes: 51 additions & 42 deletions MHFZ_Overlay/ConfigWindow.xaml

Large diffs are not rendered by default.

21 changes: 0 additions & 21 deletions MHFZ_Overlay/Core/Class/Dictionary/MonsterRenderDictionary.cs

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions MHFZ_Overlay/MainWindow.xaml
Original file line number Diff line number Diff line change
@@ -237,7 +237,7 @@
<uc:CustomProgressBar FontFamily="{StaticResource Source Code Pro Bold}" Foreground="#f5e0dc" x:Name="Monster1HPBar" Grid.Row="0" Background="{Binding Source={StaticResource Settings},Path=HPBackGroundColor}" IsHitTestVisible="False"
Visibility="{Binding ElementName=Window, Path=DataLoader.model.HasMonster1, Converter={StaticResource BoolToVis}}"
Description="{Binding ElementName=Window, Path=DataLoader.model.Monster1Name}"
IconSource="{Binding ElementName=Window, Path=DataLoader.model.CurrentMonster1Icon}"
IconSource="{Binding ElementName=Window, Path=DataLoader.model.CurrentMonster1Image}"
NumCurr="{Binding ElementName=Window, Path=DataLoader.model.Monster1HP}"
NumMax="{Binding ElementName=Window, Path=DataLoader.model.Monster1MaxHP}"
BarColor="{Binding Source={StaticResource Settings},Path=Monster1BarColor}" Row1Width="4" Row2Width="3" />
@@ -250,7 +250,7 @@
</Grid.RowDefinitions>
<uc:CustomProgressBar FontFamily="{StaticResource Source Code Pro Bold}" Foreground="#f5e0dc" x:Name="Monster2HPBar" Grid.Row="0" Background="{Binding Source={StaticResource Settings},Path=HPBackGroundColor}" IsHitTestVisible="False"
Visibility="{Binding ElementName=Window, Path=DataLoader.model.HasMonster2, Converter={StaticResource BoolToVis}}"
IconSource="{Binding ElementName=Window, Path=DataLoader.model.CurrentMonster2Icon}"
IconSource="{Binding ElementName=Window, Path=DataLoader.model.CurrentMonster2Image}"
Description="{Binding ElementName=Window, Path=DataLoader.model.Monster2Name}"
NumCurr="{Binding ElementName=Window, Path=DataLoader.model.Monster2HP}"
NumMax="{Binding ElementName=Window, Path=DataLoader.model.Monster2MaxHP}"
@@ -265,7 +265,7 @@

<uc:CustomProgressBar FontFamily="{StaticResource Source Code Pro Bold}" Foreground="#f5e0dc" x:Name="Monster3HPBar" Grid.Row="0" Background="{Binding Source={StaticResource Settings},Path=HPBackGroundColor}" IsHitTestVisible="False"
Visibility="{Binding ElementName=Window, Path=DataLoader.model.HasMonster3, Converter={StaticResource BoolToVis}}"
IconSource="{Binding ElementName=Window, Path=DataLoader.model.CurrentMonster3Icon}"
IconSource="{Binding ElementName=Window, Path=DataLoader.model.CurrentMonster3Image}"
Description="{Binding ElementName=Window, Path=DataLoader.model.Monster3Name}"
NumCurr="{Binding ElementName=Window, Path=DataLoader.model.Monster3HP}"
NumMax="{Binding ElementName=Window, Path=DataLoader.model.Monster3MaxHP}"
@@ -280,7 +280,7 @@

<uc:CustomProgressBar Foreground="#f5e0dc" x:Name="Monster4HPBar" Grid.Row="0" Background="{Binding Source={StaticResource Settings},Path=HPBackGroundColor}" IsHitTestVisible="False"
Visibility="{Binding ElementName=Window, Path=DataLoader.model.HasMonster4, Converter={StaticResource BoolToVis}}"
IconSource="{Binding ElementName=Window, Path=DataLoader.model.CurrentMonster4Icon}"
IconSource="{Binding ElementName=Window, Path=DataLoader.model.CurrentMonster4Image}"
Description="{Binding ElementName=Window, Path=DataLoader.model.Monster4Name}"
NumCurr="{Binding ElementName=Window, Path=DataLoader.model.Monster4HP}"
NumMax="{Binding ElementName=Window, Path=DataLoader.model.Monster4MaxHP}"
24 changes: 24 additions & 0 deletions MHFZ_Overlay/Settings.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions MHFZ_Overlay/Settings.settings
Original file line number Diff line number Diff line change
@@ -599,5 +599,11 @@
<Setting Name="QuestIDY" Type="System.Double" Scope="User">
<Value Profile="(Default)">50</Value>
</Setting>
<Setting Name="EnableMonsterRenders" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="EnableMonsterHPBarsAutomaticColor" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
</Setting>
</Settings>
</SettingsFile>
88 changes: 88 additions & 0 deletions MHFZ_Overlay/addresses/AddressModel.cs
Original file line number Diff line number Diff line change
@@ -2723,6 +2723,94 @@ public string CurrentMonster1Icon
}
}

public string CurrentMonster1Image
{
get
{
Settings s = (Settings)Application.Current.TryFindResource("Settings");
string monsterIcon = CurrentMonster1Icon;

if (s.EnableMonsterRenders)
{
bool renderFound = Dictionary.MonsterRenderDictionary.MonsterRender.ContainsKey(monsterIcon);
if (renderFound)
return Dictionary.MonsterRenderDictionary.MonsterRender[monsterIcon];
else
return "https://i.imgur.com/3pQEtzw.png";
}
else
{
return monsterIcon;
}
}
}

public string CurrentMonster2Image
{
get
{
Settings s = (Settings)Application.Current.TryFindResource("Settings");
string monsterIcon = CurrentMonster2Icon;

if (s.EnableMonsterRenders)
{
bool renderFound = Dictionary.MonsterRenderDictionary.MonsterRender.ContainsKey(monsterIcon);
if (renderFound)
return Dictionary.MonsterRenderDictionary.MonsterRender[monsterIcon];
else
return "https://i.imgur.com/3pQEtzw.png";
}
else
{
return monsterIcon;
}
}
}

public string CurrentMonster3Image
{
get
{
Settings s = (Settings)Application.Current.TryFindResource("Settings");
string monsterIcon = CurrentMonster3Icon;

if (s.EnableMonsterRenders)
{
bool renderFound = Dictionary.MonsterRenderDictionary.MonsterRender.ContainsKey(monsterIcon);
if (renderFound)
return Dictionary.MonsterRenderDictionary.MonsterRender[monsterIcon];
else
return "https://i.imgur.com/3pQEtzw.png";
}
else
{
return monsterIcon;
}
}
}

public string CurrentMonster4Image
{
get
{
Settings s = (Settings)Application.Current.TryFindResource("Settings");
string monsterIcon = CurrentMonster4Icon;

if (s.EnableMonsterRenders)
{
bool renderFound = Dictionary.MonsterRenderDictionary.MonsterRender.ContainsKey(monsterIcon);
if (renderFound)
return Dictionary.MonsterRenderDictionary.MonsterRender[monsterIcon];
else
return "https://i.imgur.com/3pQEtzw.png";
}
else
{
return monsterIcon;
}
}
}

public string CurrentMonster2Icon
{
get

0 comments on commit 45b86ed

Please sign in to comment.