openclonk/planet/System.ocg
Mark 93ba7c5954 Vendor Library
Extracted the buy menu of the flagpole to a library, so that other objects can implement a buy menu without having to duplicate the code. An overview of the changes follows:

Library_Base:
- Moved auto-sell functionality to Library_Vendor
- Moved buy and sell functionality to Library_Vendor
- Removed the old engine menu for buying and selling

Library_Vendor:
- Added proplist for accessing local variables, avoiding variable clashes
- Added interfaces GetBuyValue, GetBuyableItems, GetBuyableAmount, ChangeBuyableAmount, GetSellValue
- Changed DoBuy: it uses the interface functions, instead of hardcoded base material
- Changed / merged the existing sell functionality and the flagpole sell functionality in DoSell:
   * does not sell items if QueryOnSell returns true
   * sell sound only audible to seller
   * the sold object tries selling its contents first (for example a bow, if it ever were sellable. This may not hold in the settlement games, but adventures would allow it)
   * the sold object ejects any contents before it is removed. These are usually unsellable objects. Previously they would just be removed together with the object. It has to be tested whether this places the items on the ground or at the center of the sold object
   * removed the "sell all" functionality on right-click for the moment.
- Still has some functions from the old base selling: CanStack and GetSellableContents, for the auto-sell functionality
- Fixed a logical error in AllowBuyMenuEntries
- Distinguish between buyer/seller and payer more, so that the logic can easily be changed in one line later
- Allow for runtime overloads of interface functions
- Changed inconsistent variable naming to a more consistent one
- Added namespaces to all sounds, the "UnCash" sound still does not exist
- Added localization strings for insufficient wealth
- Fixed property name error (missing 'e')
- Buy menu is active by default

Flagpole:
- Replaced the custom sell functionality (how many of these do we have actually??) with the sell functionality from Library_Vendor
- Buying menu is allowed if the rule is active

System.ocg/Object.c
- global functions Buy and Sell ask the target if it is a vendor, instead of whether it is a base, and do the callback there.
- renamed the argument so that it is no longer called "base", but "vendor"
2016-01-24 20:11:27 +01:00
..
Action.c Squelch varargs warnings in System.ocg 2014-12-12 23:27:17 +01:00
Array.c planet: Remove Array(Min,Max) in favor of Min,Max 2016-01-23 13:49:11 +01:00
Colors.c fix function HSLa(h,s,l,a) 2011-07-31 02:00:12 +02:00
Controls.c reimplement alt use on right mouse button 2015-06-28 09:44:50 +02:00
Creation.c killtracing: pass owner and controller correctly in CastObjects 2016-01-03 09:57:06 +01:00
Explode.c fix explosion shockwave for vehicles which can be grabbed and pushed 2015-12-19 10:42:30 +01:00
Fade.c prevent bubble from growing infinitely large 2015-09-11 23:15:23 +02:00
FindObject.c Added implicit layer check to local calls of FindObjects-family functions (#1383). 2015-09-09 20:19:45 -04:00
Fire.c moved sounds into subfolders 2015-12-13 22:14:55 +01:00
FunctionOverview.txt MakeInvincible includes MakeNonFlammable by default. 2015-09-14 22:25:27 -04:00
GUIs.c moved some functions that depend on Object.ocd from the global System.ocg to Objects.ocd/System.ocg (#1473) 2015-12-02 12:46:02 +01:00
GetXVal.c Replace BorderBound DefCore value with BorderBound object property 2016-01-01 22:18:41 +01:00
Heal.c Foodstuff heals the Clonk over time. 2015-10-29 11:33:31 +01:00
HitChecks.c make IsProjectileTarget default to true for living beings 2015-12-28 11:20:11 +01:00
LanguageDE.txt Win32: Fix file deletion from scenario selection dialogue 2016-01-24 00:43:09 -05:00
LanguageUS.txt Win32: Fix file deletion from scenario selection dialogue 2016-01-24 00:43:09 -05:00
Library_Inventory.c Turn MaxContentsCount and HandObjects into properties instead of callbacks (Possibly fixes #1553) 2016-01-10 10:41:34 -05:00
Material.c add a global function to draw material triangles 2015-12-28 10:21:49 +01:00
Math.c Added shape library. 2015-07-31 00:42:01 -04:00
MeshAnimation.c Add the Anim_RDir AVP 2014-10-09 17:11:13 -04:00
Names.txt Change .c4g extension to .ocg 2011-03-13 16:16:45 +01:00
Object.c Vendor Library 2016-01-24 20:11:27 +01:00
Particles.c cottons: when a fruit pops without being shot, it doesn't drop CottonSeed but directly spawns a plant 2015-12-09 20:15:05 +01:00
Player.c moved some functions that depend on Object.ocd from the global System.ocg to Objects.ocd/System.ocg (#1473) 2015-12-02 12:46:02 +01:00
PlayerControl.c reworked interactions (grabbing etc.) 2016-01-02 13:02:45 +01:00
PlayerControls.txt Add button X to fade through half solidmasks. 2016-01-20 18:58:11 +01:00
Proplists.c Added shape library. 2015-07-31 00:42:01 -04:00
SaveScenario.c Scenario saving: Concatenate multiple equal calls to CreateContents. 2015-01-18 14:28:10 +01:00
Schedule.c Fix a runtime error in DarkCastle 2013-10-25 17:32:53 +02:00
String.c fix ToEmString and introduce ToPercentString for GUIs 2015-06-05 12:06:02 +02:00
StringTblDE.txt Add missing string table entries for CON_FallThrough(_Desc). 2016-01-20 21:35:37 -05:00
StringTblUS.txt Add missing string table entries for CON_FallThrough(_Desc). 2016-01-20 21:35:37 -05:00
Version.txt increase game content version entries to 6.0 2014-12-12 22:58:16 +01:00
Vertices.c Add button X to fade through half solidmasks. 2016-01-20 18:58:11 +01:00