edo9300 / edopro

A script engine for "yu-gi-oh!" and sample gui (former "ygopro")
Other
279 stars 75 forks source link

GUI Button upgrade and refactor #185

Closed kevinlul closed 4 years ago

kevinlul commented 4 years ago

The current codebase uses the Irrlicht 1.8.4 native CGUIButton. This has a few faults - keyboard and mouse information is lost in the GUIEvent dispatch so we cannot determine from the event receiver in an intuitive way whether it was a shift-click, for example.

We already make use of a custom image button.

Both problems seem to have been addressed in the 1.9 trunk. Of note is that Minetest already uses a modified version of this for its purposes, which adds more styling options. Thus it's worth considering to switch to a new custom button class, perhaps based on Minetest, to make use of newer features. This can be slowly rolled out across the codebase since it's really only "needed" for one feature.

I ran into this while working on #110 in hand-test-110, because forcing a new window to run hand test is bad UX, but a second "advanced hand test" button below is unnecessary (and text space issues) compared to just, say, shift-clicking for advanced options.

kevinlul commented 4 years ago

Unfortunately, Minetest's guiButton is dependent on other parts of its custom Irrlicht-based GUI system.

kevinlul commented 4 years ago

Upon experimenting, the 1.9 trunk files are also not a quick drop in because of reliance on enums and macros introduced in 1.9.