Commit Graph

18 Commits (master)

Author SHA1 Message Date
David Dormagen 3acd4a22f2 take 'left' and 'player' (and more) out of global namespace
The values from the enums are converted to numbers a lot, so using an enum class would be counter-productive.
Having 'left' in the global namespace appeared to be an actual problem with some Qt headers, according to Fulgen.
2018-01-20 18:20:51 +01:00
Tushar Maheshwari a661eab867 Automatic fixes using clang-tidy for header files
A follow-up on a previous PR GH-41. The discussion in the forum can be
viewed at http://forum.openclonk.org/topic_show.pl?pid=33086.
Run clang-tidy (without auto, pass-by-value and using checks) to fix the
header files not modified in the previous PR.

Summary of the changes:

 - C++11 member initialization.
 - nullptr instead of 0 for pointers.
 - override for functions declared virtual in base class.
 - default trivial special member functions
2017-05-15 13:46:46 +02:00
Tushar Maheshwari 3a4f49ad90 Revisit #includes
Consolidate the include statements scattered across the code in accordance
with the comment in C4Include.h. The advantages are listed in the same
comment.
Furthermore, it follows llvm-include-order which is the logical
extrapolation of the project's style guideline wherever possible
(C4Include.h being the most-frequent exception).
2017-05-15 13:24:59 +02:00
David Dormagen 8a8593e0ba Script GUI: added TightGridLayout style (requirement of #1842)
The TightGridLayout fills spaces more aggressively. This is slower but makes for a tighter layout. Finding the best layout is NP-complete. This here is just O(N^2) or so.
2016-11-05 15:35:15 +01:00
Nicolas Hake eabca223f5 Update all copyright notices for 2016 2016-04-03 20:24:42 +02:00
Nicolas Hake 493c276126 Rewrite header inclusions to #include "path/to/file.h" style 2016-04-03 20:24:42 +02:00
David Dormagen 59739b5cf6 script GUIs: do not catch mouse-up without prior mouse-down (#1327)
Otherwise, you could open a menu on mouse-down, which would then block the mouse-up event. The control system (not the script but the engine!) would then never know that the button was released and issue a key event with repeated=1 when you pressed the button the next time.
This could lead to issues.
2016-02-07 10:47:33 +01:00
David Dormagen 6c5294a05f fixed invisible UI elements accepting player input
When an UI element was only visible to a player (via the Player property), it still allowed ALL players to click on buttons.
I am wondering why noone else noticed that bug before. It's possible that it didn't show when the visibility was set via the menu's Target (instead of the Player property).

Maybe this was the cause of the "clicks sometimes do nothing" bug?
2016-01-31 23:36:06 +01:00
David Dormagen 6756db2768 C4ScriptGuiWindow: fix copyright header
The remaining old header has now been adjusted to the new one.
See e0dc30c59a for details.
2015-09-29 19:13:12 +02:00
David Dormagen cc3452bd0d custom guis: properly scale with font size now
Previously, the em <-> pixels conversion was a hardcoded value. Now the GUI scales with the font size that can be selected in the options.
Sadly, all scales were off since the hardcoded value was too low.
2015-09-06 19:02:31 +02:00
Sven Eberhardt cb995eb158 Fix several memory leaks in script gui. 2015-09-04 21:08:28 -04:00
Sven Eberhardt 8f4494745d Fix C4ScriptGuiWindow MouseInput/MouseEnter/MouseLeave overloads.
MouseInput silently shadowed the variant in C4GUI::Element and MouseEnter/MouseLeave were never called without parameters.
2015-09-03 23:27:20 -04:00
David Dormagen f05345375c fixed wrong offset in scripted GUIs when upper-board is active 2015-08-02 23:19:28 +02:00
David Dormagen 9968b0000c custom GUIs: restrict the maximum size of a menu window to 100em x ~62em
Fullscreen GUIs on wide-screen monitors look stupid. This patch tackles this by restricting the maximum size to something that can still be seen with a glance.
For very high-DPI or low-DPI screens, the user would most likely adjust the font size in the options (todo) anyway and thus also change the maximum menu size.
2015-03-27 11:33:57 +01:00
David Dormagen dae7f11a70 custom GUIs: added property GraphicsName to specify graphics of Symbol (if Symbol is a definition)
f.e. {Symbol = Icon_Number, GraphicsName = "Inf"}
2015-03-23 15:34:09 +01:00
David Dormagen 4c69e19219 custom guis: correctly respect margins in grid layout and vertical layout 2015-01-20 20:44:13 +01:00
David Dormagen 6476b0b026 Script GUIs: fixed saving & loading 2014-10-23 23:29:14 +02:00
David Dormagen 2a78b77bda renamed C4GuiWindow to C4ScriptGuiWindow to increase expressivness and reduce similarity with C4Gui* 2014-10-13 18:48:03 +02:00