Commit Graph

127 Commits (c6d5c5044ffd52082cba990f9ad0a2e74cad5332)

Author SHA1 Message Date
Clonkonaut c6d5c5044f Rework interaction menu into a new style. Also, style overloads are easily possible.
Because I did this in the test scenario first, it wasn't really possible to encapsulate different steps, sorry!
2018-10-15 17:38:22 +02:00
Maikel de Vries c00a8cf3c3 fix a bunch of suspicious assignment warnings 2018-04-09 11:53:55 +02:00
Maikel de Vries 03d0bb49dc c4script: some fixes for style guidelines and typos 2018-03-03 12:27:34 +01:00
Maikel de Vries 92aba45914 fix diving animation prediction for clonk
And no! randomly multiplying by 2 is not a solution...
2018-01-19 14:37:21 +01:00
Maikel de Vries fd734330d6 first try to enter pushed vehicle when entering objects
There was no possibility to enter vehicles into yet, so this would be my first attempt to solve this, we can evaluate this and improve if needed.
2017-05-12 14:38:36 +02:00
Mark 172613e0c9 Clonk Control / Ladder: Add possibility of triggering a jump with ydir
This was part of a bugfix in the ladder for Hazard: The ladder lets the Clonk execute a jump with Clonk.JumpSpeed / 2 at the top. This is useful for extra jumps and other things where you want to force the clonk to jump.

