Commit Graph

381 Commits (c00a8cf3c3a33a88c5a8aba152d06d9f483921a5)

Author SHA1 Message Date
Maikel de Vries c00a8cf3c3 fix a bunch of suspicious assignment warnings 2018-04-09 11:53:55 +02:00
Maikel de Vries aa892171fb update version to 8.0 in DefCore.txt, Scenario.txt and Version.txt 2018-01-28 13:18:46 +01:00
David Dormagen 6b797e300e inventory bar: stack count always falls back to contained object count
Related to #1970 and 5fc07df757
This replaces the very hacky implementation just for the dynamite with a more general solution (and e.g. also works with the grenade launcher).
2018-01-13 15:24:08 +01:00
Sven Eberhardt 5fc07df757 Fix dynamite stick display count within dynamite box in interaction menu. 2018-01-09 18:00:35 -08:00
David Dormagen 0f049800c5 Revert "Object Interation Menu: Request displayed amount from objects" (#1970)
This reverts commit 8698aa25cf.

Tackling #1970. The implementation in the reverted commit was incorrect (i.e. only one out of two "GetStackCount" were replaced with GetInteractionMenuAmount, leading to weird behaviour). If you want to replace it, please do it in a way that no call to IsInfiniteStack will be required. And this hack would probably require so much more bloat code that nothing would be gained (i.e. what happens when you put two infinite arrow stacks in one container?).
The bug report complains about the "display stopping at 999" *in some situations*, which was due to Stackable_Max_Display_Count. It's gone now. And that it was not limited to 999 in all situations (like the code would have suggested) is probably due to the things I described above.

# Conflicts:
#	planet/Objects.ocd/Libraries.ocd/LiquidControl.ocd/Liquid.ocd/Script.c
#	planet/Objects.ocd/Libraries.ocd/Stackable.ocd/Script.c
2018-01-07 17:42:27 +01:00
David Dormagen d108cdd6aa inventory menu: be more lenient when it comes to finding matches between updates (#1964)
The matching had a few issues:
Items with the same symbol were supposed to be stacked, but the "symbol" changed from ID to object at some point. So same-type objects were no longer correctly matched.
Items with different text (e.g. amount) but everything else the same should be stacked. But simple proplist equality is obviously not sufficient to determine whether the contents of the proplist changed.

The order of the items is generally more stable now. I hope this doesn't introduce other issues.
2017-12-27 15:42:38 +01:00
Lukas Werling d43051b180 Prevent script error in ObjectInteractionMenu
ERROR: proplist access: proplist expected, got nil
 by: Object(18501)->OnContentsSelection() (Objects.ocd/HUD.ocd/ObjectInteractionMenu.ocd/Script.c:887)
 by: Object(18501)->OnMenuEntrySelected({index = 0, slot = 0},2,1) (Objects.ocd/HUD.ocd/ObjectInteractionMenu.ocd/Script.c:880)
 by: Object(18911)->DoCall(2,0,Object(18501),0,1) (Objects.ocd/HUD.ocd/MenuStyles.ocd/List.ocd/Script.c:166)
 by: Object(18911)->OnClick(0,1,948,2,Object(18911)) (Objects.ocd/HUD.ocd/MenuStyles.ocd/List.ocd/Script.c:175)
2017-12-27 12:50:56 +01:00
David Dormagen 42b6e1f69c extra-slot display now shows object instead of definition (#1924)
Showing the definition means that objects can not modify their display in the extra-slot. E.g. the arrows would always show their "full" state. Now the arrow count is correctly displayed in the extra-slot.
2017-06-28 19:22:05 +02:00
Maikel de Vries 3a2c68dcc9 interaction menu: add callback target for menu entries
This allows to forward menus of one object to its parent properly. A specific usecase is cannons, which are soon to come (hopefully).
2017-06-26 17:28:40 +02:00
Maikel de Vries 0cd307a5f0 interaction menu: remove contents refresh effect if menu ordering has changed
This can happen if an objects updates the menus without any callback function [UpdateInteractionMenus(callbacks)].
2017-06-26 17:26:06 +02:00
David Dormagen 0d32d924dc InteractionMenu: fix script error when custom entry extra_data contains something different from a proplist
The check was only meant for inventory menus (where extra_data always is a proplist); it was not in the right if-clause below, though.
2017-05-02 19:13:48 +02:00
David Dormagen a561e15288 object interaction menu: made some comments clearer
They were introduced in c37bc586e9
2017-03-13 14:56:45 +01:00
Mark c37bc586e9 ObjectInteractionMenu: Add parameter for entry callback #1896 2017-03-06 05:33:57 +01:00
Maikel de Vries 8208a19c8f delete interaction menu effect when menu is closed
This prevents a lot of effects without command target from floating around.
2017-01-22 10:49:58 +01:00
Maikel de Vries 5e6cf4e7b8 show goal name in goal menu 2017-01-15 15:38:32 +01:00
Maikel de Vries 667b13c098 remove LifeCheck effects from progress bars
This check is done by the attachment action already and led to the creation of many useless effects.
2016-12-17 17:26:11 +01:00
Lukas Werling 68ddeb3bed Convert all text files in planet to UTF-8 2016-12-11 21:19:13 +01:00
Mark 94ec4e336b Fix inherited(...) calls
The named parameters have to be handed down, because the ... operator only passes all the unnamed parameters.
2016-11-26 17:56:41 +01:00
Mark 5fc6ae05f8 HUD Modularity: Move library as suggested by Clonkonaut 2016-11-26 11:12:09 +01:00
Mark 202e1ed682 HUD modularity: Callback for controller ID
I think that the call GUI_Controller->GetControllerID() has more appeal, but it makes the code confusing maybe.
2016-11-26 11:10:35 +01:00
Mark b557719287 HUD modularity: Library for HUD controller
Extracted the basic functionality for HUDs from GUI_Controller to a library. This way, if you want to create a new HUD, you only have to include the library and all the desired components. Previously you had to copy the script from GUI_Controller, too. This holds of course only if you want to actually remove components from the HUD, and not just add to it.

Currently the GUI_Controller is referenced as the ID for the HUD, will change this to a callback.
2016-11-26 11:10:29 +01:00
David Dormagen ae2000f0a1 Contents menu: sort extra-slot containers to front to make items jump around less
With the highest items being in the front, the tight grid layout has less reason to resort a major amount of the items every time items are added or removed. This results in a generally more stable layout.
2016-11-07 20:09:37 +01:00
David Dormagen 12e808263b Contents menu: use tight grid layout (#1842)
This makes extra-slot containers not block an extra row anymore. However, they might jump around a bit. It might be a good idea to set their priority lower to make them always appear first.
When they would be in front, the tight grid layout would likely not move them around.
2016-11-05 15:35:15 +01:00
Sven Eberhardt 0d20551ab6 Fix some "function variable hides local variable" warnings 2016-10-24 21:05:17 -04:00
Mark 84dd95df34 Goal controller: Player parameters for goal display functions
Allows goals with different symbols per player.
2016-10-09 11:34:13 +02:00
Mark 9fcd3ee13e Goal controller: Extracted functions
Made the variable names consistent between GoalSubMenu() and OnGoalUpdate();
Extracted the functions GetGoalSymbol() and GetGoalGraphics();
2016-10-09 11:26:47 +02:00
Mark b18a7b7a3f Goal controller: Readability
The change in call structure should not make that much of a difference in performance.
2016-10-09 11:18:10 +02:00
Mark 0d22f58b52 Goal controller: Get short description only once. 2016-10-09 11:13:12 +02:00
Mark 0732b7dc87 Goal controller: Code cleanup 2016-10-09 11:11:51 +02:00
Mark b235c5e9e4 Goal controller: Simplified code 2016-10-09 11:11:28 +02:00
Mark f52159b835 Goal controller: Variable definitions 2016-10-09 10:58:37 +02:00
Mark be207737bc Goal controller: Slight optimization
No need to call the function twice. This is trivial though, the call is not expensive usually.
2016-10-09 10:51:48 +02:00
Mark 7c169c7905 Moved object interaction menu sidebar icons to separate overloadable functions 2016-10-08 17:46:39 +02:00
Clonkonaut f37eda9508 Moved HUD proplist definitions to separate, overloadable functions.
See http://forum.openclonk.org/topic_show.pl?pid=32552#pid32552 for more information.
2016-10-06 01:47:45 +02:00
Sven Eberhardt b317afbadc Fix division by zero on progress bars with max=0 2016-10-01 10:26:25 -04:00
Sven Eberhardt 0cdad64934 Fix goal and rule displays (#1811) 2016-09-14 21:46:16 -04:00
Sven Eberhardt 4caa9ee217 Fix disappearing health bars after crew reactivation and savegame reload (#1629, #1740) 2016-08-28 22:13:08 -04:00
Sven Eberhardt bce903ee04 Merge branch 'master' into qteditor
Conflicts:
	planet/Objects.ocd/Items.ocd/Tools.ocd/Dynamite.ocd/Script.c
	planet/Objects.ocd/Libraries.ocd/Animal.ocd/CreatureControl.ocd/DefCore.txt
2016-08-13 23:42:59 -04:00
Clonkonaut 51a18f42b2 Expand ObjectInteractionMenu search radius one pixel lower (#1788).
I don't think this pixel will hurt too much.
2016-08-10 00:01:27 +02:00
Clonkonaut 05a814461f ObjectInteractionMenu: don't create infinite ExtraSlotTracker effects.
I think there's a bug in the effects system. It seems that effects are not removed properly if command_target is deleted. I will investigate.
2016-08-09 23:45:48 +02:00
Sven Eberhardt 5db45c0f47 Merge branch 'master' into qteditor 2016-08-06 21:45:19 -04:00
Sven Eberhardt 90d813fc5a Fix OnMouseOver / OnMouseOut parameter warnings
The callbacks from PlayerControl aren't used anywhere right now and there's only two unrelated internal functions in the GUI list menu with the same name. So the parameter checker emits a warning here.

Solve it by renaming the internal functions.
2016-08-06 21:42:21 -04:00
Sven Eberhardt 693c0124b9 Update more goal icons for better editor size 2016-08-04 21:15:25 -04:00
Clonkonaut 2713462cd2 Show quick switch key above quick switch item slot in HUD.
This will prepare the quick switch system according to Maikel's suggestion (http://forum.openclonk.org/topic_show.pl?pid=31070). The highlighting method is open to discussion. Currently, font colour and style are similar to the interaction key above the action bar icon. But it is very well possible that this will look bad when the key name is very long.
2016-08-01 17:14:34 +02:00
Sven Eberhardt 36685a3119 Add HideInCreator=true to internal/helper/library definitions 2016-07-10 22:06:48 -04:00
David Dormagen c820dac7c3 classic menu style: only show count if applicable
Otherwise, it would show "0x" for stuff where the count did not matter.
2016-05-21 13:19:49 +02:00
Nicolas Hake 8e18a3fc96 Change (int)0 to nil where deprecated 2016-05-13 17:13:34 +02:00
Mark dfbeec20f8 ObjectInteractionMenu: More sensible use of the variables/if-clause
The original implementation is ok, but why check the value if it would not change anyway? In the new implementation the variable lives only where it can actually change, and so does the if-clause.
2016-04-05 21:09:04 +02:00
Mark fbfdcaf932 ObjectInteractionMenu: Extracted sounds 2016-04-05 20:59:00 +02:00
Mark 2fc89201ce ObjectInteractionMenu: Renamed variables
Variables have the same names in both functions.
2016-04-05 20:55:04 +02:00