Skip to content

Commit

Permalink
Showing 14 changed files with 242 additions and 70 deletions.
Binary file removed .vs/MHFZ_Overlay/v17/.futdcache.v1
Binary file not shown.
2 changes: 1 addition & 1 deletion MHFZ_Overlay/App.config
Original file line number Diff line number Diff line change
@@ -125,7 +125,7 @@
<value>685</value>
</setting>
<setting name="AlwaysShowPlayerInfo" serializeAs="String">
<value>False</value>
<value>True</value>
</setting>
<setting name="EnableSharpnessPercentage" serializeAs="String">
<value>True</value>
72 changes: 72 additions & 0 deletions MHFZ_Overlay/DataLoader.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
using Memory;
using MHFZ_Overlay.addresses;
using Squirrel;
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using System.Windows;

namespace MHFZ_Overlay
{
@@ -17,15 +20,84 @@ public class DataLoader
readonly Mem m = new();
public bool isHighGradeEdition;
int index;
/// <summary>
/// Gets the model.
/// </summary>
/// <value>
/// The model.
/// </value>
public AddressModel model { get; }

#endregion

/// <summary>
/// Called when [application install].
/// </summary>
/// <param name="version">The version.</param>
/// <param name="tools">The tools.</param>
private static void OnAppInstall(SemanticVersion version, IAppTools tools)
{
MessageBox.Show("【MHF-Z】Overlay is now installed. Creating a shortcut.");
tools.CreateShortcutForThisExe(ShortcutLocation.StartMenu | ShortcutLocation.Desktop);
}

/// <summary>
/// Called when [application uninstall].
/// </summary>
/// <param name="version">The version.</param>
/// <param name="tools">The tools.</param>
private static void OnAppUninstall(SemanticVersion version, IAppTools tools)
{
MessageBox.Show("【MHF-Z】Overlay has been uninstalled. Removing shortcut.");
tools.RemoveShortcutForThisExe(ShortcutLocation.StartMenu | ShortcutLocation.Desktop);
}

/// <summary>
/// Called when [application run].
/// </summary>
/// <param name="version">The version.</param>
/// <param name="tools">The tools.</param>
/// <param name="firstRun">if set to <c>true</c> [first run].</param>
private static void OnAppRun(SemanticVersion version, IAppTools tools, bool firstRun)
{
tools.SetProcessAppUserModelId();
// show a welcome message when the app is first installed
if (firstRun) MessageBox.Show("【MHF-Z】Overlay is now running! Thanks for installing【MHF-Z】Overlay");
}

/// <summary>
/// Updates my application.
/// </summary>
private static async Task UpdateMyApp()
{
using var mgr = new UpdateManager("https://github.com/DorielRivalet/MHFZ_Overlay/releases/latest");
var newVersion = await mgr.UpdateApp();

// optionally restart the app automatically, or ask the user if/when they want to restart
if (newVersion != null)
{
//https://stackoverflow.com/questions/14819426/how-to-create-hyperlink-in-messagebox-show#14820039
System.Windows.MessageBoxResult messageBoxResult = System.Windows.MessageBox.Show("New version available on GitHub, would you like to download?", "【MHF-Z】Overlay Update Available", System.Windows.MessageBoxButton.YesNo, System.Windows.MessageBoxImage.Asterisk, MessageBoxResult.No); if (messageBoxResult.ToString() == "Yes") { System.Diagnostics.Process.Start("https://github.com/DorielRivalet/MHFZ_Overlay/releases/latest"); }
//UpdateManager.RestartApp();
}
}

/// <summary>
/// Initializes a new instance of the <see cref="DataLoader"/> class.
/// </summary>
public DataLoader()
{
// run Squirrel first, as the app may exit after these run
SquirrelAwareApp.HandleEvents(
onInitialInstall: OnAppInstall,
onAppUninstall: OnAppUninstall,
onEveryRun: OnAppRun);

_ = UpdateMyApp();
// ... other app init code after ...



int PID = m.GetProcIdFromName("mhf");
if (PID > 0)
{
52 changes: 26 additions & 26 deletions MHFZ_Overlay/Dictionary.cs
Original file line number Diff line number Diff line change
@@ -1210,19 +1210,19 @@ public class MapAreaList
{306,"Highlands Night Area 6" },
{307,"Highlands Day Area 7" },
{308,"Highlands Night Area 7" },
{309,"Solitude Island" },
{309,"Solitude Island 9 (Area 3)" },
{310,"Campaign Tent" }, //in quest?
{311,"Raviente Balloon" },
{312,"Raviente Balloon" },
{313,"Solitude Island" },
{314,"Solitude Isle 1" },
{315,"Solitude Island" },
{316,"Solitude Island" },
{317,"Solitude Isle 2" },
{318,"Solitude Island" },
{319,"Solitude Island" },
{320,"Solitude Isle 3" },
{321,"Solitude Island" },
{311,"Raviente Balloon (Day)" },
{312,"Raviente Balloon (Sunset)" },
{313,"Raviente Balloon (Night)"},
{314,"Solitude Island 1 (Area 1)" },
{315,"Solitude Island 2 (Area 1)" },
{316,"Solitude Island 3 (Area 1)" },
{317,"Solitude Island 4 (Area 2)" },
{318,"Solitude Island 5 (Area 2)" },
{319,"Solitude Island 6 (Area 2)" },
{320,"Solitude Island 7 (Area 3)" },
{321,"Solitude Island 8 (Area 3)" },
{322,"Tidal Island Day Base Camp" },
{323,"Tidal Island Day Area 1" },
{324,"Tidal Island Day Area 2" },
@@ -1318,12 +1318,12 @@ public class MapAreaList
{414,"Duremudira Door" },
{415,"Urgent Tower" },
{416,"4th District Tower" },
{417,"Berserk Raviente Base Camp Slay 1" },
{418,"Berserk Raviente Combat 01" },
{419,"Berserk Raviente Combat 02" },
{420,"Berserk Raviente Combat 03" },
{421,"Berserk Raviente Combat 04" },
{422,"Berserk Raviente Combat 05" },
{417,"Berserk Raviente Base Camp" },
{418,"Berserk Raviente Combat Phase 1" },
{419,"Berserk Raviente Combat Phase 2" },
{420,"Berserk Raviente Combat Phase 3" },
{421,"Berserk Raviente Combat Phase 4" },
{422,"Berserk Raviente Combat Phase 5" },
{423,"Painted Falls Day Base Camp" },
{424,"Painted Falls Night Base Camp" },
{425,"Painted Falls Day Area 1" },
@@ -1338,14 +1338,14 @@ public class MapAreaList
{434,"Painted Falls Night Area 5" },
{435,"Painted Falls Day Area 6" },
{436,"Painted Falls Night Area 6" },
{437,"Guanzorumu Arena 01" },
{438,"Berserk Raviente Base Camp" },
{439,"Guanzorumu Arena 02" },
{440,"Berserk Raviente Support 01" },
{441,"Berserk Raviente Support 02" },
{442,"Berserk Raviente Support 03" },
{443,"Berserk Raviente Support 04" },
{444,"Berserk Raviente Support 05" },
{437,"Berserk Raviente Base Camp (Support)" },//TODO: test
{438,"Guanzorumu Arena Base Camp" },
{439,"Guanzorumu Arena Area 1" },
{440,"Berserk Raviente Support Phase 1" },
{441,"Berserk Raviente Support Phase 2" },
{442,"Berserk Raviente Support Phase 3" },
{443,"Berserk Raviente Support Phase 4" },
{444,"Berserk Raviente Support Phase 5" },
{445,"Diva Hall" },
{446,"Amatsu Arena 1" },
{447,"Amatsu Arena 2" },
1 change: 1 addition & 0 deletions MHFZ_Overlay/MHFZ_Overlay.csproj
Original file line number Diff line number Diff line change
@@ -51,6 +51,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="Clowd.Squirrel" Version="2.9.42" />
<PackageReference Include="DiscordRichPresence" Version="1.0.175" />
<PackageReference Include="Extended.Wpf.Toolkit" Version="4.4.0" />
<PackageReference Include="FontAwesome.Sharp" Version="6.1.1" />
18 changes: 9 additions & 9 deletions MHFZ_Overlay/MainWindow.xaml.cs
Original file line number Diff line number Diff line change
@@ -1,27 +1,18 @@
using DiscordRPC;
using MHFZ_Overlay.addresses;
using MHFZ_Overlay.controls;
using Microsoft.VisualBasic;
using System;
using System.Diagnostics.Metrics;
using System.Drawing;
using System.Globalization;
using System.Runtime.InteropServices;
using System.Text.RegularExpressions;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Forms;
using System.Windows.Input;
using System.Windows.Interop;
using System.Windows.Media;
using System.Windows.Media.Media3D;
using System.Windows.Threading;
using static System.Net.WebRequestMethods;
using Application = System.Windows.Application;
using Brush = System.Windows.Media.Brush;
using Brushes = System.Windows.Media.Brushes;
using Color = System.Windows.Media.Color;
using DataFormats = System.Windows.DataFormats;
using DataObject = System.Windows.DataObject;
@@ -32,6 +23,7 @@
using Point = System.Windows.Point;
//using static System.Globalization.CultureInfo;


namespace MHFZ_Overlay
{
/// <summary>
@@ -2220,6 +2212,14 @@ public bool IsDure()
return false;
}

public bool IsRavi()
{
if (DataLoader.model.getRaviName() != "None")
return true;
else
return false;
}

//dure and road
/// <summary>
/// In the arena?
2 changes: 1 addition & 1 deletion MHFZ_Overlay/Settings.Designer.cs

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

2 changes: 1 addition & 1 deletion MHFZ_Overlay/Settings.settings
Original file line number Diff line number Diff line change
@@ -120,7 +120,7 @@
<Value Profile="(Default)">685</Value>
</Setting>
<Setting Name="AlwaysShowPlayerInfo" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">False</Value>
<Value Profile="(Default)">True</Value>
</Setting>
<Setting Name="EnableSharpnessPercentage" Type="System.Boolean" Scope="User">
<Value Profile="(Default)">True</Value>
37 changes: 36 additions & 1 deletion MHFZ_Overlay/addresses/AddressModel.cs
Original file line number Diff line number Diff line change
@@ -67,7 +67,7 @@ public abstract class AddressModel : INotifyPropertyChanged

#endregion

#region abstract bool
#region abstract vars
abstract public bool IsNotRoad();

abstract public int HitCountInt();
@@ -223,6 +223,14 @@ public abstract class AddressModel : INotifyPropertyChanged

abstract public int RoadSelectedMonster();

abstract public int RavienteTriggeredEvent();

//normal and violent. berserk support
abstract public int RavienteAreaID();

abstract public int GreatSlayingPoints();
abstract public int GreatSlayingPointsSaved();

#endregion

public bool HasMonster1 => ShowHPBar(LargeMonster1ID(), Monster1HPInt());
@@ -2054,6 +2062,33 @@ public string getDureName()
return "None";
}

//quest ids
//ravi 62105 TODO: same ids in all phases?
//violent 62101
//berserk
//berserk practice
// support 1 55803
//extreme
/// <summary>
/// Gets the name of the ravi.
/// </summary>
/// <returns></returns>
public string getRaviName()
{
if (QuestID() == 21731 || QuestID() == 21749)
return "1st District Duremudira";
else if (QuestID() == 21746 || QuestID() == 21750)
return "2nd District Duremudira";
else if (QuestID() == 21747 || QuestID() == 21734)
return "3rd District Duremudira";
else if (QuestID() == 21748)
return "4th District Duremudira";
else if (QuestID() == 23648 || QuestID() == 23649)
return "Arrogant Duremudira";
else
return "None";
}

public string Monster1Name => getDureName() != "None" ? getDureName() : getMonsterName(GetNotRoad() || RoadSelectedMonster() == 0 ? LargeMonster1ID() : LargeMonster2ID()); //monster 1 is used for the first display and road uses 2nd choice to store 2nd monster
public string Monster2Name => getMonsterName(LargeMonster2ID());
public string Monster3Name => getMonsterName(LargeMonster3ID());
4 changes: 4 additions & 0 deletions MHFZ_Overlay/addresses/AddressModelHGE.cs
Original file line number Diff line number Diff line change
@@ -267,5 +267,9 @@ public int LargeMonster2Road()
public override int Objective1CurrentQuantityMonster() => M.Read2Byte("mhfo-hd.dll+ECB2A38");
public override int Objective1CurrentQuantityItem() => M.Read2Byte("mhfo-hd.dll+DC6C2F2");

public override int RavienteTriggeredEvent() => 1;
public override int RavienteAreaID() => 1;
public override int GreatSlayingPoints() => 1;
public override int GreatSlayingPointsSaved() => 1;
}
}
7 changes: 5 additions & 2 deletions MHFZ_Overlay/addresses/AddressModelNotHGE.cs
Original file line number Diff line number Diff line change
@@ -124,8 +124,8 @@ public int LargeMonster2Road()


