Commit Graph

86 Commits (eabca223f5e7c237f5d3bb88183d38a41cb9bced)

Author SHA1 Message Date
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
Lukas Werling 8811356141 Make C4GamePadControl manage all controllers
The available gamepads are distributed automatically among players.

This also implements controller hot-plugging: It is possible to start a
game without a controller and plug it in later, and to reconnect a
controller after plugging it out.
2016-02-23 17:06:59 +01:00
Lukas Werling 9e0143b998 Remove gamepad ids from key codes
We want one gamepad key mapping to work with multiple gamepads, so
including the id there doesn't make sense.

Additionally, the gamepad id may change during the game (controller
hot-plugging).
2016-02-21 18:27:02 +01:00
Lukas Werling 985f1b99e5 Make GetPlayerControlState() query the current controller state
To keep compatibility with scripts which expect only binary buttons,
this adds a third parameter to the function which enables the new
functionality.

Bonus /script to test the controller stick x axis:

    Schedule(GetCursor(), "Message(\"%d / %d\", GetPlayerControlState(0, CON_Left, true), GetPlayerControlState(0, CON_Right, true))", 10, 100000000)

Note that the values will be inconsistent if multiple analog sticks are
bound to the same control, as values from one stick will overwrite those
from the other one. This can happen even if you move only one stick.
2016-02-21 18:26:44 +01:00
Lukas Werling 8dd1450e94 Implement "gamepad stick moved" events for analog input
Analog moved events are only sent once per control frame.
2016-02-21 18:26:18 +01:00
Lukas Werling 9c840724f2 Re-enable gamepad controls 2016-02-13 18:42:23 +01:00
Günther Brammer 03d11cd596 Merge script branch 2016-01-31 21:51:58 +01:00
Günther Brammer d3428003a8 Fix navigation in player menus with more than one column/row 2016-01-30 16:03:22 +01:00
Günther Brammer 68c436576e Simplify construction of C4AulParSets 2016-01-25 00:00:57 +01:00
Sven Eberhardt afab6ef464 func PlayerControl: Send nil instead of 0 for non-mouse controls.
The main script function always assumed this, but it was not actually implemented that way.
2016-01-16 22:06:19 -05:00
Armin Burgmeier bd4551c6d4 Disable gamepad controls (#1536)
Gamepad support is currently not working properly as many menus cannot be
navigated with a gamepad. Simply don't load any control assignment sets that
have gamepad enabled.
2016-01-11 18:11:44 -08:00
Sven Eberhardt 15a1a62521 Automatically deduce shift state in combo keys with Control/Shift combo. 2015-09-01 19:11:13 -04: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
Sven Eberhardt b1db0c7918 (Re)implement text completion in dialogue text windows as an async control. Default to Space, i.e. MenuOK. 2014-08-10 20:58:26 +02: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 fe2a400c02 replace global function GetTime() with class function C4TimeMilliseconds::Now() 2013-12-07 21:27:01 +07:00
Tobias Zwick 94c618d153 add new type C4TimeMilliseconds for time measurements to solve problems when GetTime() overflows (#251)
The new type C4TimeMilliseconds behaves for the most part like a uint32_t but is overflow-proof in comparisons.
In some places, a 0-value (or uint_max) of the variable storing the time had the special meaning "not set yet". This has been resolved by having it as a pointer to C4TimeMilliseconds with NULL meaning that it has not been set yet.
2013-12-04 19:35:07 +07:00
Tobias Zwick ecf538cd1f refactor: consistently use time_t t... variables for times in sound system, stats, application and player controls 2013-11-29 14:16:14 +07:00
Sven Eberhardt 60a32b1f14 Added player control assignment trigger mode "ClearRecentKeys": If assignment is triggered, clears all recently pressed keys prior to and including trigger key.
Useful for spell combos, where one spell combo might end the same way another combo starts.

Also corrected docs for OverrideAssignments (it's just a flag; not a trigger mode).
2013-09-02 17:27:15 +02:00
Martin Plicht 524fe879aa Make DEBUGREC define a commandline option 2013-05-25 22:51:32 +02:00
Günther Brammer 50eb1b6a76 Since internal keycodes are now scancodes, they do not need to be resolved 2013-05-24 17:41:14 +02:00
Oliver Schneider 582e75d3da Use scancodes instead of localized key (#729)
The options dialog still shows localized keys, but the config files use US-Layout keys (when loading default files) and scancodes when saving player changes.
2013-02-09 01:05:27 +01:00
Günther Brammer 864c5c7ea8 copyright notices update 2012 2013-01-12 16:31:40 +01:00
Günther Brammer 327bfa31e7 Remove some superflouos output from the dedicated server 2012-11-30 22:20:16 +01:00
Sven Eberhardt 5b90f2f39f Fix sequence combo key assignments so they don't break when mouse movment is assigned to a control 2012-10-28 17:47:02 +01:00
Tobias Zwick 86cbc2f650 replace boolean Group property in assignments with GUIGroup property 2012-10-09 23:59:32 +02:00
Tobias Zwick 48012aa91d add GUIDisabled property for key assignments 2012-10-09 22:24:48 +02:00
Sven Eberhardt 8bdd761027 PlayerControls: Allow usage of keyboard scan codes instead of virtual key names using $%x format (Win32 only)
Also re-resolves keys if the keyboard layout changed at runtime.
2012-10-09 00:54:34 +02:00
Sven Eberhardt 22c744f72e PlayerControls: Allow GUIName and GUIDesc in assignments. 2012-10-08 22:29:15 +02:00
Sven Eberhardt 08b495e43d PlayerControls: When the user changes a key assignment in his local config, all derived key assignments (Key=CON_*) change as well (#807).
The "CON_" prefix is now mandatory when referencing other key assignments. Updated PlayerControls.txt to reflect that.
2012-10-08 20:45:04 +02:00
Sven Eberhardt 80d5f01642 Added FnGetPlayerControlAssignment: Get key/button assigned to a control.
To be used by tutorial messages explaining controls.
2012-04-17 17:06:16 +02:00
Günther Brammer f3854e87f8 Replace C4AulScript::GetFunc with C4PropList::GetFunc/Call 2011-10-15 22:07:45 +02:00
Felix Wagner af699844de Removed some old mouse control related stuff 2012-01-29 02:13:55 +00:00
Felix Wagner 9c82958fa1 Little tweaks for the player options dialogue 2012-01-25 04:53:59 +00:00
Sven Eberhardt c2ccf20509 Some new debugrecs 2011-12-29 00:12:21 +01:00
Sven Eberhardt c287c093cc PlayerControl: Mouse coordinate space (viewport vs landscape) is now a control property; not an assignment property.
This is in preparation for proper custom control assignments
2011-11-20 21:49:38 +01:00
Günther Brammer a3ade134fe Savegames: Do not clear player control data immediately after loading (#596) 2011-09-22 20:00:17 +02:00
Günther Brammer 9bc61db360 copyright notices update 2011 2011-09-01 16:58:52 +02:00
Sven Eberhardt 3a8ce9b25e player control defs: ClearPrevious flag for player control overloading 2011-07-16 11:58:38 +02:00
Sven Eberhardt b01cddc560 control config dialog improvements 2011-03-31 16:26:59 +02:00
Sven Eberhardt 269c7b208c control config dialog 2011-03-30 22:11:47 +02:00
Günther Brammer 6c2a89eaf8 Replace timeGetTime with a platformneutral GetTime wrapper 2011-03-13 17:25:35 +01:00
Günther Brammer 8ff6ae847c C4Group::LoadEntry takes pointer instead of non-const reference 2011-03-05 02:44:26 +01:00
Günther Brammer e250312c26 Move C4DefList class into from C4Def.cpp/h to new C4DefList.cpp/h 2011-03-03 17:10:22 +01:00
Günther Brammer e4ef7e3d98 Replace C4VID with C4VPropList
Most callsites use C4Id2Def instead, but for some a def->id->def
indirection could be removed.
2011-02-05 23:09:09 +01:00
Günther Brammer be342d4a51 copyright notices update 2010
This time with more manual checking and using git blame -M -C, so that
a few cases of copied code get a copyright notice corresponding to
their initial introduction.
2010-12-23 01:01:24 +01:00
Tobias Zwick 24847bb014 fixed #536: Gamepad: zooming with buttons needs several clicking 2010-12-15 02:16:24 +01:00
Günther Brammer 93a1e82907 Split out viewport stuff from C4GraphicsSystem to a new C4ViewportList 2010-09-29 03:44:05 +02:00