Commit Graph

319 Commits (92ed1537a0e79facded3c81f50f7767962d70d6f)

Author SHA1 Message Date
David Dormagen 684b0d0682 contents menu: fixed possible "use after deletion" error 2016-02-14 13:03:26 +01:00
David Dormagen 4493bfc3ab interaction menu: disallow interaction with outside world when contained (#1541)
The interaction with IsContainer objects is still flawed in a way: when a lorry is inside a (IsContainer-)hut, you can take the lorry into your hands. Since we don't have that possibility in the normal game, I leave it unchanged for now.

However, it is now possible to add a Chest (or a cupboard!) into a WoodenCabin and then store stuff inside of it.
2016-01-14 13:03:18 +01:00
Sven Eberhardt 62910aaada Remove dummy graphics of interaction menu. 2016-01-11 18:19:01 -05: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 7f4f5fee58 added new vocals for three skins (by ala)
They are played e.g. when being hit by stuff, catching fire, killing teammates, idling, trying to put a shovel into the pump, and much more!
2015-12-16 23:01:29 +01:00
David Dormagen dcfb986e34 moved sounds into subfolders
This completes http://forum.openclonk.org/topic_show.pl?tid=3215
2015-12-13 22:14:55 +01:00
Sven Eberhardt ab47831ab5 Make GUI_Controller->ShowWealth() static and apply to players joining after the call. 2015-12-09 00:40:18 -05:00
David Dormagen 6c5aaecbed interaction menu: allow objects to hide inventory
Some objects need to accept items (be IsContainer) but want a custom way to display their contents (e.g. because you can't take stuff out). For example the sawmill.
2015-12-07 20:52:14 +01:00
David Dormagen 7a0b170075 interaction menu: made menu-rejection errors a callback
Objects that prevent interaction just in some situations (hostility, dead Clonks, ..) should always be shown in the interaction menu (because otherwise players might suspect bugs) and TELL the player WHY they want no interaction.
For that, they might need to specify own error messages.

Known issues:
* The "OnOpen" callback is done even if interaction is disallowed, however just simply removing the callback might not be sufficient, because we might get a callback disbalance if objects change their attitude while the menu is opened and the menu is closed again.
* Some objects (which should) do not include the Library_Ownable. However, we have no base melees atm and since this might introduce new errors, postpone it to 8.0.
2015-12-06 21:28:03 +01:00
David Dormagen c02cce2c0c interaction menu: allow transfer of items only into IsContainer (#1484) 2015-12-06 16:55:48 +01:00
Sven Eberhardt 6bcb6bb53e Prevent interaction menu on dead clonks (#1483). 2015-12-06 01:50:38 -05:00
Clonkonaut 6cd2faf582 Disabled wealth display by default (#1425).
Can be shown by using GUI_Controller->ShowWealth(). Did that for GoldRush but see bug #1477.
2015-12-05 12:42:52 +01:00
David Dormagen 43d10642f1 fix HP bar offset
The HP bar was only centered over the object IFF the object's first vertex was in its center. This was not necessarily true for buildings (e.g. targets in GIDL).
Now the vertex position is taken into account when positioning the bar.
2015-12-02 13:05:19 +01:00
David Dormagen 7f5e85a82a interaction menu: do OnClose-callbacks if the Clonk/object moves out of range (#1466) 2015-11-30 10:17:31 +01:00
David Dormagen 02015cb610 interaction menu: properly call/remove menu entry callbacks when readding/removing items 2015-11-23 20:06:25 +01:00
David Dormagen d3bc228f9b interaction menu: added callback when viewing objects (e.g. for chest opening animation) (#1450)
OnContentMenuOpen is not used anymore.
There is a small issue: the callback is also done when the object can actually not be interacted with (e.g. because it's hostile / unfinished). Gotta think about that. But this should solve all our issues for now.
2015-11-22 22:37:58 +01:00
David Dormagen d21fb63a3b Library_Stackable: properly update stack count in inventory bar
Previously, using a javelin stack would not lower the displayed stack number in the inventory bar.
2015-11-22 11:37:26 +01:00
David Dormagen d7db8a9707 fixed dangling custom overlays
Custom overlays would only be closed when the object was changed. This was not apparent for the loam, because the new overlay would always completely obstruct the old one.
But with the dynamite box displaying the sticks, the old ones never disappeared.

Now the custom overlay is explicitely closed and the update is also done if the slot previously had a custom overlay and no has none.
2015-11-22 11:03:43 +01:00
David Dormagen 601e0e7856 fixed nil access when stacking objects with custom overlay
Line 954 would try to set the stack count text but the structure of the UI windows differed from the normal ones. So things would break.
2015-11-22 11:01:56 +01:00
Sven Eberhardt b52686a6a7 Fix nil array access when opening interaction menu for unfinished or hostile structures. 2015-11-20 20:59:36 -05:00
David Dormagen 215c83c79b interaction: allow objects to be at a rect around the Clonk instead of just at the center
This allows to e.g. repair bridge segments on which you stand or interact with other objects that are shorter than half your height.
2015-11-12 10:18:45 +01:00
David Dormagen e29028457e fixed count display of stackable objects
The count was displayed twice in certain situations: in the picture AND as a number.
Now the responsibility for displaying the count is solely on the menus' side. The objects only show an additional overlay when their count is infinite (to not display an arbitrary "50" there).
2015-11-10 17:32:38 +01:00
David Dormagen ad69cd9293 enabled objects to provide a custom overlay for the inventory bar and the interaction menu
This can e.g. be used for the water barrel to show the fill-level. Or by an adventure scenario to highlight quest items.
Or by third-party packs to do other cool stuff.
2015-11-07 21:20:08 +01:00
David Dormagen adb828c9fb fixed possible nil-access
This happened to me ingame. I don't know why and I don't know how to reproduce.
So this is a quick in-place fix instead of a solution to the underlying issue of "entries" not being there.
2015-11-01 18:29:26 +01:00
David Dormagen 58b633bea4 fixed some HUD items disappearing on GUI_Controller->Reset() (#1415)
This is a definition call. There is no valid "this". The call should go to the fresh object.
2015-10-27 18:44:37 +01:00
David Dormagen b48bb31623 inventory menu: fixed shift+click
RemoveHoles returns the amount of items removed and works in-place. Meh.
It's not required here anyway..
2015-10-26 18:44:33 +01:00
David Dormagen 7baf2bcc1c added wealth display to the buy menu (#1425) 2015-10-24 10:44:01 +02:00
David Dormagen 5266962285 interaction menu: fix script error for sub-menus without extra_data 2015-10-23 18:49:12 +02:00
Sven Eberhardt c7a0f2b580 Fix post-open grid and list menu updates when opened as standalone menus. 2015-10-21 23:56:31 -04:00
David Dormagen f68861b80e goal menu: update only certain properties of menu to not reset tags
The background would always be reset when the menu was updated.
2015-10-20 17:14:50 +02:00
David Dormagen 2f7a0b960c goal menu: do not have pointers to objects in the menu layout anymore (#1420)
This actually led to an infinite recursion in Mine Rescue when clicking on the goal. The goal menu would link to the goal itself which would link to the elevator -> case -> elevator -> case...
Now only layout stuff is in the layout proplists.

I noticed that with multiple goals one always gets a background. But I guess that had already been the case beforehand? Anyway, that's another issue.
2015-10-19 19:07:39 +02:00
David Dormagen 1bd3354086 contents menu: changed stacking logic (#1424)
Objects now stack iff CanBeStackedWith returns true. The displayed symbol is now the first object of the stack (instead of the definition).
Also fixed barrel to not overwrite the custom name just after setting it.
2015-10-17 12:09:35 +02:00
David Dormagen a5d7f08e16 close interaction menu when clicking outside
According to Pyrit, this is standard behavior of menus in other games. And as I have no strong feelings regarding that issue, here you go.
2015-10-16 17:07:33 +02:00
David Dormagen e93630e083 interaction menu: added "close" button and unified layout of "minimize" and "close" buttons 2015-10-14 11:22:58 +02:00
Clonkonaut b9da09de4e Krakatoa: Show goal icon depending on difficulty setting. 2015-10-12 22:53:42 +02:00
Clonkonaut 4443298b6d Goal icons added to Krakatoa and Chine (#1142). 2015-10-12 22:30:11 +02:00
Clonkonaut e8ecdb0251 Fix interaction bar hotkeys. 2015-10-11 16:38:33 +02: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
Clonkonaut 9f7b2fc007 ActionBar: Show description for ACTIONTYPE_EXTRA. 2015-10-06 15:08:50 +02:00
Clonkonaut 9aee7ca973 GUI_Controll_CrewBar: Do not access crew_warnings as array if objects is deleted. 2015-10-05 13:33:36 +02:00
Sven Eberhardt c0222974dc Fix transfer from surroundings to container using interaction menu. 2015-10-03 22:26:10 -04:00
Sven Eberhardt acc14ec7c9 Don't show HUD in NO_OWNER viewports (#1414). 2015-10-03 20:49:17 -04:00
Clonkonaut bfd0bd035d Added magic energy support for 3rd party devs. 2015-09-30 10:20:20 +02:00
Clonkonaut 178e904fdd HUD redesign. Beware!
Added interaction icon to help knowing when interaction is possible.
Limited crew portraits and information to two clonks.
Added additional warnings texts for further clonks (crew count > 2).
Moved inventory from bottom to top.
2015-09-30 10:11:43 +02:00
David Dormagen 439cfac129 custom GUIs: do not break text when style flag NoCrop is set and set NoCrop for HP display 2015-09-25 15:01:24 +02:00
David Dormagen 42a5b8e0fe interaction menu: reworked "surrounding" internals (#1396)
The surrounding tab now uses the standard, mainstream contents display. That means that e.g. no ugly hacks are necessary to enable the "transfer all" buttons.
Previously, the surrounding menu was completely separate and always collected into the Clonk. Now you can also just put stuff directly from your surrounding into your lorry (i.e. just take everything around you into the lorry).
2015-09-24 21:27:52 +02:00
David Dormagen f4f9afa477 custom guis: for the Player property, distinguish between NO_OWNER and nil
NO_OWNER means the message will be visible for noone (can f.e. be used to hide a ui window). nil means the message won't have visibility restrictions. This is probably what the scripter expects.
Previously, a value of "nil" would have been read as 0. So not setting the Player property and setting it to nil would mean two different things.
2015-09-23 22:03:29 +02:00
Sven Eberhardt 5b981be93c HUD: Fix extra slot display in multiplayer. 2015-09-20 20:43:12 -04:00