TTT2 icon indicating copy to clipboard operation
TTT2 copied to clipboard

Edit equipment hierarchy doesn't work correctly

Open laeyon85002 opened this issue 11 months ago • 3 comments

Your version of TTT2 (mandatory)

  • Workshop version from Steam

Describe the bug (mandatory)

I think there is a bug in the logic of the "Edit equipment" master. If I have a CheckBox that activates/deactivates a complete section and this has a subordinate element (also a CheckBox), which in turn has another sub-element, then this lowest setting is incorrectly enabled when the editor is reopened. Category 2 must first be enabled and category 1 then disabled, then the subitem of category 2 is enabled when the editor is reopened, although category 1 is disabled. The changes seem to be correct as long as the window is open - afterwards, when reopened, it is incorrect.

To reproduce

Steps to reproduce the behaviour:

  1. Add the attached addon to your collection
  2. Go to 'F1 > Edit equip bug'
  3. Scroll down to the custom settings
  4. Enable "Enable main feature", enable "Enable sub feature", enable "My option value"
  5. Now disable "Enable main feature" and reopen the "Edit equipment"-browser
  6. The option "My option value" is enabled, although the superordinate categories are disabled

Expected behaviour

The entire hierarchy must be taken into account and not just the option directly above it, so that the option at the lowest level is not displayed if the options above it are switched off. Apparently the behavior only seems to be wrong when you open the window again - it seems to be correct when the window is open.

Context (please provide as much as you can)

  • No collection needed, just use the attached example addon
  • No server errors
  • No client errors
  • No other addons needed
  • Screenshots: image

The last option is still set as enabled but the controls are disabled (correct behavior until I reopen the window): image

After reopening the controls of the last option are enabled, although the parent control is disabled: image

Additional context

editEquipmentBug.zip

laeyon85002 avatar Mar 16 '24 15:03 laeyon85002

@ZenBre4ker you probably know the most about the UI requesting data from the server?

TimGoll avatar Mar 16 '24 15:03 TimGoll

This looks like a simple clientside logic error not including any data from the server.

Maybe because the 1st sub element is deactivated by the master, the 2nd sub element doesnt get deactivated. We never had more than one level under one master.

ZenBre4ker avatar Mar 16 '24 15:03 ZenBre4ker

We have multiple levels under master and it works fine for convar based settings (check the karma menu for example)

This seems to be a database based issue

TimGoll avatar Mar 16 '24 15:03 TimGoll