with-heart / aoe2-ui

2 stars 0 forks source link

States other than `UserState0`/`StateNormal` not supported #55

Open with-heart opened 8 months ago

with-heart commented 8 months ago

Each widget StateMaterials definition can define a number of different states:

type UserStates = {
  readonly UserStates: number
  readonly [key: `UserState${number}`]: StateMaterial
}

type StatusStates = {
  readonly [key: `State${string}`]: StateMaterial
}

type Widget = {
  readonly StateMaterials?: UserStates | StatusStates
}

For UserStates, the numbered states typically correspond to:

For StatusStates, the states correspond to:

For reference, here's the full list of unique state keys found in the currently supported panel files:

[
  "StateBCDisabled",
  "StateBCNormal",
  "StateBLDisabled",
  "StateBLNormal",
  "StateBRDisabled",
  "StateBRNormal",
  "StateBarBackground",
  "StateBarForeground",
  "StateButtonClosedDisabled",
  "StateButtonClosedHover",
  "StateButtonClosedNormal",
  "StateButtonClosedPressed",
  "StateButtonOpenHover",
  "StateButtonOpenNormal",
  "StateButtonOpenPressed",
  "StateCCDisabled",
  "StateCCNormal",
  "StateCLDisabled",
  "StateCLNormal",
  "StateCRDisabled",
  "StateCRNormal",
  "StateChecked",
  "StateCheckedDisabled",
  "StateCheckedHover",
  "StateCheckedPressed",
  "StateDisabled",
  "StateGroupActive",
  "StateHover",
  "StateLeftValueDisabled",
  "StateLeftValueHover",
  "StateLeftValueNormal",
  "StateMaxDisabled",
  "StateMaxHover",
  "StateMaxNormal",
  "StateMaxPressed",
  "StateMidValueDisabled",
  "StateMidValueHover",
  "StateMidValueNormal",
  "StateMinDisabled",
  "StateMinHover",
  "StateMinNormal",
  "StateMinPressed",
  "StateNormal",
  "StatePressed",
  "StateRightValueDisabled",
  "StateRightValueHover",
  "StateRightValueNormal",
  "StateTCDisabled",
  "StateTCNormal",
  "StateTLDisabled",
  "StateTLNormal",
  "StateTRDisabled",
  "StateTRNormal",
  "StateTabDisabled",
  "StateTabHover",
  "StateTabNormal",
  "StateTabPressed",
  "StateTextAlternateNormal",
  "StateTextDisabled",
  "StateTextHilighted",
  "StateTextNormal",
  "StateTextPressed",
  "StateTextSelected",
  "StateUnchecked",
  "StateUncheckedDisabled",
  "StateUncheckedHover",
  "StateUncheckedPressed",
  "UserState0",
  "UserState1",
  "UserStates"
]

To support these other states: