View Issue Details

IDProjectCategoryView StatusLast Update
0006028The Dark ModCodingpublic30.07.2022 18:14
Reporterstgatilov Assigned Tostgatilov  
PrioritynormalSeveritynormalReproducibilityN/A
Status resolvedResolutionfixed 
Product VersionTDM 2.10 
Target VersionTDM 2.11Fixed in VersionTDM 2.11 
Summary0006028: GUI: support expressions on right side of Set command
DescriptionGUI scripts support writing expressions with rudimentary math.
These expressions are stored inside window, attached to "registers", and evaluated regularly (every frame probably).

However, these expressions are allowed only in two places:
1) In register definitions:
    visible 1 - "gui::invisible"
2) In "if" conditions in script:
    if ("gui::invisible" == 0) { ... }

It would be great to support expressions also on the right side of Set command inside script:
    set "gui::ObjStartIdx" ("gui::ObjStartIdx" - 1);
Then we can easily implement scrolling completely in GUI, without the need for messy integrations between C++ and GUI code.

UPDATE: the syntax for vectors is:
  set backcolor (backcolor[0], backcolor[1], backcolor[2], 1 - backcolor[3]);
I.e. separate components by comma as usual, then enclose whole thing in parentheses.
Additional InformationOriginal discussion here:
  https://forums.thedarkmod.com/index.php?/topic/20526-gui-refactoring/&do=findComment&comment=477179
TagsNo tags attached.

Relationships

related to 0005852 resolvedstgatilov Refactor objectives GUI and fix checkboxes in restart GUI 

Activities

stgatilov

stgatilov

30.07.2022 18:09

administrator   ~0015095

Found a terrible issue with using vector components in expressions.
While it is not in scope of this feature request, it makes expressions with vectors totally unusable.
  r10049 Fixed awful bug in getting component of vector in GUI script.

This is pretty major global change:
  r10050 Don't disable referenced register + major refactoring of GetWinVarByName.
Previously if you mention a register anywhere in expressions or script, then its automatic updates were disabled forever (since the very startup).
Now register auto-update is stopped only after you assign something into it with "set" script command.

And the actual implementation:
  r10051 Wrapped attaching variable to register into idRegister::SetVar method.
  r10052 Refactored idRegisterList::AddReg, adding another variant.
  r10053 Supported expressions on right side of "Set" command in GUI scripts.

Issue History

Date Modified Username Field Change
30.07.2022 11:40 stgatilov New Issue
30.07.2022 11:40 stgatilov Status new => assigned
30.07.2022 11:40 stgatilov Assigned To => stgatilov
30.07.2022 11:40 stgatilov Additional Information Updated
30.07.2022 11:41 stgatilov Relationship added related to 0005852
30.07.2022 18:09 stgatilov Note Added: 0015095
30.07.2022 18:09 stgatilov Status assigned => resolved
30.07.2022 18:09 stgatilov Resolution open => fixed
30.07.2022 18:09 stgatilov Fixed in Version => TDM 2.11
30.07.2022 18:14 stgatilov Description Updated