Regarding the ladder: The most of the problems with ladders arise from the OC implementation. Further commits may follow.
2017-01-06 21:58:13 +01:00
Mark fa28a7a643 Control: Extract library for using menus
External packs use this functionality without using the whole default Clonk control.
2017-01-03 18:03:49 +01:00
Mark 39c54c323c Control: Extract library for using objects
External packs use this functionality without using the whole default Clonk control.
2017-01-03 18:03:32 +01:00
Mark d356d9db3d Fix inherited() calls
The ... operator should be added so that the parameters are passed down. In some cases even the named parameters were not passed down.
2016-11-26 18:57:31 +01:00
Clonkonaut 6a80ce8edb Hot Ice Hotfix: Prevent grenade launcher from getting stuck uselessly in aim mode.
This fix might be dangerous, I do not know it. I have no real idea what this line was supposed to do. But it certainly prevented the release use command from getting to the used item in certain corner cases (right between loading and aiming).
I tested a bunch of vehicle and they work fine so far. So maybe this line was useless and harmful after all.
2016-08-20 00:56:50 +02:00
Maikel de Vries 192ccc0203 prevent hitting self with reverse throw (#1759) 2016-08-15 19:20:08 +02:00
Lukas Werling f3b2ff1295 Merge branch 'gamepad-controls' 2016-08-07 18:10:24 +02:00
David Dormagen 890c430a17 controls: allow to put items into pushed containers via [throw]
as requested by Dmyst here http://forum.openclonk.org/topic_show.pl?pid=32082#pid32082
2016-06-19 20:23:29 +02:00
Maikel de Vries b7a8b3067f correctly stop use control when clonk is attached (#1590) 2016-04-17 15:13:10 +02:00
Lukas Werling acc04b2398 Improve default Use/Throw angles when not aiming 2016-03-22 18:56:31 +01:00
Lukas Werling b30860112a Use regular Use instead of UseDelayed for gamepads 2016-03-21 18:45:42 +01:00
Lukas Werling f63f4b9ab3 Use regular Throw instead of ThrowDelayed for gamepads
There is no need to delay throwing as aiming is now possible at any time
using the analog stick.
2016-03-21 18:45:42 +01:00
Lukas Werling b8c8bf825c Crosshair: Use analog stick input properly
- Crosshair doesn't work with a dpad anymore. Supporting dpads adds
   unnecessary complexity, as a gamepad user with dpad will never be
   competitive with mouse users.

 - Crosshair isn't bound to item usage anymore, but will always show
   when the analog stick is outside of a deadzone.

Future planned feature: Also use the actual strength to allow
distance input in addition to direction. This is used heavily by
Knüppeln.c4s.
2016-03-21 18:45:42 +01:00
Lukas Werling 0afa589286 Replace all usage of "bool released" with "int status" 2016-03-21 18:45:42 +01:00
David Dormagen d9760cdab6 controls: properly set noholdingcallbacks to false when using ControlUseStart (#1327)
Otherwise the situation could arise where you used a ControlUseStart object (the wallkit) but noholdingcallbacks was still set to true (because e.g. you used a hammer before). Then you would not be able to move the preview.
This is described in a comment to the referenced bug.
2016-02-07 10:47:33 +01:00
David Dormagen 447be6c91d Clonk control: moved "menu" local to "clonk.control.menu"
"menu" is an error prone name in one of the most frequently used/overloaded objects of the planet. Actually, there was a bug in some other thing which disappeared now. So I guess something, somewhere uses the name "menu", too.
Anyway, this is more consistent (because the other control stuff is in this.control, too) and less error prone. So it's a good change regardless of whether it actually fixes an existing bug.
2016-01-29 22:48:59 +01:00
Julius Michaelis 711df05e1a Add button X to fade through half solidmasks.
Enabled on the elevator case for testing.
2016-01-20 18:58:11 +01:00
Sven Eberhardt 729712fa2f Allow use of bucket, pickaxe, bow, club, grenade launcher, javelin and musket during scale/hangle.
Temporarily disables scale/hangle during usage of these items.
2016-01-17 14:31:51 -05:00
Maikel de Vries 5b111131e9 remove unused is wallkick effect 2016-01-17 13:30:01 +01:00
Sven Eberhardt 3dad1c6d81 Turn MaxContentsCount and HandObjects into properties instead of callbacks (Possibly fixes #1553) 2016-01-10 10:41:34 -05: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 7fce9071e3 lower interaction priority of dead Clonks 2015-12-29 18:28:23 +01:00
David Dormagen d7b2ef9f75 prevent clonk idle animation when in dialogs and reduced frequency of idle sound (#1506)
This doesn't work for intros, though, because they use simple messages. We should unify the systems to only have one dialogue system that uses new-style-menus and implement required features in those menus..
2015-12-20 19:17:34 +01:00
Maikel de Vries 285288546c allow wall jump from rope ladder 2015-12-08 17:22:13 +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
Sven Eberhardt 789f910213 Clonk 'use' control: Fix nil pointer access when target object of shelved action removes itself. 2015-10-22 23:58:15 -04:00
Clonkonaut e8ecdb0251 Fix interaction bar hotkeys. 2015-10-11 16:38:33 +02:00
Clonkonaut 9f7b2fc007 ActionBar: Show description for ACTIONTYPE_EXTRA. 2015-10-06 15:08:50 +02:00
David Dormagen cfa0d61e98 inventory: do not immediately pick up again when dropping via shift+throw 2015-09-22 18:22:17 +02:00
David Dormagen aca1bcce34 clonk: disable rolling when stuck 2015-09-20 17:53:05 +02:00
Sven Eberhardt bf1596a229 Adjust interaction menu object ordering.
The clonk opening the menu should always have higher priority so the clonk is predictably selected on the left side even if standing behind e.g. a crate.

Other clonks should be behind because interaction with them is rare but having your fellow players stand in front of a building is very common. Allies also tend to run in front just when you opened that menu.
2015-09-15 21:13:53 -04:00
Sven Eberhardt 4b29c83477 Pass coordinates to ControlThrow. 2015-09-13 13:09:28 -04:00
Sven Eberhardt 0e085e435b Add ControlThrow callback into objects that want to implement custom throwing or even non-throw actions on the throw key. 2015-09-13 13:04:18 -04:00
David Dormagen 673243c9dd properly handle QueryRejectDeparture everywhere (#1382) 2015-09-11 21:08:38 +02:00
Maikel de Vries 358d282ec2 do not perform QueryRejectDeparture when pressing movement keys 2015-09-11 19:04:50 +02:00
David Dormagen a27888a623 the Clonk now performs a roll when pressing [down] (even when walking)
People have complained that the implicit roll (if you don't know how it worked) could lead to death and severe injury. The roll is now explicit. Always and everywhere.
It doesn't have any other effect though; todo: reduce hit area and/or squash vertices of Clonk during roll
2015-08-07 16:12:41 +02:00
Maikel de Vries 91cd15c40c reimplement alt use on right mouse button
This replaces throwing then controlling or inside a vehicle, throwing items remains on RMB as is.
2015-06-28 09:44:50 +02:00
Maikel de Vries 2e0bde2a1c fixed interaction for construction site and chest 2015-06-07 12:28:22 +02: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
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
Sven Eberhardt bcd821a786 Fix construction menu opened at wrong position. (#982).
It was always opened at the last mouse position of the owner of the hammer. Fixed it to use the controlling player instead.
2015-02-08 13:31:51 +01:00
Mark 850bf1b9d4 CreateObject/CreateObjectAbove (#1214)
Renamed CreateObject() to CreateObjectAbove() and replaced all occurrences in script files.
Added CreateObject(), the function may need a rewrite though, see comment in code.
Updated documentation
2015-01-11 19:02:03 +01:00
David Dormagen bc9697ab3a worked on making the order of items in the interaction menu and action bar more consistent; changed some minor things 2015-01-03 15:32:06 +01:00
David Dormagen d73799ab07 when a currently-used object is suddenly deleted, the usage is quickly cancelled (#899) 2014-12-25 18:04:19 +01:00