Five comments state the reference facts right (#318)
- OptionsFrame.xml and options_tests.rs: the stock camera-style dropdown writes "0" for Never (UIOptionsFrame.lua:525,536,547), not "3"; the `alt` entry only shows a stored "3" as Never. - unit/bindings.rs: TargetByName's silent miss is a gap (#52), not a deviation; the reference's messages are 0x127 ERR_UNIT_NOT_FOUND and 0xb8 ERR_GENERIC_NO_TARGET. - fields/unit.rs: the melee reach's 5.0 is a floor (0x6e35bf-0x6e35ce), not a cap. - tests/nameplate.rs: pfUI's click-through is nameplates.lua:1228. Comments only; code unchanged. Built on macOS. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
committed by
GitHub
co-authored by
Claude Opus 5.5
parent
60f5999e7b
commit
119df280b5
@@ -701,8 +701,8 @@
|
||||
local v = OptionsRow_Get(row)
|
||||
local match
|
||||
for _, e in ipairs(row.entries) do
|
||||
-- `alt`: 1.12's camera dropdown writes "3" for Never, which the nearest-value
|
||||
-- fallback would show as Always. `e.alt ~= nil` keeps a nil value matching none.
|
||||
-- `alt`: a stored "3" (in range, no entry's value) shows as Never, where the
|
||||
-- nearest-value fallback would show Always. `e.alt ~= nil` keeps nil matching none.
|
||||
if e.value == v or (e.alt ~= nil and e.alt == v) then match = e end
|
||||
end
|
||||
if not match and tonumber(v) then
|
||||
|
||||
@@ -3783,7 +3783,7 @@ fn the_camera_following_style_dropdown_carries_the_engine_enum_and_plate() {
|
||||
vec![("cameraSmoothStyle".to_string(), "2".to_string())]
|
||||
);
|
||||
|
||||
// A 1.12 client's config says "3" for Never; the nearest stop by number would be Always.
|
||||
// A stored "3" is in range but no entry's value: it shows as Never, not the nearest, Always.
|
||||
s.set_cvar_host("cameraSmoothStyle", "3");
|
||||
s.run("BenillaOptionsFrameCategoryListRowAudio:Click(); BenillaOptionsFrameCategoryListRowControls:Click()")
|
||||
.unwrap();
|
||||
|
||||
@@ -266,7 +266,7 @@ impl ObjectFields {
|
||||
pub fn unit_flags(&self) -> u32 {
|
||||
self.get_u32(FIELD_UNIT_FLAGS).unwrap_or(0)
|
||||
}
|
||||
/// `UNIT_FIELD_COMBATREACH` (`+0x1f0`): melee reach, summed as `rA + rB + 1.333`, cap 5.0,
|
||||
/// `UNIT_FIELD_COMBATREACH` (`+0x1f0`): melee reach, summed as `rA + rB + 1.333`, floor 5.0,
|
||||
/// by the attack range gate (`0x6e3480`); 1.5, the vanilla default, before it streams.
|
||||
pub fn unit_combat_reach(&self) -> f32 {
|
||||
self.get_f32(FIELD_UNIT_COMBATREACH).unwrap_or(1.5)
|
||||
|
||||
@@ -655,7 +655,7 @@ fn a_middle_click_on_a_plate_fires_nothing() {
|
||||
);
|
||||
}
|
||||
|
||||
/// pfUI's click-through (`nameplates.lua:1274`) calls `plate:Click`; in the reference a scripted
|
||||
/// pfUI's click-through (`nameplates.lua:1228`) calls `plate:Click`; in the reference a scripted
|
||||
/// and a physical click go through the button's one click slot.
|
||||
#[test]
|
||||
fn a_scripted_click_selects_too() {
|
||||
|
||||
@@ -1044,9 +1044,9 @@ pub(in crate::script) fn install(lua: &Lua) -> mlua::Result<()> {
|
||||
// so "Rag" selects Ragnaros. Any unit (typemask 8), no dead, reaction, range or self gate. A
|
||||
// missing name, or one neither string nor number, raises `Usage:` (`0x489d69`, `0x6f4940`); a
|
||||
// number is taken as its string. Deviation: among whole-name matches ours picks the nearest,
|
||||
// because the reference's first-walked pick is order-dependent and reads as a bug. Deviation: a
|
||||
// miss is silent, because the reference's game messages `0x127` and `0xb8` have no statically
|
||||
// recoverable text.
|
||||
// because the reference's first-walked pick is order-dependent and reads as a bug. A miss is
|
||||
// silent here, where the reference shows `0x127` ERR_UNIT_NOT_FOUND, or `0xb8`
|
||||
// ERR_GENERIC_NO_TARGET for an empty name (#52).
|
||||
g.set(
|
||||
"TargetByName",
|
||||
lua.create_function(|lua, (name, exact): (Value, Option<Value>)| {
|
||||
|
||||
Reference in New Issue
Block a user