Commit Graph

93 Commits (master)

Author SHA1 Message Date
Julius Michaelis 914d3798a4 Addedum to the control fixes in b11564168 (#1693, #1982):
- Allow configuring keyboard keys with modifier keys
 - Allow using Alt as a key in game on linux
   (I'm still puzzled why only Ctrl and Shift where implemented in so many places)
 - Adjust the deserializer and PlayerControls.txt to match the serializer for mouse keys
 - Refactor C4PlayerControl::DoMouseInput a little bit
 - Try to fix the Mac build (attempt 1)
 - Fix a bug in C4KeyCodeEx::CompileFunc where it set an incorrect KeyComboItem::sKeyName
 - Fix(?) StdCompilerConfigRead not doing anything on NoSeparator
2018-01-19 11:23:51 +01: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
Tushar Maheshwari e58a7884e4 Automatic fixes using clang-tidy
See http://forum.openclonk.org/topic_show.pl?tid=3376 for discussion.

Close GH-41
2017-05-03 20:30:45 +02:00
Sven Eberhardt ebda8193ef Replace NULL by nullptr in C++ sources
We don't support pre-C++0x any more, so nullptr should be fine everywhere (except in the plain C source files)
2016-11-02 19:58:02 -04:00
Julius Michaelis 8d2f2846b5 Fix mac build
Also move some stuff around once again…
2016-10-21 01:25:48 +02:00
Julius Michaelis 34a9a1de8d Twiddle with header organization: lib{misc,c4script} do no longer include GL/glew.h
(Yes, it is just that complicated.)
2016-10-20 18:46:32 +02:00
Sven Eberhardt 4eae2b28d7 Editor: Fix drop cursor drawing 2016-10-10 21:26:10 -04:00
Sven Eberhardt 159d0811d6 Fix game coordinates for keyboard controls that request a cursor pos 2016-08-07 11:08:42 -04:00
Lukas Werling a71ca69f1d Make ingame mouse cursor size configurable
On High-DPI displays, the mouse cursor is very tiny. We'll probably want
some high-resolution cursor graphics at some point, but the current ones
scale good enough.
2016-05-23 21:14:03 +02: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
Nicolas Hake 0537df5f23 C4Object: Move C4Def.h dep out of header
C4Def is only ever used as a pointer inside C4Object.h, so we don't need
to include C4Def.h from it.
2016-04-03 13:24:26 +02:00
Nicolas Hake 735f9cc06b C4Landscape: Pull everything private out of the header
Since LTCG is enabled now, we don't have to define every function inside
the headers for ~xXx super speed xXx~, which means we can strip the
headers down to their bare minimum and reduce interdependencies and
therefore recompilation times by a lot.
2016-04-03 13:24:24 +02:00
Günther Brammer e5f75c5a44 Remove a bunch of dead code, mostly player control related 2016-02-03 03:17:23 +01:00
David Dormagen 196f528201 Merge branch 'master' into Controls
Conflicts:
	planet/Objects.ocd/HUD.ocd/FancyGridMenu.ocd/DefCore.txt
	planet/Objects.ocd/HUD.ocd/GridMenu.ocd/DefCore.txt
	planet/Objects.ocd/Helpers.ocd/Dummy.ocd/Graphics.png
	planet/Objects.ocd/Items.ocd/Tools.ocd/WindBag.ocd/Script.c
	planet/Objects.ocd/Items.ocd/Weapons.ocd/Javelin.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/ClonkControl.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Constructor.ocd/ConstructionMenu.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Constructor.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Flag.ocd/Marker.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Producer.ocd/Script.c
	planet/Objects.ocd/Structures.ocd/Flagpole.ocd/Script.c
	planet/Objects.ocd/Structures.ocd/Pump.ocd/Script.c
	src/game/C4Game.cpp
	src/gamescript/C4GameScript.cpp
	src/gui/C4GameMessage.cpp
	src/landscape/C4Landscape.cpp
2015-06-03 22:32:36 +02:00
Nicolas Hake 5562b09dc4 Remove a lot of disabled legacy code, round 2
Maybe at some point we'll be rid of all the commented-out code that
nobody has looked at in years.
2015-03-25 20:02:53 +01:00
Günther Brammer 5bcedb5bbf Remove some redundant #includes 2015-01-25 18:53:48 +01:00
Sven Eberhardt 8dddbe5a10 Allow definitions without graphics. 2015-01-17 18:10:21 +01:00
David Dormagen bd04722553 Merge branch 'master' into Controls
Conflicts:
	planet/Objects.ocd/HUD.ocd/Controller.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/ClonkControl.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Constructor.ocd/ConstructionMenu.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Constructor.ocd/Script.c
	src/game/C4GraphicsSystem.cpp
	src/game/C4GraphicsSystem.h
	src/game/C4Viewport.cpp
	src/gui/C4GameMessage.cpp
2015-01-15 19:57:01 +01:00
Tobias Zwick 5e188aafb3 Fix setting small ViewOffsets. Refactor neighbouring code, enable a slight MouseAutoScroll by default
* make ViewX,ViewY,ViewOffsetX and Y private, add getters and setters that update variables that are dependent on these
2015-01-03 22:53:02 +01:00
David Dormagen a2a1778092 mouse tooltip: fixed possible crash when object has no tooltip 2014-12-26 11:51:02 +01:00
David Dormagen f89b8c8319 Merge branch 'master' into Controls
Conflicts:
	planet/Objects.ocd/Environment.ocd/Cloud.ocd/DefCore.txt
	planet/Objects.ocd/Libraries.ocd/ClonkControl.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Constructor.ocd/ConstructionMenu.ocd/DefCore.txt
	planet/Objects.ocd/Libraries.ocd/PowerConsumer.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/PowerProducer.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Producer.ocd/Script.c
	planet/System.ocg/ClonkControl.c
	src/gui/C4MouseControl.cpp
	src/landscape/C4PXS.cpp
2014-12-25 15:24:19 +01:00
Armin Burgmeier 00447dd524 Merge branch 'master' into lights 2014-11-12 08:47:43 -05:00
Armin Burgmeier c3bcedfbf9 Don't attempt mouse hover callbacks when mouse control is passive (github #5) 2014-11-07 20:16:30 -05:00
Armin Burgmeier aed907e30d Remove old fog of war 2014-11-07 11:53:10 -05:00
David Dormagen 2a78b77bda renamed C4GuiWindow to C4ScriptGuiWindow to increase expressivness and reduce similarity with C4Gui* 2014-10-13 18:48:03 +02:00
David Dormagen 049088be78 CustomGUIs: major rework of layouting & controls; better integration of C4GUI 2014-10-11 11:29:02 +02:00
David Dormagen 952f06b173 Merge branch 'master' into Controls
Conflicts:
	planet/Objects.ocd/Libraries.ocd/ClonkControl.ocd/Script.c
2014-09-29 11:47:09 +02:00
Sven Eberhardt ecdcb58bf6 Fix mouse cursor graphics when scrolling and outside viewport.
Cursor indexes were off by one.
2014-09-21 23:59:50 +02:00
David Dormagen 5722339e83 Merge branch 'master' into Controls
Conflicts:
	planet/Objects.ocd/HUD.ocd/Controller.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Structure.ocd/Script.c
	src/gamescript/C4GameScript.cpp
	src/gui/C4GameMessage.cpp
	src/gui/C4Gui.h
	src/gui/C4GuiDialogs.cpp
	src/gui/C4GuiWindow.cpp
2014-08-13 11:52:41 +02:00
Günther Brammer 22016e075f Replace some usages of C4ID with C4Def*
In particular those that made the c4script shell depend on C4Id.cpp.
2014-04-19 19:02:22 +02:00
David Dormagen cb28a84788 custom GUIs now display correctly when the title board is enabled 2014-02-21 14:43:48 +01:00
David Dormagen 06ac00ace8 Merge branch 'master' into Controls
Conflicts:
	CMakeLists.txt
	Makefile.am
	planet/Objects.ocd/HUD.ocd/Controller.ocd/Script.c
	planet/Objects.ocd/Items.ocd/Weapons.ocd/Club.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/ClonkControl.ocd/Script.c
	src/control/C4Control.cpp
	src/control/C4Control.h
	src/gamescript/C4GameScript.cpp
2014-02-15 14:44:57 +01:00
Nicolas Hake e0dc30c59a Update copyright notices
As discussed in http://forum.openclonk.org/topic_show.pl?tid=2917, I
have merged all copyright notices into a single file and referenced that
merged file from each source file.

For the updated source files, the timeline has been split into three
parts:
 1. Pre-RWD code (before 2001)
 2. RWD code (2001 through 2009)
 3. OpenClonk code (2009 and later)
All pre-RWD copyright notices have been left intact, as have RWD-era
copyright notices where the file did not have a RedWolf design copyright
notice but only individual author ones. All copyright notices of the
OpenClonk era have been replaced by a single notice ranging from the
first recorded year to the current year (2013). Mape code did not get a
OpenClonk Team copyright notice because it is somewhat separate from the
main OpenClonk codebase and has only been touched by Armin Burgmeier.
2013-12-23 13:03:19 +01:00
Tobias Zwick 666a51b3d9 update documentation around DefCore, remove some obsolete fields 2013-11-30 14:14:18 +07:00
Nicolas Hake 9b82abb8a0 Use control packet for mouse drag/drop and hover
This removes some more pre-assembled C4Script code going across the
network unchecked.

Part of #936.
2013-09-04 19:58:57 +02:00
David Dormagen dd1e2e2709 made GuiWindowRoot a member of C4Game 2013-05-26 18:12:03 +02:00
David Dormagen 337126fcb9 renamed MenuWindow to GuiWindow
added HP-Bar-test to MenuTest.ocs
bugfix
2013-05-09 13:28:45 +02:00
David Dormagen c2ba7e65d7 improved menu functionality; added test scenario and helper objects 2013-04-04 18:36:27 +02:00
David Dormagen d3dba14323 added support for custom menus and dialogs 2013-02-12 20:39:20 +01:00
Günther Brammer 864c5c7ea8 copyright notices update 2012 2013-01-12 16:31:40 +01:00
Tobias Zwick 348fb8c7a9 clean up mouse controls, reduced cursor graphics to the used ones 2012-11-16 17:29:42 +01:00
Armin Burgmeier e041b790d8 Only send MouseSelection callback when the object was hovered at button press time 2012-10-14 19:35:30 +02:00
Günther Brammer a528b0d76e Silence some g++ warnings 2012-06-15 18:16:49 +02:00
Armin Burgmeier 206f90adbc Pass through key state handling from event callbacks (#745)
This gets rid of Application.IsAltDown() and friends which was used for
this purpose in C4MouseControl and C4EditCursor. In case non-event
callbacks need to access the state of the modifier keys the state is
now cached in these classes (if it wasn't already).

This new solution is supposed to be more robust, since the key modifier
state comes always directly from the input event. This fixes #745, where
Application.IsAltDown was stuck for some reason.

I updated the Windows and Mac code as well, but wasn't able to test it,
it might not compile and/or not work, in which case please someone fix it :)
2012-04-22 22:09:06 +02:00
Tobias Zwick 46156e3f1c show tooltip for C4D_MouseSelect using the property "Tooltip"
+ remove references to the old and obsolete "help mode"
2012-04-15 12:09:54 +02:00
Benjamin Herr cf0069a3e2 C4MouseControl: don't reset "Drag" before UpdateCursorTarget() 2012-04-01 19:48:11 +02:00
Günther Brammer 40de33ca3c win32: Make sdl-mainloop option work
As it doesn't have the editor, this is only useful for compiling
more of our code on more platforms.
2012-03-23 22:53:56 +01:00
Armin Burgmeier 8f7f5cc1f1 Allow dragging of objects from FoW if they have C4D_IgnoreFoW set (#720) 2012-02-25 22:15:39 +01:00
Armin Burgmeier 09e0e48290 When starting to drag an object, use the object at mouse down time
and not at the time the drag is started, which is a bit later, after the mouse
has been moved a few pixels in order. This makes it easier to start dragging
when hitting the drag object on an edge.
2012-02-25 22:05:47 +01:00