Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
0.8.3:assetsmanager [2022/04/08 09:31] – [Groups] admin0.8.3:assetsmanager [2022/04/08 14:06] (current) – [Storing your assets package at runtime] admin
Line 38: Line 38:
 | GORILLA_ASSETS_DIALOGUE | 5  | *.dia, *.dlg| | GORILLA_ASSETS_DIALOGUE | 5  | *.dia, *.dlg|
 | GORILLA_ASSETS_INVENTORY| 6 | *.iff | | GORILLA_ASSETS_INVENTORY| 6 | *.iff |
 +| GORILLA_ASSETS_SKILLSYSTEM| 6 | *.ssf |
 | GORILLA_ASSETS_SCRIPT| 7 | *.pas | | GORILLA_ASSETS_SCRIPT| 7 | *.pas |
-| GORILLA_ASSETS_PREFAB| 8 | *.prefab |+| GORILLA_ASSETS_PREFAB| 8 | *.prefab, *.prefabz |
  
 ===== Sub-Groups ===== ===== Sub-Groups =====
Line 124: Line 125:
 ==== TGorillaInventoryAsset ==== ==== TGorillaInventoryAsset ====
 Holds inventory configuration data in a TMemoryStream and writes those as *.iff file to zip-archive. Holds inventory configuration data in a TMemoryStream and writes those as *.iff file to zip-archive.
 +
 +==== TGorillaSkillsAsset ====
 +Holds skill system configuration data in a TMemoryStream and writes those as *.ssf file to zip-archive.
  
 ==== TGorillaScriptAsset ==== ==== TGorillaScriptAsset ====
Line 129: Line 133:
  
 ==== TGorillaPrefabAsset ==== ==== TGorillaPrefabAsset ====
-Holds a prefab file in a TMemoryStream and writes those as *.prefab file to zip-archive.+Holds a prefab file in a TMemoryStream and writes those as *.prefab or *.prefabz file to zip-archive.
  
 ===== DesignTime ===== ===== DesignTime =====
Line 135: Line 139:
  
 In the next step we need to create a new package in "Packages" property by the Delphi collection editor. In the next step we need to create a new package in "Packages" property by the Delphi collection editor.
 +
 +Setting the filename of a package will initiate the IDE to load the package into memory.
 +
 +**WARNING**: relative paths are not recommended, because at designtime you are in the working directory of BDS.exe.
 +
 +To use relative paths on packages, we provide a set of preset values:
 +
 +^Placeholder^Description^
 +|'{HOME}'|Calling System.IOUtils.TPath.GetHomePath()|
 +|'{ASSETS}'|Calling  System.IOUtils.TPath.GetHomePath() + "\assets\"|
 +|'{DOCS}'|Calling System.IOUtils.TPath.GetDocumentsPath()|
 +|'{LIB}'|Calling System.IOUtils.TPath.GetLibraryPath()|
 +|'{PUBLIC}'|Calling System.IOUtils.TPath.GetPublicPath()|
 +|'{DOWNLOADS}'|Calling System.IOUtils.TPath.GetDownloadsPath()|
 +|'{SHARED_DOCS}'|Calling System.IOUtils.TPath.GetSharedDocumentsPath()|
 +|'{SHARED_DOWNLOADS}'|Calling System.IOUtils.TPath.GetSharedDownloadsPath()|
 +
 +**Notice**: Called internal functions of TPath are platform dependent.
 +Please take a look at Embarcadero documentation for further information, f.e. [[https://docwiki.embarcadero.com/Libraries/Sydney/en/System.IOUtils.TPath.GetHomePath]]
 +
 +
 +Set the "Filename" property of a pckage to the following path, to create/load a package on Windows at:
 +
 +//"C:\Documents and Settings\<username>\Application Data\mypackage.zip"//
 +
 +<file pascal>
 +TGorillaAssetsPackage.Filename := '{HOME}mypackage.zip';
 +</file>
  
 ===== Example ===== ===== Example =====
Line 171: Line 203:
 Of course you are allowed to store the assets package you've setup. Of course you are allowed to store the assets package you've setup.
 Easily use the provided SaveToFile method of each package instance. Easily use the provided SaveToFile method of each package instance.
 +
 +//Notice: In case your are working with a file-based package and the destination location is the same, nothing will be stored.
 +If the destination differs from currently loaded package, it will create a copy of the file package.//
 +
 +//Notice: In case you are working with an in-memory package, it will be stored to file, but it stays in memory for further work.
 +If you want to load the stored in-memory package, you have to use the TGorillaAssetsManager.LoadPackageFromFile() method.//
  
 <file pascal Form1.pas> <file pascal Form1.pas>