//new addresses
//public override int AreaID() => M.Read2Byte("mhfo.dll+5034388");
public override int AreaID() => M.Read2Byte("mhfo.dll+6124B6E");
public override int AreaID() => M.Read2Byte("mhfo.dll+5034388");
public override int RavienteAreaID() => M.Read2Byte("mhfo.dll+6124B6E");
public override int GRankNumber() => M.Read2Byte("mhfo.dll+613DD30");
public override int GSR() => M.Read2Byte("mhfo.dll+50349A2");
public override int RoadFloor() => M.Read2Byte("mhfo.dll+5C47600");
@@ -202,5 +202,8 @@ public int LargeMonster2Road()
public override int Objective1CurrentQuantityMonster() => M.Read2Byte("mhfo.dll+60792E6");
public override int Objective1CurrentQuantityItem() => M.Read2Byte("mhfo.dll+5034732");

public override int RavienteTriggeredEvent() => M.Read2Byte("mhfo.dll+61005C6");
public override int GreatSlayingPoints() => M.ReadInt("mhfo.dll+5B45FF8");
public override int GreatSlayingPointsSaved() => M.ReadInt("mhfo.dll+61005C4");
}
}
109 changes: 81 additions & 28 deletions MHFZ_Overlay/addresses/README.md
Original file line number Diff line number Diff line change
@@ -156,7 +156,7 @@
| 4 | Lower |
| 5 | Lower |
| 6 | Lower |
| 7 | Lower |
| 7 | Lower (also Raviente) |
| 8 | Lower |
| 9 | Lower |
|10 | Lower |
@@ -202,7 +202,7 @@
|50 ||
|51 ||
|52 ||
|53 | G Rank |
|53 | G Rank (also Berserk Raviente) |
|54 | Musou 1 (Repel/20m/Lower Shiten)|
|55 | Musou 2 (Slay/10m/Upper Shiten)|
|56 | Twinhead (Rajang+Voljang)|
@@ -1116,19 +1116,19 @@
|306 | Highlands Night Area 6|
|307 | Highlands Day Area 7|
|308 | Highlands Night Area 7|
|309 | Solitude Island|
|309 | Solitude Island 9 (Area 3)|
|310 |Campaign Tent|
|311 | Raviente Balloon|
|312 | Raviente Balloon|
|313 | Solitude Island|
|314 | Solitude Isle 1|
|315 |Solitude Island|
|316 | Solitude Island|
|317 | Solitude Isle 2|
|318 | Solitude Island|
|319 | Solitude Island|
|320 | Solitude Isle 3|
|321 | Solitude Island|
|311 | Raviente Balloon (Day)|
|312 | Raviente Balloon (Sunset)|
|313 | Solitude Island (Night)|
|314 | Solitude Island 1 (Area 1)|
|315 |Solitude Island 2 (Area 1) |
|316 | Solitude Island 3 (Area 1)|
|317 | Solitude Island 4 (Area 2)|
|318 | Solitude Island 5 (Area 2)|
|319 | Solitude Island 6 (Area 2)|
|320 | Solitude Island 7 (Area 3)|
|321 | Solitude Island 8 (Area 3)|
|322 | Tidal Island Day Base Camp|
|323 | Tidal Island Day Area 1|
|324 | Tidal Island Day Area 2|
@@ -1224,12 +1224,12 @@
|414 | Duremudira Door|
|415 | Urgent Tower|
|416 | 4th District Tower|
|417 | Berserk Raviente Base Camp Slay 1|
|418 |Berserk Raviente Combat 01|
|419 | Berserk Raviente Combat 02|
|420 | Berserk Raviente Combat 03|
|421 | Berserk Raviente Combat 04|
|422 |Berserk Raviente Combat 05|
|417 | Berserk Raviente Base Camp|
|418 |Berserk Raviente Combat Phase 1|
|419 | Berserk Raviente Combat Phase 2|
|420 | Berserk Raviente Combat Phase 3|
|421 | Berserk Raviente Combat Phase 4|
|422 |Berserk Raviente Combat Phase 5|
|423 |Painted Falls Day Base Camp|
|424 | Painted Falls Night Base Camp|
|425 | Painted Falls Day Area 1|
@@ -1244,14 +1244,14 @@
|434 | Painted Falls Night Area 5|
|435 |Painted Falls Day Area 6|
|436 | Painted Falls Night Area 6|
|437 | Guanzorumu Arena 01|
|438 | Berserk Raviente Base Camp|
|439 | Guanzorumu Arena 02|
|440 | Berserk Raviente Support 01|
|441 | Berserk Raviente Support 02|
|442 | Berserk Raviente Support 03|
|443 | Berserk Raviente Support 04|
|444 | Berserk Raviente Support 05|
|437 | Berserk Raviente Base Camp (Support)|
|438 | Guanzorumu Arena 1|
|439 | Guanzorumu Arena 2|
|440 | Berserk Raviente Support Phase 1|
|441 | Berserk Raviente Support Phase 2|
|442 | Berserk Raviente Support Phase 3|
|443 | Berserk Raviente Support Phase 4|
|444 | Berserk Raviente Support Phase 5|
|445 | Diva Hall|
|446 | Amatsu Arena 1|
|447 | Amatsu Arena 2|
@@ -1663,3 +1663,56 @@
|1|Heaven|
|2|Storm|
|3|Extreme|

