From 8cc4ffa18856fe790c8d8b1fd3f101050410cbf5 Mon Sep 17 00:00:00 2001 From: Sam Date: Sat, 8 Aug 2026 17:14:26 +0700 Subject: [PATCH] mouse speed, zoom ceiling and bar numerals stop being constants MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Mouse Sensitivity and Max Camera Distance are real settings now, not frozen constants - Status Bar Text is wired through: value/max numerals on the player and pet frames' bars, live the moment the switch flips - Shift+W walks — a modified press falls back once to the bare binding, the reference's own two-probe lookup - the steep-face response is horizontal only, ending the extra slide when jumping nearly straight at a slope Co-Authored-By: Claude Fable 5 --- crates/benilla-app/assets/ui/OptionsFrame.xml | 81 +++++++- .../benilla-app/assets/ui/TextStatusBar.xml | 22 ++- crates/benilla-app/assets/ui/UnitFrames.xml | 91 +++++++++ crates/benilla-app/src/bindings.rs | 122 ++++++++++-- crates/benilla-app/src/bindings/chord.rs | 52 ++++- crates/benilla-app/src/cvars.rs | 55 +++++- crates/benilla-app/src/debug_panel/mod.rs | 18 +- crates/benilla-app/src/player.rs | 74 ++++++- crates/benilla-app/src/player/camera.rs | 121 ++++++++++-- crates/benilla-app/src/player/mover.rs | 181 +++++++++++------- .../src/ui_script/options_tests.rs | 177 ++++++++++++++++- .../src/ui_script/unit_frame_tests.rs | 90 +++++++++ crates/benilla-ui/src/script/cvars.rs | 64 ++++++- 13 files changed, 1009 insertions(+), 139 deletions(-) diff --git a/crates/benilla-app/assets/ui/OptionsFrame.xml b/crates/benilla-app/assets/ui/OptionsFrame.xml index 9f2d38b8..2fc4abe1 100644 --- a/crates/benilla-app/assets/ui/OptionsFrame.xml +++ b/crates/benilla-app/assets/ui/OptionsFrame.xml @@ -607,7 +607,10 @@ -- benilla knob behind them (Enable Sound=Sound_EnableAllSound, Dialog, output device, -- channels…) do not ship — the 0950 honest-tree rule applied to settings. OPTIONS_PAGE_ROWS = { - Controls = { "RowStickyTarget", "RowAutoLoot", "RowInvertMouse" }, + Controls = { + "RowStickyTarget", "RowAutoLoot", "RowInvertMouse", "RowMouseSpeed", + "RowMaxCameraDistance", + }, Audio = { "RowEnableAll", "RowMaster", "RowSound", "RowMusic", "RowAmbience", "RowEnableMusic", "RowEnableAmbience", @@ -618,7 +621,8 @@ -- (1136; Buff Durations 1139), in the reference's own on-screen order — its Basic -- Options anchor chain, Display block (CheckButton42 → 39 → 66) before Help (29). Interface = { - "RowInstantQuestText", "RowBuffDurations", "RowAutoQuestWatch", "RowNewbieTips", + "RowStatusText", "RowInstantQuestText", "RowBuffDurations", "RowAutoQuestWatch", + "RowNewbieTips", }, -- The two chat-bubble switches (decision 1139), in the reference's relative order — -- its Advanced Options chat chain runs CheckButton37 → 46 (Loot Spam, no knob of ours) @@ -683,13 +687,19 @@ -- HIDE_PARTY_INTERFACE → RaidOptionsFrame_UpdatePartyFrames, the combat-text family → -- CombatText_UpdateDisplayedMessages), moved from its batched Okay to our live write -- because this window commits on the click (0961's grammar), not on a Save button. + -- `cvarEvent` is a CVar row's counterpart to a global row's `applyFunc`, and it is the + -- reference's own third SetCVar argument (decision 1140): the token the engine hands back + -- as `CVAR_UPDATE`'s arg1. 1.12 passes its CheckButtons table KEY there + -- (`SetCVar(value.cvar, value.value, index)`), so a consumer that wants to react the + -- INSTANT the switch moves — rather than on its next repaint — has something to listen + -- for. nil on a row nobody listens to, which is most of them: the host polls its knob. function OptionsRow_Set(row, value) if row.uvar then setglobal(row.uvar, value) if row.applyFunc then row.applyFunc() end return end - SetCVar(row.cvar, value) + SetCVar(row.cvar, value, row.cvarEvent) end -- The registered default — GetCVarDefault's counterpart for a global. `udefault` is the @@ -834,6 +844,12 @@ if row.fmt == "raw" then return string.format("%d", math.floor(value + 0.5)) end + -- A row whose stored value is a FACTOR but whose meaning is a distance: show the + -- distance (decision 1140 — cameraDistanceMaxFactor over the 15 yd base). The number + -- the player is choosing is "how far out the wheel stops", not "times 1.4". + if row.fmt == "yards" then + return string.format("%d yd", math.floor(value * 15 + 0.5)) + end return string.format("%d%%", math.floor(value * 100 + 0.5)) end @@ -1870,6 +1886,45 @@ OptionsRow_OnLoad(self, "mouseInvertPitch", "Invert Mouse", "OPTION_TOOLTIP_INVERT_MOUSE") + + + + + + + + OptionsRow_OnLoad(self, "mousespeed", "Mouse Sensitivity", + "OPTION_TOOLTIP_MOUSE_SENSITIVITY") + OptionsSliderRow_Setup(self, 0.5, 1.5, 0.05) + + + + + + + + + + OptionsRow_OnLoad(self, "cameraDistanceMaxFactor", + "Max Camera Distance", "OPTION_TOOLTIP_MAX_FOLLOW_DIST") + OptionsSliderRow_Setup(self, 1.0, 2.0, 0.1, "yards") + + + + + OptionsRow_OnLoad(self, "statusBarText", + "Status Bar Text", "OPTION_TOOLTIP_STATUS_BAR") + self.cvarEvent = "STATUS_BAR_TEXT" + + + + + + + OptionsGlobalRow_OnLoad(self, "QUEST_FADING_DISABLE", "Instant Quest Text", "OPTION_TOOLTIP_SHOW_QUEST_FADING") diff --git a/crates/benilla-app/assets/ui/TextStatusBar.xml b/crates/benilla-app/assets/ui/TextStatusBar.xml index 155ca8fb..c89dea8f 100644 --- a/crates/benilla-app/assets/ui/TextStatusBar.xml +++ b/crates/benilla-app/assets/ui/TextStatusBar.xml @@ -7,15 +7,25 @@ `statusBarText` cvar is "1" ("Status Text" in the options; our GetCVar returns nil for a cvar the engine doesn't carry, which reads as OFF — the 1.12 default). - First (and so far only) customer: the XP bar (ActionBar.xml). The unit-frame health/mana - numerals are the ref's other users of this file — UnitFrames.xml omits them deliberately (its - own header note) — so this is the seam they inherit when their slice lands. + Customers: the XP bar (ActionBar.xml) and, since decision 1143, the player and pet frames' + health/power bars (UnitFrames.xml). `textLockable` is what the statusBarText cvar pins, and + which bars carry it is the REFERENCE's own split, not an omission of ours: 1.12 sets it on the + player's two bars, the pet's two and the XP bar, and on nothing else. The target frame's bars + are deliberately not lockable there — its numerals are hover-only — so ours have the machinery + wired and no text regions yet; the hover half needs mouse-enabled bars we do not have. -->