From d0d3387efb21e421da40efc273b802e7a83bd062 Mon Sep 17 00:00:00 2001 From: Vedang Naik Date: Sat, 19 Feb 2022 23:54:44 -0500 Subject: [PATCH 1/6] Major renaming + stub for CB widget --- MHRUIpp/{BuffIndicatorPP.lua => BuffIndicator++.lua} | 0 .../{DebuffIndicatorPP.lua => DebuffIndicator++.lua} | 0 MHRUIpp/{HealthBarPP.lua => HealthBar++.lua} | 0 MHRUIpp/{QuestTimerPP.lua => QuestTimer++.lua} | 0 .../{SharpnessGaugePP.lua => SharpnessGauge++.lua} | 0 MHRUIpp/{StaminaBarPP.lua => StaminaBar++.lua} | 0 MHRUIpp/WeaponWidgets++/ChargeBladeUI++.lua | 12 ++++++++++++ MHRUIpp/helpers.lua | 8 ++++---- 8 files changed, 16 insertions(+), 4 deletions(-) rename MHRUIpp/{BuffIndicatorPP.lua => BuffIndicator++.lua} (100%) rename MHRUIpp/{DebuffIndicatorPP.lua => DebuffIndicator++.lua} (100%) rename MHRUIpp/{HealthBarPP.lua => HealthBar++.lua} (100%) rename MHRUIpp/{QuestTimerPP.lua => QuestTimer++.lua} (100%) rename MHRUIpp/{SharpnessGaugePP.lua => SharpnessGauge++.lua} (100%) rename MHRUIpp/{StaminaBarPP.lua => StaminaBar++.lua} (100%) create mode 100644 MHRUIpp/WeaponWidgets++/ChargeBladeUI++.lua diff --git a/MHRUIpp/BuffIndicatorPP.lua b/MHRUIpp/BuffIndicator++.lua similarity index 100% rename from MHRUIpp/BuffIndicatorPP.lua rename to MHRUIpp/BuffIndicator++.lua diff --git a/MHRUIpp/DebuffIndicatorPP.lua b/MHRUIpp/DebuffIndicator++.lua similarity index 100% rename from MHRUIpp/DebuffIndicatorPP.lua rename to MHRUIpp/DebuffIndicator++.lua diff --git a/MHRUIpp/HealthBarPP.lua b/MHRUIpp/HealthBar++.lua similarity index 100% rename from MHRUIpp/HealthBarPP.lua rename to MHRUIpp/HealthBar++.lua diff --git a/MHRUIpp/QuestTimerPP.lua b/MHRUIpp/QuestTimer++.lua similarity index 100% rename from MHRUIpp/QuestTimerPP.lua rename to MHRUIpp/QuestTimer++.lua diff --git a/MHRUIpp/SharpnessGaugePP.lua b/MHRUIpp/SharpnessGauge++.lua similarity index 100% rename from MHRUIpp/SharpnessGaugePP.lua rename to MHRUIpp/SharpnessGauge++.lua diff --git a/MHRUIpp/StaminaBarPP.lua b/MHRUIpp/StaminaBar++.lua similarity index 100% rename from MHRUIpp/StaminaBarPP.lua rename to MHRUIpp/StaminaBar++.lua diff --git a/MHRUIpp/WeaponWidgets++/ChargeBladeUI++.lua b/MHRUIpp/WeaponWidgets++/ChargeBladeUI++.lua new file mode 100644 index 0000000..adf575c --- /dev/null +++ b/MHRUIpp/WeaponWidgets++/ChargeBladeUI++.lua @@ -0,0 +1,12 @@ +-- re.on_frame(function() +-- local InputManager = sdk.get_managed_singleton("snow.StmInputManager") +-- -- local inputManagerType = sdk.find_type_definition("snow.StmInputManager") +-- local inGameInputDevice = InputManager:get_field("_InGameInputDevice") +-- -- local inGameDeviceType = sdk.find_type_definition("snow.StmInputManager.InGameInputDevice") +-- local playerInput = inGameInputDevice:get_field("_pl_input") +-- local player = playerInput:get_field("RefPlayer") +-- -- local player = sdk.get_native_field(playerInput, getType("snow.StmPlayerInput"),"RefPlayer") -- Will be a weapon class or PlayerLobbyBase if you're not in a quest + + +-- log_str = player:call("get_ChargedBottleNum") +-- end) \ No newline at end of file diff --git a/MHRUIpp/helpers.lua b/MHRUIpp/helpers.lua index d7ac693..0343148 100644 --- a/MHRUIpp/helpers.lua +++ b/MHRUIpp/helpers.lua @@ -68,7 +68,7 @@ function mergeTables(tables) return t end --- log_str = "" --- re.on_draw_ui(function() --- imgui.text(tostring(log_str)) --- end) \ No newline at end of file +log_str = "" +re.on_draw_ui(function() + imgui.text(tostring(log_str)) +end) \ No newline at end of file From ab4441b84a87027fa540c798498df0838c4f356f Mon Sep 17 00:00:00 2001 From: Vedang Naik Date: Sun, 20 Feb 2022 00:55:32 -0500 Subject: [PATCH 2/6] Started work on CB UI --- MHRUIpp/WeaponWidgets++/ChargeBladeUI++.lua | 97 ++++++++++++++++++--- MHRUIpp/helpers.lua | 11 ++- MHRUIpp_main.lua | 17 ++-- 3 files changed, 103 insertions(+), 22 deletions(-) diff --git a/MHRUIpp/WeaponWidgets++/ChargeBladeUI++.lua b/MHRUIpp/WeaponWidgets++/ChargeBladeUI++.lua index adf575c..70dff30 100644 --- a/MHRUIpp/WeaponWidgets++/ChargeBladeUI++.lua +++ b/MHRUIpp/WeaponWidgets++/ChargeBladeUI++.lua @@ -1,12 +1,85 @@ --- re.on_frame(function() --- local InputManager = sdk.get_managed_singleton("snow.StmInputManager") --- -- local inputManagerType = sdk.find_type_definition("snow.StmInputManager") --- local inGameInputDevice = InputManager:get_field("_InGameInputDevice") --- -- local inGameDeviceType = sdk.find_type_definition("snow.StmInputManager.InGameInputDevice") --- local playerInput = inGameInputDevice:get_field("_pl_input") --- local player = playerInput:get_field("RefPlayer") --- -- local player = sdk.get_native_field(playerInput, getType("snow.StmPlayerInput"),"RefPlayer") -- Will be a weapon class or PlayerLobbyBase if you're not in a quest - - --- log_str = player:call("get_ChargedBottleNum") --- end) \ No newline at end of file +require("MHRUIpp/interfaces") + +return { + new = function(self) + o = {} + setmetatable(self, {__index = IPersistantConfigurableViewableWidget}) + self.__index = self + setmetatable(o, self) + o.cfgFilepath = o.cfgFilepath .. "ChargeBladeUI++.json" + o.defaults = mergeTables({o.defaults, { + vialX = 500, + vialY = 500, + borderWidth = 2, + textColor = "0xFFFFFFFF" + }}) + o:loadCfg() + o:loadFont() + return o + end, + + draw = function(self) + local CBData = getCurrentWeaponInstanceIfIs("ChargeAxe"); + if not CBData then return end + -- Gather all required CB stats. + local numVials = CBData:call("getBottleNumMax") + local numFilledVials = CBData:call("get_ChargedBottleNum") + local gaugeState = CBData:call("get_ChargeGaugeState") -- 0 = empty, 1 = half, 2 = full, 3 = overheat + local ShieldBuffTimer = CBData:get_field("_ShieldBuffTimer") + local SwordBuffTimer = CBData:get_field("_SwordBuffTimer") + local isSwordBuffed = CBData:call("isSwordBuff") + local isShieldBuffed = CBData:call("isShieldBuff") + + log_str = "here" + + -- Draw vials and sword state gauge. + local text = string.format("%d/%d", numFilledVials, numVials) + local w = (string.len(text) * self.cfg.fontSize * fontAspectRatio) + (textHorizOffset << 1) + local h = self.cfg.fontSize + (textVertOffset << 1) + + imgui.push_font(self.font) + draw.filled_rect(self.cfg.vialX - self.cfg.borderWidth, self.cfg.vialY - self.cfg.borderWidth, w + borderOffset, h + borderOffset, self.gaugeStateColors[gaugeState]) + -- draw.filled_rect(self.cfg.x, self.cfg.y, w, h, self.cfg.bgColor) + -- draw.text(text, self.cfg.x + textHorizOffset, self.cfg.y + textVertOffset, self.cfg.textColor) + imgui.pop_font() + end, + + drawConfigWindow = function(self) + -- self.cfgWinVisible = imgui.begin_window("Configure Buff Indicator++", true, 0x10120) + -- if not self.cfgWinVisible then return false end + + -- local changed = false; + -- changed, self.cfg.visible = imgui.checkbox("Show?", self.cfg.visible) + -- self.cfgChanged = self.cfgChanged or changed + -- changed, self.cfg.visibleNotDebuffed = imgui.checkbox("Show when not debuffed?", self.cfg.visibleNotDebuffed) + -- self.cfgChanged = self.cfgChanged or changed + -- imgui.new_line() + + -- changed, self.cfg.fontSize = imgui.drag_int("Font Size", self.cfg.fontSize, 1, 2, 50) + -- self.cfgChanged = self.cfgChanged or changed + -- changed, self.cfg.x = imgui.drag_int("X position", self.cfg.x, 2, 0, 10000) + -- self.cfgChanged = self.cfgChanged or changed + -- changed, self.cfg.y = imgui.drag_int("Y position", self.cfg.y, 2, 0, 10000) + -- self.cfgChanged = self.cfgChanged or changed + -- changed, self.cfg.borderWidth = imgui.drag_int("Border", self.cfg.borderWidth, 1, 0, 50) + -- self.cfgChanged = self.cfgChanged or changed + -- imgui.text("Color pickers coming soon!") + -- imgui.new_line() + + -- if imgui.button("Reset Defaults") then + -- self:restoreDefaults() + -- self.cfgChanged = true + -- end + + -- imgui.end_window() + + return true + end, + + gaugeStateColors = { + [0] = "0xAA000000", + [1] = "0xAA04B3D0", + [2] = "0xAA4545D0", + [3] = "0xAA6060FF" + } +} \ No newline at end of file diff --git a/MHRUIpp/helpers.lua b/MHRUIpp/helpers.lua index 0343148..b8a1cd9 100644 --- a/MHRUIpp/helpers.lua +++ b/MHRUIpp/helpers.lua @@ -17,6 +17,7 @@ HWKeyboardManager = nil SceneManager = sdk.get_native_singleton("via.SceneManager") MessageManager = nil EnemyManager = nil +InputManager = nil -- Typedefs StageManager_typedef = sdk.find_type_definition("snow.stage.StageManager") VillageAreaManager_typedef = sdk.find_type_definition("snow.VillageAreaManager") @@ -43,17 +44,23 @@ tempToggleKeyNumber = 46 -- Screen width screenWidth = sdk.call_native_func(SceneManager, SceneManager_typedef, "get_MainView"):call("get_Size"):get_field("w") --- Helpers functions function getPlayer() if not PlayerManager then PlayerManager = sdk.get_managed_singleton("snow.player.PlayerManager") end return PlayerManager:call("findMasterPlayer") end --- We need to keep getting this singleton for this to work properly :| function isInTrainingArea() + -- We need to keep getting this singleton for this to work properly :| return sdk.get_managed_singleton("snow.VillageAreaManager"):call("get__CurrentAreaNo") == 5 end +-- Returns the current equipped weapon class if it is weaponName, else nil. +function getCurrentWeaponInstanceIfIs(weaponName) + if not InputManager then InputManager = sdk.get_managed_singleton("snow.StmInputManager") end + local weapon = InputManager:get_field("_InGameInputDevice"):get_field("_pl_input"):get_field("RefPlayer") + if weapon:get_type_definition():get_name() == weaponName then return weapon end +end + function mergeTables(tables) local t = {} for _, table in ipairs(tables) do diff --git a/MHRUIpp_main.lua b/MHRUIpp_main.lua index a2845cd..ca54659 100644 --- a/MHRUIpp_main.lua +++ b/MHRUIpp_main.lua @@ -2,19 +2,20 @@ require("MHRUIpp/helpers") -- Put all elements in array and set them up. StockUIHandler = require("MHRUIpp/StockUIHandler"):new() -StaminaBarPP = require("MHRUIpp/StaminaBarPP"):new() -HealthBarPP = require("MHRUIpp/HealthBarPP"):new() -QuestTimerPP = require("MHRUIpp/QuestTimerPP"):new() -DebuffIndicatorPP = require("MHRUIpp/DebuffIndicatorPP"):new() -BuffIndicatorPP = require("MHRUIpp/BuffIndicatorPP"):new() -SharpnessGaugePP = require("MHRUIpp/SharpnessGaugePP"):new() +StaminaBarPP = require("MHRUIpp/StaminaBar++"):new() +HealthBarPP = require("MHRUIpp/HealthBar++"):new() +QuestTimerPP = require("MHRUIpp/QuestTimer++"):new() +DebuffIndicatorPP = require("MHRUIpp/DebuffIndicator++"):new() +BuffIndicatorPP = require("MHRUIpp/BuffIndicator++"):new() +SharpnessGaugePP = require("MHRUIpp/SharpnessGauge++"):new() MonsterHPBar = require("MHRUIpp/MonsterHPBar"):new() +ChargeBladeUIPP = require("MHRUIpp/WeaponWidgets++/ChargeBladeUI++"):new() -- Group widgets based on what interfaces they implement. -- Those with a Show button -local viewableWidgets = { StaminaBarPP, HealthBarPP, QuestTimerPP, DebuffIndicatorPP, BuffIndicatorPP, SharpnessGaugePP, MonsterHPBar } +local viewableWidgets = { StaminaBarPP, HealthBarPP, QuestTimerPP, DebuffIndicatorPP, BuffIndicatorPP, SharpnessGaugePP, MonsterHPBar, ChargeBladeUIPP } -- Those with profiles that need to be saved -local persistantConfigurableWidgets = { StaminaBarPP, HealthBarPP, QuestTimerPP, DebuffIndicatorPP, BuffIndicatorPP, SharpnessGaugePP, StockUIHandler, MonsterHPBar } +local persistantConfigurableWidgets = { StaminaBarPP, HealthBarPP, QuestTimerPP, DebuffIndicatorPP, BuffIndicatorPP, SharpnessGaugePP, StockUIHandler, MonsterHPBar, ChargeBladeUIPP } -- Those without a Show button local nonViewableWidgets = { StockUIHandler } From 16a5236cfba631477cfc87c8ab981b4c4de1db5f Mon Sep 17 00:00:00 2001 From: Vedang Naik Date: Sun, 20 Feb 2022 01:09:03 -0500 Subject: [PATCH 3/6] Added CB vial UI --- MHRUIpp/WeaponWidgets++/ChargeBladeUI++.lua | 27 +++++++++++++-------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/MHRUIpp/WeaponWidgets++/ChargeBladeUI++.lua b/MHRUIpp/WeaponWidgets++/ChargeBladeUI++.lua index 70dff30..8f6c82a 100644 --- a/MHRUIpp/WeaponWidgets++/ChargeBladeUI++.lua +++ b/MHRUIpp/WeaponWidgets++/ChargeBladeUI++.lua @@ -8,8 +8,8 @@ return { setmetatable(o, self) o.cfgFilepath = o.cfgFilepath .. "ChargeBladeUI++.json" o.defaults = mergeTables({o.defaults, { - vialX = 500, - vialY = 500, + vialX = 5, + vialY = 105, borderWidth = 2, textColor = "0xFFFFFFFF" }}) @@ -29,18 +29,18 @@ return { local SwordBuffTimer = CBData:get_field("_SwordBuffTimer") local isSwordBuffed = CBData:call("isSwordBuff") local isShieldBuffed = CBData:call("isShieldBuff") - - log_str = "here" - + -- Draw vials and sword state gauge. local text = string.format("%d/%d", numFilledVials, numVials) local w = (string.len(text) * self.cfg.fontSize * fontAspectRatio) + (textHorizOffset << 1) local h = self.cfg.fontSize + (textVertOffset << 1) - + local borderOffset = self.cfg.borderWidth << 1 + imgui.push_font(self.font) - draw.filled_rect(self.cfg.vialX - self.cfg.borderWidth, self.cfg.vialY - self.cfg.borderWidth, w + borderOffset, h + borderOffset, self.gaugeStateColors[gaugeState]) - -- draw.filled_rect(self.cfg.x, self.cfg.y, w, h, self.cfg.bgColor) - -- draw.text(text, self.cfg.x + textHorizOffset, self.cfg.y + textVertOffset, self.cfg.textColor) + log_str = self.cfg.borderWidth + draw.filled_rect(self.cfg.vialX - self.cfg.borderWidth, self.cfg.vialY - self.cfg.borderWidth, w + borderOffset, h + borderOffset, self.gaugeStateBorderColors[gaugeState]) + draw.filled_rect(self.cfg.vialX, self.cfg.vialY, w, h, self.guageStateFillColor[gaugeState]) + draw.text(text, self.cfg.vialX + textHorizOffset, self.cfg.vialY + textVertOffset, self.cfg.textColor) imgui.pop_font() end, @@ -76,10 +76,17 @@ return { return true end, - gaugeStateColors = { + gaugeStateBorderColors = { [0] = "0xAA000000", [1] = "0xAA04B3D0", [2] = "0xAA4545D0", + [3] = "0xAA4545D0" + }, + + guageStateFillColor = { + [0] = "0xAA000000", + [1] = "0xAA000000", + [2] = "0xAA000000", [3] = "0xAA6060FF" } } \ No newline at end of file From cdc1577310c55295aa378cf45ff14b815adfbdc6 Mon Sep 17 00:00:00 2001 From: Vedang Naik Date: Sun, 20 Feb 2022 01:18:43 -0500 Subject: [PATCH 4/6] Added short circuit to sharpness for weapons without it --- MHRUIpp/SharpnessGauge++.lua | 4 ++++ MHRUIpp/WeaponWidgets++/ChargeBladeUI++.lua | 5 ++--- MHRUIpp/helpers.lua | 6 +++--- 3 files changed, 9 insertions(+), 6 deletions(-) diff --git a/MHRUIpp/SharpnessGauge++.lua b/MHRUIpp/SharpnessGauge++.lua index 40a2e11..49274ab 100644 --- a/MHRUIpp/SharpnessGauge++.lua +++ b/MHRUIpp/SharpnessGauge++.lua @@ -21,6 +21,10 @@ return { end, draw = function(self) + -- Cancel function if the current weapon doesn't have sharpness. + local _, weaponName = getCurrentWeaponInstanceAndName() + if weaponName == "Bow" or weaponName == "LightBowgun" or weaponName == "HeavyBowgun" then return end + local playerBase = getPlayer() -- Get raw values. local currentSharpness = playerBase:call("get_SharpnessGauge") diff --git a/MHRUIpp/WeaponWidgets++/ChargeBladeUI++.lua b/MHRUIpp/WeaponWidgets++/ChargeBladeUI++.lua index 8f6c82a..6adebf3 100644 --- a/MHRUIpp/WeaponWidgets++/ChargeBladeUI++.lua +++ b/MHRUIpp/WeaponWidgets++/ChargeBladeUI++.lua @@ -19,8 +19,8 @@ return { end, draw = function(self) - local CBData = getCurrentWeaponInstanceIfIs("ChargeAxe"); - if not CBData then return end + local CBData, CBName = getCurrentWeaponInstanceAndName(); + if CBName ~= "ChargeAxe" or not CBData then return end -- Gather all required CB stats. local numVials = CBData:call("getBottleNumMax") local numFilledVials = CBData:call("get_ChargedBottleNum") @@ -37,7 +37,6 @@ return { local borderOffset = self.cfg.borderWidth << 1 imgui.push_font(self.font) - log_str = self.cfg.borderWidth draw.filled_rect(self.cfg.vialX - self.cfg.borderWidth, self.cfg.vialY - self.cfg.borderWidth, w + borderOffset, h + borderOffset, self.gaugeStateBorderColors[gaugeState]) draw.filled_rect(self.cfg.vialX, self.cfg.vialY, w, h, self.guageStateFillColor[gaugeState]) draw.text(text, self.cfg.vialX + textHorizOffset, self.cfg.vialY + textVertOffset, self.cfg.textColor) diff --git a/MHRUIpp/helpers.lua b/MHRUIpp/helpers.lua index b8a1cd9..08306f8 100644 --- a/MHRUIpp/helpers.lua +++ b/MHRUIpp/helpers.lua @@ -54,11 +54,11 @@ function isInTrainingArea() return sdk.get_managed_singleton("snow.VillageAreaManager"):call("get__CurrentAreaNo") == 5 end --- Returns the current equipped weapon class if it is weaponName, else nil. -function getCurrentWeaponInstanceIfIs(weaponName) +function getCurrentWeaponInstanceAndName() if not InputManager then InputManager = sdk.get_managed_singleton("snow.StmInputManager") end local weapon = InputManager:get_field("_InGameInputDevice"):get_field("_pl_input"):get_field("RefPlayer") - if weapon:get_type_definition():get_name() == weaponName then return weapon end + local weaponName = weapon:get_type_definition():get_name() + return weapon, weaponName end function mergeTables(tables) From 82b109cc690bc3d0c6e2b0192ce84417f949b14a Mon Sep 17 00:00:00 2001 From: Vedang Naik Date: Sun, 20 Feb 2022 16:11:23 -0500 Subject: [PATCH 5/6] Added CB sheild indicator --- MHRUIpp/WeaponWidgets++/ChargeBladeUI++.lua | 26 +++++++++++++-------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/MHRUIpp/WeaponWidgets++/ChargeBladeUI++.lua b/MHRUIpp/WeaponWidgets++/ChargeBladeUI++.lua index 6adebf3..23fe677 100644 --- a/MHRUIpp/WeaponWidgets++/ChargeBladeUI++.lua +++ b/MHRUIpp/WeaponWidgets++/ChargeBladeUI++.lua @@ -10,7 +10,10 @@ return { o.defaults = mergeTables({o.defaults, { vialX = 5, vialY = 105, + shieldX = 41, + shieldY = 105, borderWidth = 2, + borderColor = "0xAA000000", textColor = "0xFFFFFFFF" }}) o:loadCfg() @@ -25,8 +28,8 @@ return { local numVials = CBData:call("getBottleNumMax") local numFilledVials = CBData:call("get_ChargedBottleNum") local gaugeState = CBData:call("get_ChargeGaugeState") -- 0 = empty, 1 = half, 2 = full, 3 = overheat - local ShieldBuffTimer = CBData:get_field("_ShieldBuffTimer") - local SwordBuffTimer = CBData:get_field("_SwordBuffTimer") + local shieldBuffTimer = math.floor(CBData:get_field("_ShieldBuffTimer") * staminaUnitsToSeconds) + local swordBuffTimer = math.floor(CBData:get_field("_SwordBuffTimer") * staminaUnitsToSeconds) local isSwordBuffed = CBData:call("isSwordBuff") local isShieldBuffed = CBData:call("isShieldBuff") @@ -38,9 +41,19 @@ return { imgui.push_font(self.font) draw.filled_rect(self.cfg.vialX - self.cfg.borderWidth, self.cfg.vialY - self.cfg.borderWidth, w + borderOffset, h + borderOffset, self.gaugeStateBorderColors[gaugeState]) - draw.filled_rect(self.cfg.vialX, self.cfg.vialY, w, h, self.guageStateFillColor[gaugeState]) + draw.filled_rect(self.cfg.vialX, self.cfg.vialY, w, h, (gaugeState == 3 and "0xAA6060FF" or "0xAA000000")) draw.text(text, self.cfg.vialX + textHorizOffset, self.cfg.vialY + textVertOffset, self.cfg.textColor) imgui.pop_font() + + -- Draw shield buff indicator + text = (isShieldBuffed and string.format("Shield: %02d:%02d", shieldBuffTimer // 60, shieldBuffTimer % 60) or "Shield: Empty") + w = (string.len(text) * self.cfg.fontSize * fontAspectRatio) + (textHorizOffset << 1) + + imgui.push_font(self.font) + draw.filled_rect(self.cfg.shieldX - self.cfg.borderWidth, self.cfg.shieldY - self.cfg.borderWidth, w + borderOffset, h + borderOffset, self.cfg.borderColor) + draw.filled_rect(self.cfg.shieldX, self.cfg.shieldY, w, h, (isShieldBuffed and "0XAA796AFF" or "0xAAAB7E4A")) + draw.text(text, self.cfg.shieldX + textHorizOffset, self.cfg.shieldY + textVertOffset, self.cfg.textColor) + imgui.pop_font() end, drawConfigWindow = function(self) @@ -80,12 +93,5 @@ return { [1] = "0xAA04B3D0", [2] = "0xAA4545D0", [3] = "0xAA4545D0" - }, - - guageStateFillColor = { - [0] = "0xAA000000", - [1] = "0xAA000000", - [2] = "0xAA000000", - [3] = "0xAA6060FF" } } \ No newline at end of file From 527c26dc085f5dbe0e5e4fd15fcc66352abce4d2 Mon Sep 17 00:00:00 2001 From: Vedang Naik Date: Sun, 20 Feb 2022 16:18:03 -0500 Subject: [PATCH 6/6] Added option to disable stock weapon UI --- MHRUIpp/StockUIHandler.lua | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/MHRUIpp/StockUIHandler.lua b/MHRUIpp/StockUIHandler.lua index 51a8ca7..0a84f04 100644 --- a/MHRUIpp/StockUIHandler.lua +++ b/MHRUIpp/StockUIHandler.lua @@ -11,9 +11,10 @@ return { -- Set defaults and filepath o.cfgFilepath = o.cfgFilepath .. "StockUIHandler.json" o.defaults = mergeTables({o.defaults, { - showHUD = false, - showBuddyHUD = false, + showHUD = false, + showBuddyHUD = false, showSharpnessHUD = false, + showWeaponUI = false }}) -- Load config and font o:loadCfg() @@ -26,6 +27,7 @@ return { if self.cfg.showHUD then GUIManager:call("openHud") else GUIManager:call("closeHud") end if self.cfg.showBuddyHUD then GUIManager:call("openPartHud") else GUIManager:call("closePartHud") end if self.cfg.showSharpnessHUD then GUIManager:call("openHudSharpness") else GUIManager:call("closeHudSharpness") end + if self.cfg.showWeaponUI then GUIManager:call("openWeaponUI") else GUIManager:call("closeWeaponUI") end end, drawConfigWindow = function(self) @@ -45,6 +47,8 @@ return { changed, self.cfg.showSharpnessHUD = imgui.checkbox("Show Sharpness Gauge?", self.cfg.showSharpnessHUD) self.cfgChanged = self.cfgChanged or changed + changed, self.cfg.showWeaponUI = imgui.checkbox("Show Weapon UI?", self.cfg.showWeaponUI) + self.cfgChanged = self.cfgChanged or changed imgui.new_line() if imgui.button("Reset Defaults") then