My program doesn't have bugs. It just develops random features.
Legacy:Solid Snake/CeModuleInfo
ceModuleInfo should never be instanced at all, and is should only ever be a class reference. ceModuleInfo's purpose is to store data, about a module. At this moment, all I have written is the main GUI extensions. Eventually ceModuleInfo will be one of the largest data classes in Chaos Engine since the module info is where almost all data about the module is stored. This class is constantly changing, so some functions can be taken with a grain of salt at the moment.
Contents
Structs
s_DoubleString
- Data[2] (String)
- Nothing too special with this struct.
s_GUIDrawStyle
- ImageMaterial (Material)
- Image reference to draw.
- ImageColor (Color)
- Color of the image to draw.
- ImageRenderStyle (EMenuRenderStyle)
- This sets the Canvas.Style value.
- ImageDrawStyle (eImgStyle)
- This alters the Canvas drawing technique when drawing the material.
- ImagePadding (FloatBox)
- This post modifies both the position and size of the element. It first modifies the left and top position of the element through (Left = Left + x1) and (Top = Top + y1). The width and height are then calculated by (Width = Width + (-X1 + X2)) and (Height = Height + (-Y1 + Y2)). Having negative numbers in X1 and Y1 would shift the element left and upwards, while having positive numbers would shift the element right and downwards. Remember that X2 and Y2 are influenced by X1 and Y1. X2 and Y2 modify the final position of the bottom hand corner of the element much in the same way as X1 and Y1, and not really the width and the height.
This struct is used to define the draw elements that go on the canvas. They were mainly used for the GUI, but they could just as easily be used for defining other elements on the canvas.
Module Variables
- ModulePrefix (String)
- This stores the prefix of the module. At this stage, you must make sure that your module prefix differs from any other module that is created, otherwise data objects, config objects and the other forms of using prefix can get mixed up. I am currently thinking of also adding a database which keeps track of user submitted module names. Prefixes aren't usually used for messages or anything else other than a unique data identification method. (In future this may change to a int instead).
- ModuleName (string)
- This is the module name that appears in GUI's and other places. This doesn't have to be unique at all, since it is just the visual text representation of your mod.
- ModuleDescription (string)
- This is the description of your module that appears in GUI's. You can use things like '|' to break out lines and other things. I full description on this will be defined a little later on when I write them. (Other string based functions would be things like colored text).
- ModuleVersion (float)
- This is a version number you can use for identification purposes.
GUI Interface Variables
- DesktopBackground (Material)
- This is the material used as the background in the desktop. In future, this may change to a GUIComponent string reference to allow for more complex background as well as interactive backgrounds.
GUI Interface styles are essentially where you define how you wish the entire GUI Interface to look like. This is essentially a modifiable form of GUIStyles, except that I have extended the function to allow out sourcing of data. Styles often have static arrays consisting of five members. The five members represent the state of each component style, since it is often used in the form of GetStyle().default.StyleArray[MenuState]. The menu state is parsed automatically for you, and it is just an int representation of the enum eMenuState found in GUI.uc, eMenuState.
- CloseButtonStyle[5] (s_GUIDrawStyle)
- Style on the close button used on the windows head bar.
- ComboButtonStyle[5] (s_GUIDrawStyle)
- Style of the button used on drop down boxes.
- ComboListBoxStyle[5] (s_GUIDrawStyle)
- Style of the list box used on drop down boxes.
- EditBoxStyle[5] (s_GUIDrawStyle)
- Style of the edit (the ones used to type in text) boxes.
- HeaderStyle[5] (s_GUIDrawStyle)
- Style of the head bar of windows.
- MenuBarStyle[5] (s_GUIDrawStyle)
- Style of the desktop start bar.
- MouseOverLabelStyle[5] (s_GUIDrawStyle)
- Style of the mouse over label (When you hover the mouse over an item, a brief description comes up. This style adjusts the box the text is in).
- ScrollZoneStyle[5] (s_GUIDrawStyle)
- Style of the scroll bar zone.
- SquareMenuButtonStyle[5] (s_GUIDrawStyle)
- Style of the generic buttons.
- TabBackgroundStyle[5] (s_GUIDrawStyle)
- Style of the background of most tabbed windows.
- VertDownButtonStyle[5] (s_GUIDrawStyle)
- Style of the vertical down button used in scroll bars.
- VertGripStyle[5] (s_GUIDrawStyle)
- Style of the middle button used in scroll bars.
- VertUpButtonStyle[5] (s_GUIDrawStyle)
- Style of the vertical up button used in scroll bars.
- FloatingWindowStyle (s_GUIDrawStyle)
- Style of the window frame used in each window.
Console interface Variables
The console is used to draw other GUI type elements on the canvas without the use of the main GUI code.
- InventoryBoxBackground (Material)
- This is the material used as the background to draw the inventory selection box.
- InventoryBoxEmptyBackground (Material)
- This is the material used as the background to draw the inventory selection box, when there is no inventory in the box.
Other Variables
- GUIStyleData (array<s_DoubleString>)
- This stores an array of all the styles. GUIStyles are no longer created as a stack and then linked to. Each GUIComponent now has its own GUIStyles. The rationale behind this was to allow for individual rendering alterations to be written in ceModuleInfo rather than having to write new a GUIComponent. I have not noticed a dramatic decrease in speed due to this method as of yet. The format for this is, Data[0]="StyleName",Data[1]="GUIStyle Class". e.g. Data[0]="SquareButton",Data[1]="ceInterface.ceSTYSquareButton"
Functions
- PreDrawComponent (Canvas Canvas, GUIStyles GUIStyle, GUI.eMenuState MenuState, float Left, float Top, float Width, float Height, float ActualLeft, float ActualTop, float ActualWidth, float ActualHeight, float DeltaTime) Static
- This function is called just before the actual component is drawn (called from ceGUIStyles). This allows you to draw elements onto the canvas before the component itself is drawn. So drawing elements behind the component is achieved from here.
- Canvas (Canvas)
-
- Canvas reference.
- GUIStyle (GUIStyles)
- This is an object reference to the ceGUIStyles that drew it. Because ceGUIStyles is within ceInterface which is compiled after ceEngine (ceModuleInfo resides within ceEngine), you must parse to ceGUIStyles if you wish to use any functions (ceGUIStyles are instanced) from within those instances. All GUIComponent objects now have their own GUIStyle object attached to them, so identification of GUIComponent can't be done directly, but rather indirectly through identifying the GUIStyle that is parsed here.
- MenuState (GUI)
- This is the enum used to identify what state the component is in. This can be used to draw different predraw states if say the mouse was over the component, the mouse was clicking on the component etc.
- Left (Float)
- This is the left location of the GUIComponent that was originally sent to the component.
- Top (Float)
- This is the top location of the GUIComponent that was originally sent to the component.
- Width (Float)
- This is the width of the GUIComponent that was originally sent to the component.
- Height (Float)
- This is the height of the GUIComponent that was originally sent to the component.
- ActualLeft (Float)
- This is the actual left location of the GUIComponent after it was modified by ceGUIStyles. The modification comes from Left + ImagePadding.X1.
- ActualTop (Float)
- This is the actual top location of the GUIComponent, after it was modified by ceGUIStyles. The modification comes from Top + ImagePadding.Y1.
- ActualWidth (Float)
- This is the actual width of the GUIComponent, after it was modified by ceGUIStyles. The modification comes from Width + (-ImagePadding.X1 + ImagePadding.X2).
- ActualHeight (Float)
- This is the actual height of the GUIComponent, after it was modified by ceGUIStyles. The modification comes from Height + (-ImagePadding.Y1 + ImagePadding.Y2).
- DeltaTime (Float)
- This is the float value of the delta time parsed from Controller.RenderDelta. This can be used for timing type modifications if desired.
- PostDrawComponent (Canvas Canvas, GUIStyles GUIStyle, GUI.eMenuState MenuState, float Left, float Top, float Width, float Height, float ActualLeft, float ActualTop, float ActualWidth, float ActualHeight, float DeltaTime) Static
- This function is the same as the above, but its called after the GUIComponent has been drawn, and is used primarily for any post rendering effects as such.
- PreDrawInventoryBox (Canvas C, Inventory Inv, int PosX, int PosY, float Width, float Height, bool bSelected) Static
- This function is called before the actual drawing of the inventory box element for pre rendering effects.
- C (Canvas)
-
- This is a canvas instance reference.
- Inv (Inventory)
- This is the inventory instance reference.
- PosX (int)
- This is the left position of the inventory box element.
- PosY (int)
- This is the top position of the inventory box element.
- Width (float)
- This is the width of the inventory box element.
- Height (float)
- This is the height of the inventory box element.
- bSelected (bool)
- This is a boolean which indicates if this inventory box element is the one currently selected.
- DrawInventoryBox (Canvas C, Inventory Inv, int PosX, int PosY, float Width, float Height, bool bSelected) Static
- Same as above, but this is called on the actual drawing of the inventory box element.
- PostDrawInventoryBox (Canvas C, Inventory Inv, int PosX, int PosY, float Width, float Height, bool bSelected) Static
- Same as above, but this is called after the actual drawing of the inventory box element for post rendering effects.