From 1de30e0c8d7d6aba662a182088d0c70ff21ef68f Mon Sep 17 00:00:00 2001
From: Doriel Rivalet <100863878+DorielRivalet@users.noreply.github.com>
Date: Tue, 10 Jan 2023 23:46:03 -0300
Subject: [PATCH] feat(ui): add controller layout options
---
MHFZ_Overlay/App.config | 6 ++---
MHFZ_Overlay/ConfigWindow.xaml | 34 +++++++++++++++++-------
MHFZ_Overlay/MainWindow.xaml | 36 +++++++++++++++++++++++++-
MHFZ_Overlay/MainWindow.xaml.cs | 7 +++++
MHFZ_Overlay/Settings.Designer.cs | 6 ++---
MHFZ_Overlay/Settings.settings | 6 ++---
MHFZ_Overlay/addresses/AddressModel.cs | 3 ++-
7 files changed, 77 insertions(+), 21 deletions(-)
diff --git a/MHFZ_Overlay/App.config b/MHFZ_Overlay/App.config
index 3e2ca498..18cd7f79 100644
--- a/MHFZ_Overlay/App.config
+++ b/MHFZ_Overlay/App.config
@@ -506,13 +506,13 @@
610
- False
+ True
- 0
+ 160
- 0
+ 550
False
diff --git a/MHFZ_Overlay/ConfigWindow.xaml b/MHFZ_Overlay/ConfigWindow.xaml
index 972245d0..47a49003 100644
--- a/MHFZ_Overlay/ConfigWindow.xaml
+++ b/MHFZ_Overlay/ConfigWindow.xaml
@@ -226,7 +226,13 @@
-
+
+
+
+
+
+
+
@@ -310,16 +316,24 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
diff --git a/MHFZ_Overlay/MainWindow.xaml b/MHFZ_Overlay/MainWindow.xaml
index e83598fc..d1d5dae2 100644
--- a/MHFZ_Overlay/MainWindow.xaml
+++ b/MHFZ_Overlay/MainWindow.xaml
@@ -54,7 +54,7 @@
-
+
@@ -187,6 +187,40 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/MHFZ_Overlay/MainWindow.xaml.cs b/MHFZ_Overlay/MainWindow.xaml.cs
index da229e2d..1bb719e7 100644
--- a/MHFZ_Overlay/MainWindow.xaml.cs
+++ b/MHFZ_Overlay/MainWindow.xaml.cs
@@ -974,6 +974,7 @@ private void HidePlayerInfoWhenNotInQuest()
DataLoader.model.ShowDamagePerSecond = v && s.DamagePerSecondShown;
DataLoader.model.ShowKBMLayout = v && s.KBMLayoutShown;
+ DataLoader.model.ShowControllerLayout = v && s.ControllerLayoutShown;
DataLoader.model.ShowAPM = v && s.ActionsPerMinuteShown;
}
@@ -2272,11 +2273,17 @@ private void MainGrid_DragOver(object sender, DragEventArgs e)
s.KBMLayoutX = (double)(pos.X - XOffset);
s.KBMLayoutY = (double)(pos.Y - XOffset);
break;
+ case "ControllerLayoutGrid":
+ s.ControllerLayoutX = (double)(pos.X - XOffset);
+ s.ControllerLayoutY = (double)(pos.Y - XOffset);
+ break;
case "ActionsPerMinuteInfo":
s.ActionsPerMinuteX = (double)(pos.X - XOffset);
s.ActionsPerMinuteY = (double)(pos.Y - XOffset);
break;
+
+ // Monster
case "Monster1HpBar":
s.Monster1HealthBarX = (double)(pos.X - XOffset);
s.Monster1HealthBarY = (double)(pos.Y - YOffset);
diff --git a/MHFZ_Overlay/Settings.Designer.cs b/MHFZ_Overlay/Settings.Designer.cs
index a5e83522..74ca0d98 100644
--- a/MHFZ_Overlay/Settings.Designer.cs
+++ b/MHFZ_Overlay/Settings.Designer.cs
@@ -2018,7 +2018,7 @@ public double KBMLayoutY {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("False")]
+ [global::System.Configuration.DefaultSettingValueAttribute("True")]
public bool ControllerLayoutShown {
get {
return ((bool)(this["ControllerLayoutShown"]));
@@ -2030,7 +2030,7 @@ public bool ControllerLayoutShown {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("0")]
+ [global::System.Configuration.DefaultSettingValueAttribute("160")]
public double ControllerLayoutX {
get {
return ((double)(this["ControllerLayoutX"]));
@@ -2042,7 +2042,7 @@ public double ControllerLayoutX {
[global::System.Configuration.UserScopedSettingAttribute()]
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
- [global::System.Configuration.DefaultSettingValueAttribute("0")]
+ [global::System.Configuration.DefaultSettingValueAttribute("550")]
public double ControllerLayoutY {
get {
return ((double)(this["ControllerLayoutY"]));
diff --git a/MHFZ_Overlay/Settings.settings b/MHFZ_Overlay/Settings.settings
index bbbc5bd8..04fe6ae5 100644
--- a/MHFZ_Overlay/Settings.settings
+++ b/MHFZ_Overlay/Settings.settings
@@ -501,13 +501,13 @@
610
- False
+ True
- 0
+ 160
- 0
+ 550
False
diff --git a/MHFZ_Overlay/addresses/AddressModel.cs b/MHFZ_Overlay/addresses/AddressModel.cs
index f63c5a7b..8b1fc93a 100644
--- a/MHFZ_Overlay/addresses/AddressModel.cs
+++ b/MHFZ_Overlay/addresses/AddressModel.cs
@@ -1610,7 +1610,8 @@ public string isPlayerHit
if (Dictionary.WeaponCanUseReflect.WeaponTypeID[WeaponType()])
hasReflect = true;
- if (!hasReflect && TotalHitsTakenBlocked == 0 && ShowHitsTakenBlockedColor())
+ // for speedrunners to get hit by 1 small bomb at least. and 2 perfect guards to get max obscurity.
+ if ((!hasReflect && TotalHitsTakenBlocked <= 1) || (hasReflect && TotalHitsTakenBlocked <= 3) && ShowHitsTakenBlockedColor())
{
PlayerHitsTakenBlockedIcon = "UI/Icons/png/defense_up.png";
return "#f38ba8";