Skip to content
This repository was archived by the owner on Apr 29, 2025. It is now read-only.

GameModules

exelix edited this page Aug 23, 2018 · 9 revisions

GameModules

GameModules are the hardest plugin to implement, their job is to open and save levels, instantiate new objects and properties. A GameModule to work needs at least three other classes: ILevelObj, ILevel and IObjList implementations. These interfaces are used to excange data with the editor window. This page will offer a limited explaination, it's better to use the Odyssey and other modules as examples

GameModule implementation

Here I'll explain the purpose of each property and function:

  • ModuleName is the module name shown in the credits
  • ModelsFolder should not contain spaces, it's the folder where the extracted models of this extension are saved
  • GetClassConverters Contains a list of Types and TypeConverters to correctly display custom types in the propertygrid
  • ReservedPropNames this is an array of properties (names) the editor won't allow to remove from objects
  • ModelFieldPropNames this is an array of properties (names) that will make the editor reload the model for the current object when changed
  • IsAddListSupported if the editor allows adding new object lists.
  • IsPropertyEditingSupported if the editor allows removing or adding properties
  • ViewForm is a reference to the editor window you should set it in the InitModule function.
  • AutoHideList an array of list names that will automatically set to hidden when loading a level
  • InitModule(...) called as soon as the editor window is initialized up, here you should set the ViewForm property and register MenuExtensions related to your module.
  • FormLoaded() called after the editor window is shown, here you should do your startup checks like setup your base models
  • ParseArgs(string[] Args) the editor form args are handled here
  • LoadLevel(string path = null) and NewLevel(string path = null) open or create a level, if the path is null should show an OpenFileDialog, return your ILevel implementation or null if the user cancelled
  • ``
  • ``

Clone this wiki locally