Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
inventory [2019/04/10 08:51] – [Multilingual] admin | inventory [2020/06/02 13:21] – [Inventory-Designer] admin | ||
---|---|---|---|
Line 106: | Line 106: | ||
As mentioned also this resulting items need to be registered as templates in the inventory. | As mentioned also this resulting items need to be registered as templates in the inventory. | ||
- | ==== Crafting | + | === Crafting === |
<file pascal> | <file pascal> | ||
LFire : TGorillaInventoryItemTemplate; | LFire : TGorillaInventoryItemTemplate; | ||
Line 134: | Line 134: | ||
</ | </ | ||
- | ==== Up-/ | + | === Combining === |
+ | Combining items works the same way like crafting. The only difference is the used time. While crafting expects a predefined time span, combining should work immediatly. | ||
+ | |||
+ | So simply set TimeNeeded property on manufacturer construction to less-equal zero. | ||
+ | <file pascal> | ||
+ | LMan.TimeNeeded := 0; | ||
+ | </ | ||
+ | |||
+ | The Manufacture() method will then not start an async thread for construction, | ||
+ | |||
+ | === Up-/ | ||
To allow up-/ | To allow up-/ | ||
Line 143: | Line 153: | ||
LChimney.Group := LMainGrp; | LChimney.Group := LMainGrp; | ||
LChimney.ImageIndex := 6; | LChimney.ImageIndex := 6; | ||
+ | LChimney.Name.Add(LLangEN_US, | ||
+ | LChimney.Name.Add(LLangDE_DE, | ||
| | ||
// link with fire template for possible downgrade | // link with fire template for possible downgrade | ||
LChimney.DowngradeItem := LFire; | LChimney.DowngradeItem := LFire; | ||
- | | ||
- | LChimney.Name.Add(LLangEN_US, | ||
- | LChimney.Name.Add(LLangDE_DE, | ||
// link with chimney template for possible upgrade | // link with chimney template for possible upgrade | ||
Line 154: | Line 163: | ||
</ | </ | ||
+ | To downgrade we call the Downgrade() method with the specific collected item: | ||
+ | <file pascal> | ||
+ | procedure TForm1.MenuItem8Click(Sender: | ||
+ | var LColl : TGorillaInventoryCollectable; | ||
+ | begin | ||
+ | // downgrade the item | ||
+ | LColl := PopUpMenu1.TagObject as TGorillaInventoryCollectable; | ||
+ | if not Assigned(LColl) then | ||
+ | Exit; | ||
+ | // check if the item is downgradable | ||
+ | if LColl.IsDowngradable() then | ||
+ | FInventory.Downgrade(LColl) | ||
+ | else | ||
+ | ShowMessage(' | ||
+ | end; | ||
+ | </ | ||
+ | |||
+ | Equivalent to downgrading we call Upgrade() with the specific collected item to level up our item: | ||
+ | <file pascal> | ||
+ | procedure TForm1.MenuItem7Click(Sender: | ||
+ | var LColl : TGorillaInventoryCollectable; | ||
+ | begin | ||
+ | // upgrade the item | ||
+ | LColl := PopUpMenu1.TagObject as TGorillaInventoryCollectable; | ||
+ | if not Assigned(LColl) then | ||
+ | Exit; | ||
+ | |||
+ | // Check if the item is upgradable | ||
+ | if LColl.IsUpgradable() then | ||
+ | FInventory.Upgrade(LColl) | ||
+ | else | ||
+ | ShowMessage(' | ||
+ | end; | ||
+ | </ | ||
==== Multilingual ==== | ==== Multilingual ==== | ||
Line 181: | Line 224: | ||
<file pascal> | <file pascal> | ||
FInventory.Language := GORILLA_LANG_EN_US; | FInventory.Language := GORILLA_LANG_EN_US; | ||
+ | FIFrame.UpdateInventory(); | ||
</ | </ | ||
Currently supported languages are: | Currently supported languages are: | ||
- | ^Language | + | ^ID ^Language |
- | | english | + | | GORILLA_LANG_EN_US | english | |
- | | english | + | | GORILLA_LANG_EN_UK |
- | | german | + | | GORILLA_LANG_DE_DE |
- | | german | + | | GORILLA_LANG_DE_AT |
- | | german | GORILLA_LANG_DE_CH | | + | | GORILLA_LANG_DE_CH |
==== Collect ==== | ==== Collect ==== | ||
Line 316: | Line 360: | ||
The inventory component is a non-visual component which needs an user-interface to make your items visible. | The inventory component is a non-visual component which needs an user-interface to make your items visible. | ||
- | You can extend the **TInventoryFrame** [Gorilla.UI.Inventory] component to build your own user-interface. | + | You can extend the **TInventoryFrame, TInventoryGroup and TInventoryCollectedItem |
+ | |||
+ | ^Class ^Description ^ | ||
+ | | TInventoryFrame | A custom inventory frame component to manage a inventory system. | | ||
+ | | TInventoryGroup | A inventory grouping component. Use this component to categorize your collected items into groups. | | ||
+ | | TInventoryCollectedItem | A custom collected item component. Use this component as basis for all of your collected items. | | ||
==== Inventory-Designer ==== | ==== Inventory-Designer ==== | ||
Line 328: | Line 377: | ||
The tool provides a sandbox mode, where you can test your item and manufacturer settings directly. | The tool provides a sandbox mode, where you can test your item and manufacturer settings directly. | ||
- | Inventory-Files are also supported in AssetsManager packages, so you add those to your application package without extra file handling. | + | Inventory-Files are also supported in AssetsManager packages. |
+ | |||
+ | Next step: [[dialogues|Dialogues]] |