forked from Mirrors/openclonk
93ba7c5954
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" |
||
---|---|---|
.. | ||
Action.c | ||
Array.c | ||
Colors.c | ||
Controls.c | ||
Creation.c | ||
Explode.c | ||
Fade.c | ||
FindObject.c | ||
Fire.c | ||
FunctionOverview.txt | ||
GUIs.c | ||
GetXVal.c | ||
Heal.c | ||
HitChecks.c | ||
LanguageDE.txt | ||
LanguageUS.txt | ||
Library_Inventory.c | ||
Material.c | ||
Math.c | ||
MeshAnimation.c | ||
Names.txt | ||
Object.c | ||
Particles.c | ||
Player.c | ||
PlayerControl.c | ||
PlayerControls.txt | ||
Proplists.c | ||
SaveScenario.c | ||
Schedule.c | ||
String.c | ||
StringTblDE.txt | ||
StringTblUS.txt | ||
Version.txt | ||
Vertices.c |