Lix menu colour pre-emptive integer overflow with the single arrow button

Started by Silken Healer, May 08, 2025, 06:23:15 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Silken Healer

1. Go to your Lix colours
2. Set one of the sliders to F0
3. Press the right arrow with one arrow

This then cycles it through to 00 instead of going F2

Simon

Yeah, the maximum of the GUI color number picker is deliberately 0xF0, not 0xFF.

The reason here is that the maximum should be divisible by the smallest step size (2). A maximum of 0xFF (255) would not be divisible by 2. And the reason for the smallest step size of 2 is that a step size of 1 is too fine-grained, I wanted to save you clicks.

But if the cap of 0xF0 surprises you, this cap of 0xF0 is not a good solution either. Hmm.

-- Simon

namida

If the requirement is for it to be divisible by 2, why is the maximum 0xF0 and not 0xFE?
My projects
2D Lemmings: NeoLemmix (engine) | Lemmings Plus Series (level packs) | Doomsday Lemmings (level pack)
3D Lemmings: Loap (engine) | L3DEdit (level / graphics editor) | L3DUtils (replay / etc utility) | Lemmings Plus 3D (level pack)
Non-Lemmings: Commander Keen: Galaxy Reimagined (a Commander Keen fangame)


Simon

Hmm. If 0xFE confuses you less than 0xF0, I'm fine with making the cap 0xFE.

It's a hack in any case. The fundamental problem is the divisibility by 2 in the GUI widget. There is no GUI widget that combines both (a) increment/decrement buttons and (b) number typing. I don't want to invest energy in making a special widget only for the menu color. I don't remember why the menu color is configurable in the first place. Such a 1990's feature.

-- Simon