Commit Graph

32 Commits (bce903ee0434ffae24bf02c898ab456adee9ffdf)

Author SHA1 Message Date
Lukas Werling f3b2ff1295 Merge branch 'gamepad-controls' 2016-08-07 18:10:24 +02:00
Maikel de Vries f4ae76454b rename player control callback for specified id's to silence warning
It is better to have different names for different callbacks.
2016-04-29 21:51:58 +02:00
Lukas Werling 0afa589286 Replace all usage of "bool released" with "int status" 2016-03-21 18:45:42 +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
David Dormagen a3e4b620b9 reworked interactions (grabbing etc.)
The player interface is now similar to how picking up works. This should increase acceptance. Also it was pretty fucked up before. The action bar is gone.
The script logic is now outsourced into a new library similar to the other stuff.
Objects can overload the selector for the new interaction (see "call elevator case").

Additional issues hit and resolved when working on this:
Shifting a cursor did not cancel certain actions (and there was no callback for that). This is now solved by adding two new callbacks.

Issues hit and not resolved:
Certain interactions (calling an elevator case, flipping a construction) are in some control library. They should be in the respective objects (and shown via callbacks etc.). Meh.
The internal interface (declaring interactions etc) has a few places where proplists are just translated because the properties are called differently. This is also a fuckup (i.e. a.interaction_object = b.Object) where the properties should just have been called the same in all places from the beginning.
The name "Action Bar" is pretty misleading now as it is no bar. But that's not something visible to the players. todo: cleanup.
2016-01-02 13:02:45 +01:00
David Dormagen eb2b18457e roll: only roll while direction key is held down
This means that you start a roll currently with walking left/right and tapping [down]. OR falling a great height and just holding left/right when landing. When you let go of left/right, you will instantly walk again. This reduces the possibility of the players rolling into an abyss.
2015-11-14 14:58:02 +01:00
David Dormagen 4964fb11ce shift+click support: used undocumented GetPlayerControlState instead of own memory for key state
One of Sven's private functions. I also renamed the control to CON_ModifierMenu1 (from CON_ModifierInventory1), because it's actually supposed to be the menu modifier in general - even if it's mapped on the inventory key.
2015-10-10 00:52:43 +02:00
David Dormagen b9420ce68c added shift+click support for menus
Or more generally: added support for any modifier key for any other command without the requirement to define a new command based on the old one plus the key. This can be helpful in situations where the player commands are decoupled from the script engine control handling (e.g. with menus).
Currently Shift+Click is only used by the inventory menu to transfer all items of a certain kind.
2015-10-09 13:14:27 +02:00
Maikel de Vries 01fb44fd49 fix script error when shifting cursor with zero crew members 2015-09-07 16:55:08 +02:00
David Dormagen e9a69c4252 collect objects solely via CTRL now
The player can also choose which object to collect by holding CTRL and navigating left/right.
2015-08-30 20:39:50 +02:00
Maikel de Vries 126ae5b179 fix C4Script runtime error in ShiftCursor 2015-06-05 19:16:43 +02:00
David Dormagen 7d1d70f017 removed NoCollectDelay from engine; it's now handled by script
Which allows a lot more fine-grained controls as all the control and UI stuff is now also in script anyway.
2015-03-26 12:23:20 +01:00
David Dormagen 379d189787 now always use on leftclick and throw on rightclick (drop if you click your Clonk or below); also removed some old references to the right mouse button (UseAlt) 2015-03-09 13:33:31 +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
Sven Eberhardt d80ef4ae5e Fix nil pointer if a dragged object is deleted between control creation and control execution. 2014-10-18 01:22:47 +02:00
David Dormagen 5c17b48bc2 Merge branch 'master' into Controls 2014-03-26 23:58:24 +01:00
David Dormagen 537846d76d menus: fixed two possible null-reference errors 2014-02-28 22:39:14 +01:00
David Dormagen 0da9293686 allow Clonk::SetMenu to also take a custom GUI ID; cleaned up some menu-related mess (like not handling unclosable menus correctly) 2014-02-26 12:03:27 +01:00
Tobias Zwick 3a8c8d7c3b selecting the clonks via hotkey was all backwards (#1031)
e.g. pressing ctrl+3 selected 1st clonk if there are 3 in the crew
2014-02-16 13:15:07 +07:00
David Dormagen e6487533c2 added first version of object information dialogue on right-click 2013-01-30 21:27:09 +01:00
David Dormagen 4dcc784d35 do not pass controls to disabled cursor anymore (i.e. via SetCrewEnabled) 2012-12-22 17:11:06 +01:00
Benjamin Herr cdaee93c94 Rename all the drag/drop script callbacks to OnMouseDr*
MouseDrag is already a property, and would overwrite the callback
functions. Renamed MouseDragDone and MouseDrop for consistency.
2012-04-01 20:42:14 +02:00
Bernhard Bonigl 2a5c129c93 Implemented MouseHover-Callback.
Calls OnMouseOver(player, draggedObject) in Objects beeing hovered over.
Calls OnMouseOut(player, draggedObject) in Objects that stop beeing hovered over.
2012-02-26 01:36:38 +01:00
Felix Wagner eb6b7be7ee Fixed various unused vars 2012-02-20 11:58:58 +00:00
Maikel de Vries c68b5b2920 Menus: implemented closing when clicked in the landscape 2012-02-01 22:29:49 +01:00
Maikel de Vries 85cbefe808 Content menu can now handle the clonk's backpack
Also did some cleanup
2011-12-28 11:49:38 +01:00
Maikel de Vries f47749c771 Content menu: fixed d&d, added background image 2011-12-11 15:50:51 +01:00
Tobias Zwick c2cefe2e4f new control: collect (into backpack) 2011-08-11 16:37:46 +02:00
Maikel de Vries d550f7c7da Differentiate between COMD_None and COMD_Stop
Was necessary after 267ebb600481 and current abuse of FLOAT procedure. None keeps the current motion, Stop halts the current motion of a procedure.
2011-07-06 18:13:39 +02:00
Charles Spurrill 806ea2cf4f Fixed water jump 2011-06-04 14:07:02 -07:00
Charles Spurrill b7bc9bc755 Clonk can jump off walls (with new animation). 2011-06-03 12:11:23 -07:00
Armin Burgmeier 41a1b5867d Change .c4g extension to .ocg 2011-03-13 16:16:45 +01:00