Commit Graph

906 Commits (03d0bb49dc83ac553e02608dcc1399b78e69e481)

Author SHA1 Message Date
Maikel de Vries 59961f3a17 remove base library
* remove library itself
* remove GetBase()
* change flagpole, etc.
* move basematerial library to vendor
2016-12-28 18:19:10 +01:00
Sven Eberhardt 16988e76f0 Add "flip" EditorAction to structures 2016-12-28 08:50:19 -04:00
Maikel de Vries 2392f85358 fix another c4script error when updating power network 2016-12-26 17:55:45 +01:00
Maikel de Vries a422c6d6ec power storage: save stored power and make editor property 2016-12-26 17:55:45 +01:00
Maikel de Vries 84d621fc5a fix script runtime error when updating power networks 2016-12-26 17:55:45 +01:00
Mark bace3b7d2b #1710: Remove logs for debugging 2016-12-25 19:21:16 +01:00
Mark 45f98ce03a #1710: Fix the bug
The problem was that the call to Actmap.*.StartCallLadderOverloaded happend parallely with the ladder search effect and finished after the search effect call was finished, starting a wall jump animation after the Clonk grabbed the ladder.
2016-12-25 19:21:08 +01:00
Mark 17d6bb0e1b #1710: Logs for debugging 2016-12-25 19:21:01 +01:00
Maikel de Vries 42c8dbc2c8 make producer continue directly after production finishes 2016-12-25 17:48:07 +01:00
Maikel de Vries 135a7d8aff fix support for multiple liquids in liquid containers 2016-12-25 12:48:15 +01:00
Maikel de Vries ae40126dbb implement pumping specific liquids only 2016-12-24 14:09:47 +01:00
Maikel de Vries c7afed1aeb allow pumping liquids from container (foundry and steam engine) 2016-12-24 14:09:47 +01:00
Maikel de Vries 7715d961f5 add information about whether power storages are being filled to the power display 2016-12-18 12:20:36 +01:00
Maikel de Vries 95e520a941 initialize power library local vars in construction callback (#1868) 2016-12-18 11:08:51 +01:00
Clonkonaut afc565a419 Re-enabled automatic bucket emptying (#1867). 2016-12-18 00:50:35 +01:00
Maikel de Vries 7ef0fc5568 don't let producers empty extra slots (#1864) 2016-12-16 21:37:47 +01:00
Lukas Werling 68ddeb3bed Convert all text files in planet to UTF-8 2016-12-11 21:19:13 +01:00
Maikel de Vries 1d258d3d48 fix (#1846) for real now 2016-12-01 23:02:43 +01:00
Maikel de Vries 7552fd94f7 fix ownership changes of moving flags (#1846) 2016-11-28 00:53:48 +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
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
Sven Eberhardt 2b6eb83e48 Fix some parameter count errors 2016-10-24 21:28:31 -04:00
Sven Eberhardt 342916a1ed Fix some implicit for loop declaration errors 2016-10-24 21:02:02 -04:00
Maikel de Vries e124433cd5 fix playing sound when trying to enter enemy door 2016-10-16 18:47:45 +02:00
Maikel de Vries b4cdeb3da4 base material & production: add fail safes and remove entries with zero material 2016-10-16 18:47:45 +02:00
Mark 2957a777b3 Goal: Extracted function NotifyPlayerHUD
Removed duplicate code in the process.
2016-10-09 11:53:25 +02:00
Mark 35e8a43f82 Goal: Optimize HUD updates
No more lacking behind the fulfillment status.
2016-10-09 11:50:06 +02: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
Lukas Werling ddb34ab5cb Disallow interaction with actively controlled Clonks
This prevents inventory stealing which is undesirable in cooperative
scenarios with competitive elements (e.g. some races) and confusing to
players.
2016-10-05 22:14:40 +02:00
Maikel de Vries 89be9bd158 implement scenario saving for liquid tank, pump & pipe 2016-10-03 18:07:49 +02:00
Maikel de Vries 1483620b2b fix c4script runtime error in power system when pump is initialized 2016-10-02 23:23:20 +02:00
Maikel de Vries b42a4b824b insect swarm: fix movement issues 2016-09-30 18:58:42 +02:00
Mark 58d42b8fd8 Library Lamp: Extracted functions.
Did this change a long time ago, probably for re-using functions in a derived object.
2016-09-15 19:17:17 +02:00
Sven Eberhardt 22af9f0e8c Fix landscape placement functions (#1820, #1821) 2016-09-14 21:30:57 -04:00
Sven Eberhardt 282a561462 Add editor props and user actions for boiling lava and acid
Also optimize the timer
2016-09-06 00:06:37 -04:00
Sven Eberhardt 6aeeff0545 Add Library_Stackable editor props 2016-09-05 20:19:25 -04:00
Sven Eberhardt db986e3dd7 Allow repeated ejection of infinite material stack counts in bucket and barrel 2016-09-05 20:08:30 -04:00
Sven Eberhardt 3330c592e3 Improve PlayerStart initial material setting to allow specification of weapon ammo, stackable stack count and liquid contents 2016-09-05 20:01:47 -04:00
Sven Eberhardt 6a78a9facb Fix scenario saving of some animal and plant properties 2016-09-04 02:52:03 -04:00
Sven Eberhardt bdbce1c4c9 Fixes and EditorProps for plant reproduction 2016-09-01 23:54:27 -04:00
Sven Eberhardt 9cec9b5071 Make animal library properties editor-adjustable
Allows e.g. placement of animals that do not reproduce.
2016-09-01 02:23:42 -04:00
Sven Eberhardt cd4e419aef Disallow interaction menu on hostile and neutral clonks
Stealing items in melees or taking quest items from NPCs is a bit odd.
2016-08-30 19:54:58 -04:00
Maikel de Vries 788ba6e0c4 allow swapping source and drain pipe at the pump 2016-08-27 17:10:30 +02:00
Sven Eberhardt 56adee6bb9 Add script goal editor properties and user actions 2016-08-20 01:55:22 -04: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
Clonkonaut 01232b61a5 Fixed taking off of helmet when putting on another. 2016-08-17 20:23:33 +02:00
Maikel de Vries 192ccc0203 prevent hitting self with reverse throw (#1759) 2016-08-15 19:20:08 +02: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 43117a53bd Added Library_Wearable for clothing or other worn items. 2016-08-12 18:22:50 +02:00
Maikel de Vries df098d2840 pump only activates when drain is free or accepts liquid 2016-08-07 21:26:23 +02:00
Lukas Werling f3b2ff1295 Merge branch 'gamepad-controls' 2016-08-07 18:10:24 +02:00
David Dormagen a9b1b975d3 removed Libraries/Animal/CreatureControl (and thus the automatic script player)
The script players was not treated correctly by the goals, so joining it automatically would break stuff. While I still like the implications of an automatic script player, it was too much of a hassle for now.
Find_AnimalHostile works around the main issue as it allows just using Find_AnimalHostile and automatically have the animal work for both neutral owners and as pets. It does not allow for the distinction of hostile neutral and friendly neutral, though.
2016-08-07 17:05:53 +02:00
Sven Eberhardt 5db45c0f47 Merge branch 'master' into qteditor 2016-08-06 21:45:19 -04:00
Sven Eberhardt a21a1a8051 Limit goal placement in editor to one per goal type 2016-08-06 02:37:25 -04:00
Clonkonaut 8d6d57089b Inventory slot selection is back on key down.
This makes the selection of the Q slot slightly more awkward because you select the target slot in between. Or to say otherwise: it is kind of like it was before.
2016-08-05 19:36:26 +02:00
Clonkonaut f4ca4466f1 Basements combine in all four directions when constructing! 2016-08-05 18:21:34 +02:00
Clonkonaut ad2bbbf5fd ForceConstruct() added to ConstructionSite for better debugging.
Will construct the construction without the needed material. I often needed to test stuff with construction sites and always had to script-create all the material which is tedious.
2016-08-05 18:19:05 +02:00
Clonkonaut 34af29fd7b Show quick slot item on clonk.
All GetCarry* callbacks receive a parameter whether they are held in this slot and can then return a different display mode!

I also took the opportunity to restructure many scripts in a similar way.
2016-08-05 01:14:13 +02:00
Sven Eberhardt 729489e40d Add user action: Set clonk inventory size 2016-08-03 23:50:35 -04:00
Sven Eberhardt 71b337fd59 Add SetMaxContentsCount function to inventory library
Makes sure the inventory buttons and hands are updated.
2016-08-03 23:50:34 -04:00
Clonkonaut d1382f7244 Fixed inventory slot selection. 2016-08-02 23:59:15 +02:00
Clonkonaut 36e2e1ab3e Switch inventory slots by pressing number key (hold) + number key.
This can be used to sort the inventory according to personal liking!
2016-08-02 18:39:13 +02:00
Clonkonaut 89be1da072 Changed quick switch slot selection to Number + Q.
As suggested by Zapper in this posting: http://forum.openclonk.org/topic_show.pl?pid=31073#pid31073.
This way is probably the only way item usage will ever work on Q. For now, this reverses the previous changes. Q will again react on key down.
2016-08-02 17:49:34 +02:00
Clonkonaut faf3add7e7 Quick Switch slot is now selectable using Q + number key.
This makes a very fundamental change with quick switch: The switching action is now performed on the key release instead of the key press. Let's see if this performs badly for players.
2016-08-02 00:37:40 +02: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
Clonkonaut 48b5f27f14 Fix effect removal of 'IntUpgradeProductProgressBar' when closing the interaction menu of a producer (#1796). 2016-07-25 17:42:15 +02:00
Sven Eberhardt 534e4cc745 Merge branch 'master' into qteditor
Conflicts:
	src/script/C4AulParse.cpp
2016-07-24 10:23:57 -04:00
Sven Eberhardt 58faf41068 Sequence: Add more triggers.
* Player enters circular region
* Game starts (after player joins)
* Player joins
* Player removed
* All goals fulfilled
* Clonk death
* Construction of structure
* Production of item
2016-07-22 01:51:29 -04:00
Sven Eberhardt 097ff2c9fb Moved ConstructionSite from libraries to structures
This makes it more accessible in the editor. Otherwise, there would be "libraries/constructor" folders in the object creator with the construction site as the only contained definition.
2016-07-10 22:10:49 -04:00
Sven Eberhardt 36685a3119 Add HideInCreator=true to internal/helper/library definitions 2016-07-10 22:06:48 -04:00
Mark 3bb4e7b45f Ladder: CanNotBeClimbed callback provides the clonk
Certain ladders (in an expansion pack) should not be climbable, but this depends on the clonk that wants to climb on the ladder. Added the clonk as a second parameter to the callback, in order to not mess up the callback structure of other external packs.
2016-07-10 22:11:35 +02:00
David Dormagen 6524136c9d inventory: collect directly into pushed lorry when using Shift
As suggested by Dmyst: http://forum.openclonk.org/topic_show.pl?pid=32169#pid32169
2016-06-22 09:53:52 +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
Clonkonaut b6ca10d11a Constructor library: Changed to search through all available knowledge and filter using an overloadable function.
The hammer will now only construct definitions that have the callback "IsHammerBuidable". This will exclude all C4D_Structure objects that are not buildings and can't be build in a meaningful way.
Also, with the carry heavy branch I want to test adhoc built lorries (lorries as construction sites). Sven suggested this.
2016-06-18 19:45:45 +02:00
Maikel de Vries c538a0d617 add missing neutral pipe interaction menu tooltips for liquid tank 2016-06-11 20:57:06 +02:00
Mark d51a8cfa6d Liquds: Liquids can be passed either as a string or as a definition 2016-06-05 12:05:48 +02:00
Mark 923ee485ec Liquid container: PutLiquid(*, nil, *) inserts maximum amount of liquid
Added unit test.
2016-06-05 12:05:42 +02:00
Mark e1413a941d Producer: Commented out log output
This was there for debugging purposes only.
2016-06-01 20:42:03 +02:00
Mark ffcbdc7fd0 Fixed producers unit test #7
The problems here were:
- the foundry cannot take 400 water from ice if it has a fill limit
- the pump cannot pump anything into the object if it has no fill limit
2016-06-01 19:10:46 +02:00
David Dormagen 6696ee679c carry heavy: do not prevent scrolling through inventory (#1738) 2016-05-30 09:57:39 +02:00
Maikel de Vries 3455fa24f9 add some variation to the maximum size of trees 2016-05-21 13:34:34 +02:00
Maikel de Vries e92e7a2e2c fix producer components call after liquid_container branch merge 2016-05-21 13:34:34 +02:00
Maikel de Vries 1df322b7ff adapt objects and scenarios to new component implementation 2016-05-21 13:34:34 +02:00
Nicolas Hake 8e18a3fc96 Change (int)0 to nil where deprecated 2016-05-13 17:13:34 +02:00
Mark 853af2c155 Merge 'master' into liquid_container 2016-05-01 08:43:05 +02:00
Maikel de Vries 08668ef988 do not reset last item for quick switch when selecting same slot twice 2016-04-27 21:15:37 +02:00
Lukas Werling 11904c0217 Fix Q doing nothing initially
Both the initial “selected” and “last” inventory slots were initialized
to 0, making Q useless. Many melees give more than one item to the
player, filling up from the first slot. Having Q switch to the second
slot initially is better than doing nothing, which will never happen
later on.
2016-04-27 19:02:54 +02:00
Maikel de Vries 3c267bb7dc making buying in flagpole work when flag is in non-nil object layer 2016-04-24 13:21:16 +02:00
Maikel de Vries cea685f7ea fix flickering wealth entries for non-first players 2016-04-23 22:20:01 +02:00
Mark 72c7e4dd87 Merge remote-tracking branch 'origin/master' into liquid_container 2016-04-23 11:10:26 +02:00
Maikel de Vries 06e8df86ca fix FacetBase typos 2016-04-22 23:27:33 +02:00
David Dormagen cdcb9a5a53 power display: made text GUI_FitChildren
.. so that small resolutions do not lead to even smaller scrollbars next to the power information. It's still not very aesthethic when it's multiline (because it's just so much text) but now it doesn't look horribly broken at least.
2016-04-17 22:28:34 +02:00
Maikel de Vries b7a8b3067f correctly stop use control when clonk is attached (#1590) 2016-04-17 15:13:10 +02:00
Maikel de Vries 0686fdb2fc fix shift of buy menu entries when clicking an entry 2016-04-16 15:38:34 +02:00
Mark cf81014785 Fix: Corrected commit "Vendor: allow rebuy"
The parameter is an object, but should be an id. This was not detected at runtime.

Fix for commit 89718f35a4
2016-04-12 06:46:06 +02:00
Mark 8fea6827f5 Fix: Corrected commit "Vendor: allow rebuy"
The parameter is an object, but should be an id. This was not detected at runtime.

Fix for commit 89718f35a4
2016-04-12 06:25:22 +02:00
Mark e12dce093a Fix trees growing underground 2016-04-11 22:22:21 +02:00
Mark 8d4f6399aa Bugfix: Trees seed wrongly.
The trees actually seeded at a very wrong place in case the property "Confinement" was not set: The area.x, area.y, area.w, area.h coordinates were specified as global coordinates, but were used as offset coordinates in PlaceVegetation.

This leads to the trees seeding underground, too, unfortunately.
2016-04-11 22:14:20 +02:00
Mark 9cb261aac8 Bugfix: Trees seed wrongly.
The trees actually seeded at a very wrong place in case the property "Confinement" was not set: The area.x, area.y, area.w, area.h coordinates were specified as global coordinates, but were used as offset coordinates in PlaceVegetation.

This leads to the trees seeding underground, too, unfortunately.
2016-04-11 22:12:51 +02:00
Mark b6b5f5a79f Merge branch 'master' into liquid_container 2016-04-11 21:23:28 +02:00
Mark 89718f35a4 Vendor: Allow rebuy
Added a callback QueryRebuy(int for_player, object base) in the vendor library. If an object that will be sold returns true in that function then the object will not be added to the base material of the selling player.
Currently the only objects that are sellable are Diamond, GoldBar, Nugget, Ruby. They cannot be rebought, just as in the previous implementation.
2016-04-11 21:21:41 +02:00
Mark 43d6fcd231 Plant: Extracted a function for plant reproduction.
The existing Seed() places plants with a random chance. This makes testing the placement tiresome, so the actual placing part was moved to the new function DoSeed().
2016-04-11 21:21:38 +02:00
Maikel de Vries 9bb2de333a fix and improve grabbing onto ropeladders 2016-04-11 21:04:51 +02:00
Maikel de Vries 6bcd8fd596 implement uncash sound for buying at the vendor library 2016-04-10 12:21:41 +02:00
Maikel de Vries 79beb8de47 compactify buy menu entries a little
This prevents unnecessary scrolling and there was a unused little whitespace.
2016-04-08 22:09:22 +02:00
Maikel de Vries 43c7e92fd8 show no power need rule in flagpole interaction menu overview 2016-04-08 21:30:29 +02:00
Maikel de Vries fbb365fd65 fix playing sounds in vendor library 2016-04-07 19:27:27 +02:00
Mark 69467d3c70 Found unused function 2016-04-07 17:29:40 +02:00
Mark c607e3e4c2 Merge commit '0795d088d1f82e8d4158e4fa859bbe69e0c4c875' into liquid_container
Conflicts:
	planet/Objects.ocd/Libraries.ocd/Stackable.ocd/Script.c

Unit tests still pass!
2016-04-05 06:29:08 +02:00
Maikel de Vries 0795d088d1 stack objects with extra slots in menu iff slot contents can be stacked 2016-04-04 22:23:34 +02:00
Mark b00290f5f7 Vendor: Added parameter for the base that is selling the object.
This way the barrel can sell its contents, leaving behind an empty barrel.
2016-03-29 20:11:41 +02:00
Mark bc9538200c Merge branch 'master' into liquid_container 2016-03-29 20:06:14 +02:00
Mark 7e74baac55 Refactoring: Construction site takes materials, not the constructor
The functionality of taking construction materials from a clonk and lorries was extracted to a separate function and moved from the constructor to the construction site. This is a little bit of an esthetic decision, but it is also useful for my project that has a spacebar-interaction which takes construction materials from the clonk without the need to open the inventory menu.
2016-03-29 18:56:10 +02:00
Mark 7110882813 Vendor: Extracted functions for ejection of contents
In certain overloads of the object I want to be able to not eject contents, or eject only certain objects. The default behaviour of ejecting ALL contents whenever someone buys something is annoying in certain structures, such as a marketplace.
2016-03-28 22:33:58 +02:00
Mark 96c84a5bcd Deleted outdated Library_BarrelFiller
Barrels get filled by liquid objects now, you just have to insert liquid objects into the container.
2016-03-25 20:01:38 +01:00
Mark ab5d92117a Refactoring: Added parameter for container in CreateLiquid() 2016-03-25 19:44:36 +01:00
Mark 52542d7977 Refactoring: Liquids: Removed GetLiquidID() and changed CreateLiquid()
CreateLiquid() can be called from definition context now, to create a certain amount of liquid.
2016-03-25 19:34:36 +01:00
Mark 1c1ea38efa Renamed the liquids IDs
Omitted the prefix "Liquid_".
2016-03-25 19:11:55 +01:00
Mark ed75112715 Move liquids to the folder Items\Resources 2016-03-25 19:11:34 +01:00
Mark dd7bf3e89e Merge remote-tracking branch 'origin/master' into liquid_container
Conflicts will be merged in the next commit:
	planet/Objects.ocd/Items.ocd/Tools.ocd/Pipe.ocd/PipeLine.ocd/Script.c
	planet/Objects.ocd/Items.ocd/Tools.ocd/Pipe.ocd/Script.c
2016-03-25 17:15:39 +01:00
Mark db061b5cad Refactoring: Simplified script.
Unit tests still pass.
2016-03-25 16:31:17 +01:00
Mark a34eea41dc Power: Fixed unit test 21 2016-03-25 16:24:43 +01:00
Mark 6b7dc6015d Liquids: Fix liquids entering Clonks 2016-03-25 16:12:02 +01:00
Mark b491260fac Refactoring: Producers: Removed another special case from IsCollectionAllowed()
This special case was handled by the fact that liquid items are components anyway, and the ice object is handled differently.
2016-03-24 22:26:09 +01:00
Mark 0ef237988e Refactoring: Producers: Removed special case in IsCollectionAllowed()
The special case can be handled in RejectCollect(). Unit tests passed.
2016-03-24 22:20:55 +01:00
Mark ff89f337de Refactoring: Producers: Readability
Renamed some parameters and variables
2016-03-24 22:16:08 +01:00
Mark 29870b5e6d Producers: Code formatting 2016-03-24 21:28:09 +01:00
Mark fc3d6a69f0 Producers: More unit tests for basic operation
Added tests for adding to the queue and clearing the queue. The other tests are dummies for now. Found out that the parameter 'abort' in ClearQueue() was never used.
2016-03-24 18:27:23 +01:00
Mark 18ad5894e2 Producers: Producers can convert ice to water
This special case is a relic, because I do not know whether this is actually a use case that is required in a scenario. All unit tests in the producers test pass now.
2016-03-24 16:19:15 +01:00
Mark 332b899c54 Barrel: Fixed barrel liquid ejection
The barrel did not eject liquids with the correct angle when using the barrel, because the parameters were not used by the liquids.
2016-03-23 20:18:08 +01:00
Mark 02b8cf8422 Barrel: Fixed barrel getting filled with liquids
Barrels was not updating, and caused an error when getting filled with liquid.
2016-03-23 20:11:23 +01:00
Lukas Werling acc04b2398 Improve default Use/Throw angles when not aiming 2016-03-22 18:56:31 +01:00
Lukas Werling fac684a973 Fix crosshair being visible initially 2016-03-22 17:13:21 +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
Mark 274379ddc3 Producers: Fixed unit test 5
Added unit test 6 for fuel objects that do not behave correctly. Fuel should always return the current fuel amount if not parameter is passed.
2016-03-18 17:44:51 +01:00
Mark 2e3a984b20 Producers: Fixed objects with liquid need
Liquids are handled as objects now, so that the function GetLiquidNeed() in the objects is obsolete. Adjusted the collection function accordingly.
2016-03-18 06:35:44 +01:00
Mark 49fdd59362 Refactoring: Stackable: Moved callback CollectFromStack()
The callback happens in every call to MergeWithStacksIn() now, instead of RejectEntrance(). Otherwise the following use case does not work: Liquid enters crew/building and fills the contained barrels. Added a unit test for that use case. Stackable unit tests still pass.
2016-03-17 18:43:08 +01:00
Mark 8749300622 Fix unit tests: Some code adjustments were forgotten in the other commits. 2016-03-16 22:44:48 +01:00
Mark 7febb8fd91 Refactoring: Stackable: The size of stacks can be limited by a container now.
The function RejectEntrance() has two more callbacks to the object it should enter:
- CollectFromStack(object stack): The object can grab items from the stack, before the stack tries to merge with stacks in the object. This is necessary for barrels, so that a large liquid stack can fill an empty barrel.
- RejectStack(object stack): This is called after the stack is merged. Currently, the stack merging counts as handled only if the stack is removed. This callback allows the object to still reject the stack, for example if it accepts only one item, such as the barrel does.
2016-03-16 22:43:44 +01:00
Mark ac8d40418c Refactoring: Stackable: Renamed TryPutInto() to MergeWithStacksIn()
The previous name suggested that the object actually gets put into another object. In fact it merges the stack count with other stacks, and it does not only try to (and reverts the state if it fails), but it actually changes other objects even if the function returns false.
2016-03-16 18:19:55 +01:00
Mark e1cde6a92e Stackable: Better explanation of TryPutInto() 2016-03-16 07:00:54 +01:00
Mark 918baf3c11 Stackable: Documentation 2016-03-16 06:52:59 +01:00
Mark 176856e276 Refactoring: Stackable: Moved HUD notifications to a separate function.
It should be OK that the new function calls OnInventoryChange() in Clonks on destruction now.
2016-03-11 17:10:41 +01:00
Mark a61eac6ff3 Refactoring: Stackable: Reenabled recursive stacking into items
This got removed by accidet (checking if the object was added to another stack seemed logical). However, this whole function does not really make sense. It returns true if the object got removed only. That means that the object would not enter the other object anyway.
Removed the UpdateStackDisplay(), because that happens in TryAddToStack() if the count changes, anyway.
2016-03-11 07:03:22 +01:00