### Raviente Trigger Events

|ID| Event|
|--|------|
|0|Slay 1|
|1|Sedation 1|
|2|Destruction 1|
|3|Slay 2|
|4|Sedation 2|
|5|Sedation 3|
|6|Slay 4|
|7|Slay 5|
|8|Sedation 5|
|9|Slay 6|
|10|Slay 7|
|11|Sedation 7|
|12|Sedation 8|
|13|Slay 9|

### Violent Raviente Trigger Events

|ID| Event|
|--|------|
|0|Slay 1|
|1|Sedation 1|
|2|Destruction 1|
|3|Slay 2|
|4|Sedation 2|
|5|Sedation 3|
|6|Slay 4|
|7|Slay 5|
|8|Sedation 5|
|9|Slay 6|
|10|Slay 7|
|11|Slay 8|
|12|Sedation 7|
|13|Slay 9|

### Berserk Raviente (Practice) Trigger Events

|ID| Event|
|--|------|
|0|Slay 1|
|1|Sedation 1|
|2|Support and Combat 1|
|3|Destruction 2|
|4|Destruction 3|
|5|Destruction 4|
|6|Support 2|
|7|Sedation 4|
|8|Sedation 5|
|9|Sedation 6|
1 change: 1 addition & 0 deletions MHFZ_Overlay/app.manifest
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<assembly manifestVersion="1.0" xmlns="urn:schemas-microsoft-com:asm.v1">
<assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
<SquirrelAwareVersion xmlns="urn:schema-squirrel-com:asm.v1">1</SquirrelAwareVersion>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
<security>
<requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -98,13 +98,15 @@ If the monster HP shown is less than what its actual values should be, restart b
- With Monster EHP enabled, if you cart, the max EHP turns into the current EHP, along with some other info max values
- Sometimes when exiting Drag and Drop the monster HP information disappears
- Spawning in the same area as the monster doesn't load the information properly. Fix: re-enter area
- Duremudira HP not showing. Fix: enable *Always Show Monster Info*, load another quest showing the HP bars (not just the numbers), then retry.
- Duremudira/Road/Raviente HP not showing. Fix: enable *Always Show Monster Info*, load another quest showing the HP bars (not just the numbers), then retry.
- Monster size values not shown correctly
- Monster HP values are less than the actual values when not loading properly
- Damage numbers over 1000 not working
- Yamas and Berukyurosu information not working
- Daily quests not working

Fully reinstalling the game or .NET dependencies may fix some bugs.

[Check more bugs here](https://github.com/DorielRivalet/MHFZ_Overlay/issues?q=is%3Aissue+is%3Aopen+label%3Abug)

## Features not yet implemented
@@ -133,6 +135,7 @@ If the monster HP shown is less than what its actual values should be, restart b
- Zenith information in Road
- Settings import/export
- Discord Rich Presence Party Size
- Raviente Support Part Info

[Check more possible future features here](https://github.com/DorielRivalet/MHFZ_Overlay/issues?q=is%3Aissue+is%3Aopen+label%3Aenhancement)

0 comments on commit 856c11d

Please sign in to comment.