Commit Graph

46 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
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 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
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
Nicolas Hake e2a8f6d303 Reorder some declarations and initializations to avoid order mismatch
While none of the mismatches were having a side-effect, this silences a
number of -Wreorder warnings which were drowning out potentially
important diagnostics.
2015-02-04 22:12:42 +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 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
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
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 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
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 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 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
Günther Brammer 93a1e82907 Split out viewport stuff from C4GraphicsSystem to a new C4ViewportList 2010-09-29 03:44:05 +02:00
Sven Eberhardt e0db866aee Silent reset of down controls if release control was handled by a higher priority control 2010-07-30 22:30:54 +02:00
Sven Eberhardt 65b73b7177 SendCursorPos controls issue CON_CursorPos (#289) 2010-05-07 15:57:56 +02:00
Benjamin Herr 56ce8fd83f C4PlayerControl: ctor-initializer in init order 2010-04-22 15:11:05 +02:00
Nicolas Hake 5dc0d3b4cb Reduce value truncation warnings 2010-04-20 18:20:24 +02:00
Sven Eberhardt 0767e3608e Implement optional cursor position as parameter to controls (#216) 2010-04-10 22:44:00 +02:00
Benjamin Herr 27287b981f Reformat everything according to style guidelines
as per http://forum.openclonk.org/topic_show.pl?tid=208
and http://wiki.openclonk.org/w/Style_Guidelines
via astyle
  --brackets=break
  --indent=tab=2
  --keep-one-line-statements
  --keep-one-line-blocks
  --indent-namespaces
  --convert-tabs
  --recursive
  --exclude=zlib
  --exclude=tinyxml
  src/\*.h src/*.cpp
2010-03-28 19:58:21 +02:00
Benjamin Herr 01db6c5ec7 C4PlayerControl: put members in ctor-initializer in initialization order 2010-03-28 18:49:06 +02:00
Sven Eberhardt 35d439951e Allow Modifier+CON_* as player control assignment
ControlSet merging overrides only if OverrideAssignments is set to true
2010-03-27 19:08:01 +01:00
Sven Eberhardt e8aaa703fc implement DefaultDisabled for PlayerControls (#206) 2010-03-26 14:48:28 +01:00
Sven Eberhardt feaa68cbe5 reimplement object menu controls (#77) 2010-02-08 21:52:46 +01:00
Benjamin Herr f3b35227ea avoid lots of gcc warnings 2010-01-25 05:00:59 +01:00
Nicolas Hake a41f896921 Replace global C4ID consts with member consts 2010-01-25 04:14:52 +01:00
Sven Eberhardt 23a206ccdd implement *Mouse*Wheel1Up/Down for player controls
implement mouse wheel viewport zoom as async PlayerControl
2009-12-31 18:20:45 +01:00
Sven Eberhardt e53332b446 + FnSetControlEnabled 2009-12-27 19:11:14 +01:00
Nicolas Hake 1c11c4dd34 Merged PlrCtrl into default 2009-12-17 14:06:24 +01:00
Sven Eberhardt 9be7a2724a added mouse support for scripted player controls 2009-10-17 17:53:26 +02:00
Sven Eberhardt 1c941adddc fix gamepad control 2009-10-16 16:23:17 +02:00
Sven Eberhardt 4237837bb3 experimental gamepad config 2009-10-14 23:29:27 +02:00
Sven Eberhardt 87e0548bd0 PrefControl switched to new player control method 2009-10-14 18:46:22 +02:00
Sven Eberhardt 4db8b6c0a7 move C4PlayerControl.cpp/.h 2009-08-12 16:45:45 +02:00