From 2f5c71d747f338b0eef5e6f4c9486472df5814f9 Mon Sep 17 00:00:00 2001 From: MahBoiDeveloper Date: Mon, 30 Sep 2024 11:26:07 +0300 Subject: [PATCH 01/15] Replace **note** with [!NOTE] --- Docs/DiscordRichPresence.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Docs/DiscordRichPresence.md b/Docs/DiscordRichPresence.md index 166a558e2..f6273c8fa 100644 --- a/Docs/DiscordRichPresence.md +++ b/Docs/DiscordRichPresence.md @@ -13,7 +13,7 @@ XNA client supports showing DRP information customized to your mod/game, provide How to set up DRP for your mod/game ----------------------------------- -> **Note** +> [!NOTE] > You are required to be logged in a Discord account. 1. Go to [Discord developers portal](https://discord.com/developers/applications). @@ -31,5 +31,5 @@ How to set up DRP for your mod/game After you upload the images, click the `Save Changes` button. ![ASSETS](Images/drp-assets.png) -> **Note** +> [!NOTE] > It may take some time before Discord updates your application info or assets. If you change the assets and app info while running the client - try restarting the Discord and/or client if they don't apply right away. From 296c035da15ea04fa961b97dee6c5edbc8dc5314 Mon Sep 17 00:00:00 2001 From: MahBoiDeveloper Date: Mon, 30 Sep 2024 11:30:12 +0300 Subject: [PATCH 02/15] Replace notes and warnings in Translation.md --- Docs/Translation.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Docs/Translation.md b/Docs/Translation.md index 88b096517..bc49a35c7 100644 --- a/Docs/Translation.md +++ b/Docs/Translation.md @@ -45,12 +45,12 @@ For example: The translation folder name is used to match it to the system locale code (as defined by BCP-47), so it is advised to name the translation folders according to that (for example, see how [the locales Windows uses](https://learn.microsoft.com/ru-ru/openspecs/windows_protocols/ms-lcid/a9eac961-e77d-41a6-90a5-ce1a8b0cdb9c) are coded). That allows the client to choose the appropriate translation based on the system locale and also automatically fetch the name of the translation. -> **Note** +> [!NOTE] > Unless you're aiming for making a translation for a specific country (e.g. `en-US` and `en-GB`), it's advised to use simply a [language code](http://www.loc.gov/standards/iso639-2/php/code_list.php) (for example, `ru`, `de`, `en`, `zh-Hans`, `zh-Hant` etc.) The folder name doesn't explicitly need to match the existing locale code. However, in that case you would want to provide an explicit name in the translation INI, and the translation won't be automatically picked in any case. -> **Note** +> [!NOTE] > The hardcoded client strings can be overridden using an `en` translation. Because the built-in `en` strings are always available, so it English client language. Even if the client doesn't have any translations, English will still be picked by default. If for some reason you need to override hardcoded strings in your client distribution, you can create a `Resources/Translations/en/Translation.ini` file and override needed values there. ### Translation INI format @@ -112,7 +112,7 @@ Each key in the `[Values]` section is composed of a few elements, joined using ` - `ClientDefinitions` - self explanatory. - `WindowTitle` - self explanatory, only works if set in `ClientDefinitions.ini` -> **Warning** +> [!WARNING] > You can only translate an INI value if it was used in the INI in the first place! That means that defining a translated value for a control's attribute (example: translating `X` and `Y` when `Location` is defined) that is not present in the INI **will not have any effect**. ## Ingame translation setup @@ -122,7 +122,7 @@ The translation system's ingame translation support requires the mod/game author 2) the destination to copy to, relative to the game root folder; 3) (optional) `checked` for the file to be checked by file integrity checks (should be on if this file can be used to cheat), if not specified - this file is not checked. -> **Warning** +> [!WARNING] > If you include checked files in your ingame translation files, that means users won't be able to do custom translations if they include those files and you won't be able to use custom components with those files **without triggering the modified files / cheater warning**. This mechanism is made for those games and mods where it's impossible to provide a mechanism to provide translations in a cheat-safe way, so please use it only if you have no other choice, otherwise don't specify this parameter. Example configuration in `ClientDefinitions.ini`: @@ -137,7 +137,7 @@ GameFile_DLL_HD=Resources/language_1024x720.dll,Resources/language_1024x720.dll This will make the `translation.mix` file from current translation folder (say, `Resources/Translations/ru`) copied to game root as `expandmo98.mix` on game start. -> **Warning** +> [!WARNING] > This feature is needed only for *game* files, not *client* files like INIs, theme assets etc.! ## Suggested translation workflow From 3476adbaa7709f3f60fb3ebec8dc979164db7142 Mon Sep 17 00:00:00 2001 From: MahBoiDeveloper Date: Sun, 24 Nov 2024 19:59:46 +0300 Subject: [PATCH 03/15] Replace `**Note**` to `[!NOTE]` in `INISystem.md` --- Docs/INISystem.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docs/INISystem.md b/Docs/INISystem.md index f833e4c9b..478a27bb8 100644 --- a/Docs/INISystem.md +++ b/Docs/INISystem.md @@ -25,7 +25,7 @@ _NOTE: Constants can only be used in [dynamic control properties](#dynamic-contr ## Control properties Below lists basic and dynamic control properties. Ordering of properties is important. If there is a property that relies on the size of a control, the properties must set the size of that control first. -> **Note** +> [!NOTE] > Multi-line strings use `@` as a line break. To write the real `@` character, use `\@`. Also as INI syntax uses `;` to denote comments, use `\semicolon` to write the real `;` character. ### Basic Control Properties From 4870e5c858133e2938a11482bcadb617a1945c9a Mon Sep 17 00:00:00 2001 From: MahBoiDeveloper Date: Mon, 25 Nov 2024 01:25:36 +0300 Subject: [PATCH 04/15] Add info about `XNAControl`, `XNAPanel`, `XNAExtraPanel` --- Docs/INISystem.md | 92 +++++++++++++++++++++++++---------------------- 1 file changed, 49 insertions(+), 43 deletions(-) diff --git a/Docs/INISystem.md b/Docs/INISystem.md index 478a27bb8..d575a869d 100644 --- a/Docs/INISystem.md +++ b/Docs/INISystem.md @@ -1,5 +1,6 @@ # Instructions on how to construct the UI using INI files. -*TODO work in progress* +> [!NOTE] +> _TODO work in progress_ ## Constants @@ -12,62 +13,66 @@ The `[ParserConstants]` section of the `GlobalThemeSettings.ini` file contains c ### User Defined Constants -``` +```ini MY_EXAMPLE_CONSTANT=15 ``` The above user-defined or system constants can be used elsewhere as: -``` +```ini [MyExampleControl] $X=MY_EXAMPLE_CONSTANT ``` _NOTE: Constants can only be used in [dynamic control properties](#dynamic-control-properties)_ +### Data Types +- Multi-line strings use `@` as a line break. To write the real `@` character, use `\@`. Also as INI syntax uses `;` to denote comments, use `\semicolon` to write the real `;` character. +- Color string use form `R,G,B` or `R,G,B,A`. All values must be between 0 and 255. +- Boolean parses as `true` if string value contains one of these symbol as first character: `t`, `y`, `1`, `a`, `e`; and if first symbol is `n`, `f`, `0` then it parses as `false`. +- Integer type is actually `System.Int32`. + ## Control properties Below lists basic and dynamic control properties. Ordering of properties is important. If there is a property that relies on the size of a control, the properties must set the size of that control first. -> [!NOTE] -> Multi-line strings use `@` as a line break. To write the real `@` character, use `\@`. Also as INI syntax uses `;` to denote comments, use `\semicolon` to write the real `;` character. - ### Basic Control Properties Basic control properties cannot use constants. -#### XNAControl +#### [XNAControl](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAControl.cs) -`X` = `{integer}` the X location of the control -`Y` = `{integer}` the Y location of the control +`X` = `{integer}` the X location of the control. +`Y` = `{integer}` the Y location of the control. `Location` = `{comma separated integers}` the X and Y location of the control. -`Width` = `{integer}` the Width of the control -`Height` = `{integer}` the Height of the control +`Width` = `{integer}` the Width of the control. +`Height` = `{integer}` the Height of the control. `Size` = `{comma separated integers}` the Width and Height of the control. -`Text` = `{multi-line string}` the text to display for the control (ex: buttons, labels, etc...) -`Visible` = `{true/false or yes/no}` whether or not the control should be visible by default -`Enabled` = `{true/false or yes/no}` whether or not the control should be enabled by default +`Text` = `{multi-line string}` the text to display for the control (ex: buttons, labels, etc...). +`Visible` = `{true/false or yes/no}` whether or not the control should be visible by default. +`Enabled` = `{true/false or yes/no}` whether or not the control should be enabled by default. `DistanceFromRightBorder` = `{integer}` the distance of the right edge of this control from the right edge of its parent. This control MUST have a parent. `DistanceFromBottomBorder` = `{integer}` the distance of the bottom edge of this control from the bottom edge of its parent. This control MUST have a parent. -`FillWidth` = `{integer}` this will set the width of this control to fill the parent/window MINUS this value, starting from the its X position -`FillHeight` = `{integer}` this will set the height of this control to fill the parent/window MINUS this value, starting from the its Y position -`DrawOrder` -`UpdateOrder` -`RemapColor` +`FillWidth` = `{integer}` this will set the width of this control to fill the parent/window MINUS this value, starting from the its X position. +`FillHeight` = `{integer}` this will set the height of this control to fill the parent/window MINUS this value, starting from the its Y position. +`DrawOrder` = `{integer}` determine the layering order of the control within its parent control's list of child controls. +`UpdateOrder` = `{integer}` determine the layering order of the control within its parent control's list of child controls. +`RemapColor` = `{color string}` this will set a theme defined color based. +`ControlDrawMode` = `{string}` this will set render option to draw control on its own render target (`UniqueRenderTarget`) or to draw control on the same render target with its parent (`Normal`). -#### XNAPanel -_(inherits XNAControl)_ +#### [XNAPanel](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAPanel.cs) +_(inherits [XNAControl](#XNAControl))_ -`BorderColor` -`DrawMode` -`AlphaRate` -`BackgroundTexture` -`SolidColorBackgroundTexture` -`DrawBorders` -`Padding` +`BorderColor` = `{color string}` this will set a border color based on a string in the form `R,G,B` or `R,G,B,A`. All values must be between 0 and 255. +`DrawMode` = `{string}` this will set draw mode for panel. Allowed values: `Tiled`, `Centered`, `Stretched` (default option). +`AlphaRate` = `{float}` the panel's transparency changing rate per 100 milliseconds. If the panel is transparent, it'll become non-transparent at this rate. Default value is `0.01`. +`BackgroundTexture` = `{string}` loads a texture with the specific name. If the texture isn't found from any asset search path, returns a dummy texture. +`SolidColorBackgroundTexture` = `{color string}` this will set background color stretched texture instead of user defined picture. +`DrawBorders` = `{boolean}` enables or disables borders drawing for control. Borders enabled by default. +`Padding` = `{comma separated integers}` css-like `1,2,3,4` panel padding in client window (1 - left, 2 - top, 3 - right, 4 - bottom). -#### XNAExtraPanel -_(inherits XNAPanel)_ +#### [XNAExtraPanel](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNAExtraPanel.cs) +_(inherits [XNAPanel](#XNAPanel))_ -`BackgroundTexture` +`BackgroundTexture` = `{string}` same as [XNAPanel](#XNAControl) `BackgroundTexture`. If this key exists, `XNAExtraPanel` parse ignore others. #### XNALabel -_(inherits XNAControl)_ +_(inherits [XNAControl](#XNAControl))_ `RemapColor` `TextColor` @@ -77,7 +82,7 @@ _(inherits XNAControl)_ `TextShadowDistance` #### XNAButton -_(inherits XNAControl)_ +_(inherits [XNAControl](#XNAControl))_ `TextColorIdle` `TextColorHover` @@ -103,7 +108,7 @@ _(inherits XNAClientButton)_ `ToolTip` = `{multi-line string}` tooltip for checkbox #### XNACheckbox -_(inherits XNAControl)_ +_(inherits [XNAControl](#XNAControl))_ `FontIndex` `IdleColor` @@ -118,7 +123,7 @@ _(inherits XNACheckBox)_ `ToolTip` = `{multi-line string}` tooltip for checkbox #### XNADropDown -_(inherits XNAControl)_ +_(inherits [XNAControl](#XNAControl))_ `OpenUp` `DropDownTexture` @@ -138,7 +143,7 @@ _(inherits XNADropDown)_ `ToolTip` = `{multi-line string}` tooltip for checkbox #### XNATabControl -_(inherits XNAControl)_ +_(inherits [XNAControl](#XNAControl))_ `RemapColor` `TextColor` @@ -146,14 +151,15 @@ _(inherits XNAControl)_ `RemoveTabIndexN` #### XNATextBox -_(inherits XNAControl)_ +_(inherits [XNAControl](#XNAControl))_ `MaximumTextLength` ### Basic Control Property Examples -``` +```ini X=100 Y=100 +Text=Text Sample Location=100,100 Width=100 Height=100 @@ -237,14 +243,14 @@ Dynamic Control Properties CAN use constants These can ONLY be used in parent controls that inherit the `INItializableWindow` class -`$X` = ``{integer}`` the X location of the control -`$Y` = ``{integer}`` the Y location of the control -`$Width` = ``{integer}`` the Width of the control -`$Height` = ``{integer}`` the Height of the control +`$X` = `{integer}` the X location of the control +`$Y` = `{integer}` the Y location of the control +`$Width` = `{integer}` the Width of the control +`$Height` = `{integer}` the Height of the control `$TextAnchor` ### Dynamic Control Property Examples -``` +```ini $X=100 $X=MY_X_CONSTANT $Y=100 From 097da7889099432feec564b58774d92241c8ba10 Mon Sep 17 00:00:00 2001 From: MahBoiDeveloper Date: Mon, 25 Nov 2024 15:16:22 +0300 Subject: [PATCH 05/15] Add info about `XNAButton`, `XNALinkButton`, `XNALabel` Co-authored-by: Vodrix --- Docs/INISystem.md | 81 ++++++++++++++++++++++++----------------------- 1 file changed, 42 insertions(+), 39 deletions(-) diff --git a/Docs/INISystem.md b/Docs/INISystem.md index d575a869d..1dee8d959 100644 --- a/Docs/INISystem.md +++ b/Docs/INISystem.md @@ -24,10 +24,12 @@ $X=MY_EXAMPLE_CONSTANT _NOTE: Constants can only be used in [dynamic control properties](#dynamic-control-properties)_ ### Data Types -- Multi-line strings use `@` as a line break. To write the real `@` character, use `\@`. Also as INI syntax uses `;` to denote comments, use `\semicolon` to write the real `;` character. -- Color string use form `R,G,B` or `R,G,B,A`. All values must be between 0 and 255. -- Boolean parses as `true` if string value contains one of these symbol as first character: `t`, `y`, `1`, `a`, `e`; and if first symbol is `n`, `f`, `0` then it parses as `false`. -- Integer type is actually `System.Int32`. +- The `multi-line string`s use `@` as a line break. To write the real `@` character, use `\@`. Also as INI syntax uses `;` to denote comments, use `\semicolon` to write the real `;` character. +- The `color string` use form `R,G,B` or `R,G,B,A`. All values must be between `0` and `255`. +- The `boolean` string value parses as `true` if it contains one of these symbol as first character: `t`, `y`, `1`, `a`, `e`; and if first symbol is `n`, `f`, `0`, then it parses as `false`. +- The `integer` type is actually `System.Int32`. +- The `comma separated integers` or `comma separated floats` is a `integer` or `float` type, but separated with `,` character without spaces, e.g. `0.0,0.0` +- The `float` type is actually `System.Single`. ## Control properties Below lists basic and dynamic control properties. Ordering of properties is important. If there is a property that relies on the size of a control, the properties must set the size of that control first. @@ -44,8 +46,8 @@ Basic control properties cannot use constants. `Height` = `{integer}` the Height of the control. `Size` = `{comma separated integers}` the Width and Height of the control. `Text` = `{multi-line string}` the text to display for the control (ex: buttons, labels, etc...). -`Visible` = `{true/false or yes/no}` whether or not the control should be visible by default. -`Enabled` = `{true/false or yes/no}` whether or not the control should be enabled by default. +`Visible` = `{boolean}` whether or not the control should be visible by default. +`Enabled` = `{boolean}` whether or not the control should be enabled by default. `DistanceFromRightBorder` = `{integer}` the distance of the right edge of this control from the right edge of its parent. This control MUST have a parent. `DistanceFromBottomBorder` = `{integer}` the distance of the bottom edge of this control from the bottom edge of its parent. This control MUST have a parent. `FillWidth` = `{integer}` this will set the width of this control to fill the parent/window MINUS this value, starting from the its X position. @@ -61,51 +63,52 @@ _(inherits [XNAControl](#XNAControl))_ `BorderColor` = `{color string}` this will set a border color based on a string in the form `R,G,B` or `R,G,B,A`. All values must be between 0 and 255. `DrawMode` = `{string}` this will set draw mode for panel. Allowed values: `Tiled`, `Centered`, `Stretched` (default option). `AlphaRate` = `{float}` the panel's transparency changing rate per 100 milliseconds. If the panel is transparent, it'll become non-transparent at this rate. Default value is `0.01`. -`BackgroundTexture` = `{string}` loads a texture with the specific name. If the texture isn't found from any asset search path, returns a dummy texture. +`BackgroundTexture` = `{string}` loads a texture with the specific file name with suffix. If the texture isn't found from any asset search path, returns a dummy texture. `SolidColorBackgroundTexture` = `{color string}` this will set background color stretched texture instead of user defined picture. `DrawBorders` = `{boolean}` enables or disables borders drawing for control. Borders enabled by default. -`Padding` = `{comma separated integers}` css-like `1,2,3,4` panel padding in client window (1 - left, 2 - top, 3 - right, 4 - bottom). +`Padding` = `{comma separated integers}` css-like panel padding in client window, i.e. `1,2,3,4` where `1` - left, `2` - top, `3` - right, `4` - bottom. #### [XNAExtraPanel](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNAExtraPanel.cs) _(inherits [XNAPanel](#XNAPanel))_ -`BackgroundTexture` = `{string}` same as [XNAPanel](#XNAControl) `BackgroundTexture`. If this key exists, `XNAExtraPanel` parse ignore others. +`BackgroundTexture` = `{string}` same as [XNAPanel](#XNAControl)'s `BackgroundTexture`. If this key exists, `XNAExtraPanel` parse ignore others. -#### XNALabel +#### [XNALabel](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAButton.cs) _(inherits [XNAControl](#XNAControl))_ -`RemapColor` -`TextColor` -`FontIndex` -`AnchorPoint` -`TextAnchor` -`TextShadowDistance` +`RemapColor` = `{color string}` same as [XNAControl](#XNAControl)'s `RemapColor`. +`TextColor` = `{color string}` determine color of the text in label. +`FontIndex` = `{integer}` the index of loaded from font list. Default value is `0`. +`AnchorPoint` = `{comma separated floats}` this will set a label's text start drawing point. Default value is `0.0,0.0` +`TextAnchor` = `{string}` this will set a text anchor in label draw box. Available values are `NONE`, `LEFT`, `RIGHT`, `HORIZONTAL_CENTER`, `TOP`, `BOTTOM`, `VERTICAL_CENTER` +`TextShadowDistance` = `{float}` the distance between text and its shadow. -#### XNAButton +#### [XNAButton](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAButton.cs) _(inherits [XNAControl](#XNAControl))_ -`TextColorIdle` -`TextColorHover` -`HoverSoundEffect` -`ClickSoundEffect` -`AdaptiveText` -`AlphaRate` -`FontIndex` -`IdleTexture` -`HoverTexture` -`TextShadowDistance` - -#### XNAClientButton -_(inherits XNAButton)_ - -`MatchTextureSize` - -#### XNALinkButton -_(inherits XNAClientButton)_ - -`URL` -`UnixURL` -`ToolTip` = `{multi-line string}` tooltip for checkbox +`TextColorIdle` = `{color string}` the text color when cursor isn't above the button. +`TextColorHover` = `{color string}` the text color when cursor above the button. +`HoverSoundEffect` = `{string}` loads a sound with the specific file name with suffix as button hover sound. +`ClickSoundEffect` = `{string}` loads a sound with the specific file name with suffix as button click sound. +`AdaptiveText` = `{boolean}` specifies how the client should change the start text drawing position in the button to fill all the free space. Default value is `true`. +`AlphaRate` = `{float}` the button's transparency changing rate per 100 milliseconds. If the panel is transparent, it'll become non-transparent at this rate. Default value is `0.01`. +`FontIndex` = `{integer}` the index of loaded from font list. Default value is `0`. +`IdleTexture` = `{string}` loads a texture with the specific file name with suffix as button idle texture. +`HoverTexture` = `{string}` loads a texture with the specific file name with suffix as button hover texture. +`TextShadowDistance` = `{float}` the distance between text and its shadow. + +#### [XNAClientButton](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNAClientButton.cs) +_(inherits [XNAButton](#XNAButton))_ + +`MatchTextureSize` = `{boolean}` +`ToolTip` = `{multi-line string}` + +#### [XNALinkButton](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNALinkButton.cs) +_(inherits [XNAClientButton](#XNAClientButton))_ + +`URL` = `{string}` the URL-link for OS Windows +`UnixURL` = `{string}` the URL-link for Unix-like OS +`Arguments` = `{string}` the arguments separated with space for URL-link #### XNACheckbox _(inherits [XNAControl](#XNAControl))_ From aae1e57b764480f5b4ce5200e41f3406b52d9151 Mon Sep 17 00:00:00 2001 From: MahBoiDeveloper Date: Mon, 25 Nov 2024 19:19:05 +0300 Subject: [PATCH 06/15] Add info about absent classes --- Docs/INISystem.md | 144 ++++++++++++++++++++++++++++------------------ 1 file changed, 87 insertions(+), 57 deletions(-) diff --git a/Docs/INISystem.md b/Docs/INISystem.md index 1dee8d959..ae2952875 100644 --- a/Docs/INISystem.md +++ b/Docs/INISystem.md @@ -28,8 +28,8 @@ _NOTE: Constants can only be used in [dynamic control properties](#dynamic-contr - The `color string` use form `R,G,B` or `R,G,B,A`. All values must be between `0` and `255`. - The `boolean` string value parses as `true` if it contains one of these symbol as first character: `t`, `y`, `1`, `a`, `e`; and if first symbol is `n`, `f`, `0`, then it parses as `false`. - The `integer` type is actually `System.Int32`. -- The `comma separated integers` or `comma separated floats` is a `integer` or `float` type, but separated with `,` character without spaces, e.g. `0.0,0.0` - The `float` type is actually `System.Single`. +- The `comma separated integers` or `comma separated floats` is a `integer` or `float` type, but separated with `,` character without spaces, e.g. `0.0,0.0` ## Control properties Below lists basic and dynamic control properties. Ordering of properties is important. If there is a property that relies on the size of a control, the properties must set the size of that control first. @@ -57,10 +57,16 @@ Basic control properties cannot use constants. `RemapColor` = `{color string}` this will set a theme defined color based. `ControlDrawMode` = `{string}` this will set render option to draw control on its own render target (`UniqueRenderTarget`) or to draw control on the same render target with its parent (`Normal`). +#### [XNAIndicator](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAIndicator.cs) +_(inherits [XNAControl](#XNAControl))_ +`FontIndex` = `{integer}` the index of font loaded from font list. Default value is `0`. +`HighlightColor` = `{color string}` the text color when cursor above the `XNAIndicator`. +`AlphaRate` = `{float}` the indicator's transparency changing rate per 100 milliseconds. If the indicator is transparent, it'll become non-transparent at this rate. Default value is `0.01`. + #### [XNAPanel](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAPanel.cs) _(inherits [XNAControl](#XNAControl))_ -`BorderColor` = `{color string}` this will set a border color based on a string in the form `R,G,B` or `R,G,B,A`. All values must be between 0 and 255. +`BorderColor` = `{color string}` this will set a border color based. `DrawMode` = `{string}` this will set draw mode for panel. Allowed values: `Tiled`, `Centered`, `Stretched` (default option). `AlphaRate` = `{float}` the panel's transparency changing rate per 100 milliseconds. If the panel is transparent, it'll become non-transparent at this rate. Default value is `0.01`. `BackgroundTexture` = `{string}` loads a texture with the specific file name with suffix. If the texture isn't found from any asset search path, returns a dummy texture. @@ -71,14 +77,33 @@ _(inherits [XNAControl](#XNAControl))_ #### [XNAExtraPanel](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNAExtraPanel.cs) _(inherits [XNAPanel](#XNAPanel))_ -`BackgroundTexture` = `{string}` same as [XNAPanel](#XNAControl)'s `BackgroundTexture`. If this key exists, `XNAExtraPanel` parse ignore others. +`BackgroundTexture` = `{string}` same as [XNAPanel](#XNAControl)'s `BackgroundTexture`. + +#### [XNATextBlock](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNATextBlock.cs) +_(inherits [XNAPanel](#XNAPanel))_ +`TextColor` = `{color string}` defines text color for text block. + +#### [XNAMultiColumnListBox](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAMultiColumnListBox.cs) +_(inherits [XNAPanel](#XNAPanel))_ +`FontIndex` = `{integer}` the index of font loaded from font list. Default value is `0`. +`DrawSelectionUnderScrollbar` = `{boolean}`. Default value is `true`. +`ColumnWidthN` = `{integer}` the default columns width in pixels. `N` is integer column index. +`ColumnX` = `{string}:{intgerer}` the column definition. `{string}` is a column header text. `{integer}` is a column width in pixels. `X` is an any text. +`ListBoxYAttribute:Attrname` = `{string}` allows setting list box attributes. `Attrname` is column attribute. + +#### [XNATrackbar](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNATrackbar.cs) +_(inherits [XNAPanel](#XNAPanel))_ +`MinValue` = `{integer}` the minumum value available for `XNATrackbar`. Default value is `0`. +`MaxValue` = `{integer}` the maximum value available for `XNATrackbar`. Default value is `10`. +`Value` = `{integer}` the default value available for `XNATrackbar`. Default value is `0`. +`ClickSound` = `{string}` loads a sound with the specific file name with suffix as `XNATrackbar` click sound. #### [XNALabel](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAButton.cs) _(inherits [XNAControl](#XNAControl))_ `RemapColor` = `{color string}` same as [XNAControl](#XNAControl)'s `RemapColor`. `TextColor` = `{color string}` determine color of the text in label. -`FontIndex` = `{integer}` the index of loaded from font list. Default value is `0`. +`FontIndex` = `{integer}` the index of font loaded from font list. Default value is `0`. `AnchorPoint` = `{comma separated floats}` this will set a label's text start drawing point. Default value is `0.0,0.0` `TextAnchor` = `{string}` this will set a text anchor in label draw box. Available values are `NONE`, `LEFT`, `RIGHT`, `HORIZONTAL_CENTER`, `TOP`, `BOTTOM`, `VERTICAL_CENTER` `TextShadowDistance` = `{float}` the distance between text and its shadow. @@ -91,7 +116,7 @@ _(inherits [XNAControl](#XNAControl))_ `HoverSoundEffect` = `{string}` loads a sound with the specific file name with suffix as button hover sound. `ClickSoundEffect` = `{string}` loads a sound with the specific file name with suffix as button click sound. `AdaptiveText` = `{boolean}` specifies how the client should change the start text drawing position in the button to fill all the free space. Default value is `true`. -`AlphaRate` = `{float}` the button's transparency changing rate per 100 milliseconds. If the panel is transparent, it'll become non-transparent at this rate. Default value is `0.01`. +`AlphaRate` = `{float}` the button's transparency changing rate per 100 milliseconds. If the button is transparent, it'll become non-transparent at this rate. Default value is `0.01`. `FontIndex` = `{integer}` the index of loaded from font list. Default value is `0`. `IdleTexture` = `{string}` loads a texture with the specific file name with suffix as button idle texture. `HoverTexture` = `{string}` loads a texture with the specific file name with suffix as button hover texture. @@ -100,66 +125,72 @@ _(inherits [XNAControl](#XNAControl))_ #### [XNAClientButton](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNAClientButton.cs) _(inherits [XNAButton](#XNAButton))_ -`MatchTextureSize` = `{boolean}` -`ToolTip` = `{multi-line string}` +`MatchTextureSize` = `{boolean}` the button's width and height will match its texture properties. Default value is `false`. +`ToolTip` = `{multi-line string}` the tooltip for button. #### [XNALinkButton](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNALinkButton.cs) _(inherits [XNAClientButton](#XNAClientButton))_ -`URL` = `{string}` the URL-link for OS Windows -`UnixURL` = `{string}` the URL-link for Unix-like OS -`Arguments` = `{string}` the arguments separated with space for URL-link +`URL` = `{string}` the URL-link for OS Windows. +`UnixURL` = `{string}` the URL-link for Unix-like OS. +`Arguments` = `{string}` the arguments separated with space for URL-link. -#### XNACheckbox +#### [XNACheckbox](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNACheckBox.cs) _(inherits [XNAControl](#XNAControl))_ -`FontIndex` -`IdleColor` -`HighlightColor` -`AlphaRate` -`AllowChecking` -`Checked` +`FontIndex` = `{integer}` the index of font loaded from font list. Default value is `0`. +`IdleColor` = `{color string}` the the text color when cursor isn't above the checkbox. +`HighlightColor` = `{color string}` the text color when cursor above the checkbox. +`AlphaRate` = `{float}` the checkbox's transparency changing rate per 100 milliseconds. If the checkbox is transparent, it'll become non-transparent at this rate. Default value is `0.01`. +`AllowChecking` = `{boolean}` the allows user to check/uncheck checkbox. Default value is `true`. +`Checked` = `{boolean}` the default checkbox status. Default value is `true`. -#### XNAClientCheckbox -_(inherits XNACheckBox)_ +#### [XNAClientCheckbox](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNAClientCheckBox.cs) +_(inherits [XNACheckBox](#XNACheckbox))_ -`ToolTip` = `{multi-line string}` tooltip for checkbox +`ToolTip` = `{multi-line string}` the tooltip for checkbox. -#### XNADropDown +#### [XNADropDown](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNADropDown.cs) _(inherits [XNAControl](#XNAControl))_ -`OpenUp` -`DropDownTexture` -`DropDownOpenTexture` -`ItemHeight` -`ClickSoundEffect` -`FontIndex` -`BorderColor` -`FocusColor` -`BackColor` -`~~DisabledItemColor~~` -`OptionN` - -#### XNAClientDropDown +`OpenUp` = `{boolean}` defines open/close default status. +`DropDownTexture` = `{stiring}` loads a texture with the specific file name with suffix as texture when dropdown closed. +`DropDownOpenTexture` = `{string}` loads a texture with the specific file name with suffix as texture when dropdown opened. +`ItemHeight` = `{integer}` the height of each dropdown item in pixels. +`ClickSoundEffect` = `{string}` loads a sound with the specific file name with suffix as dropdown click sound. +`FontIndex` = `{integer}` the index of font loaded from font list. Default value is `0`. +`BorderColor` = `{color string}` the color for dropdown's border line when it open. +`FocusColor` = `{color string}` the color for dropdown item when cursore above it. +`BackColor` = `{color string}` the background color dropdown when it open. +`DisabledItemColor` = `{color string}` the color for disabled dropdown item. +`OptionX` = `{string}` the text option for dropdown. `X` is an any text that helps to describe this option, e.g. `Option_FirstOption`. + +#### [XNAClientDropDown](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNAClientCheckBox.cs) _(inherits XNADropDown)_ -`ToolTip` = `{multi-line string}` tooltip for checkbox +`ToolTip` = `{multi-line string}` tooltip for dropdown. -#### XNATabControl +#### [XNATabControl](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNATabControl.cs) _(inherits [XNAControl](#XNAControl))_ -`RemapColor` -`TextColor` -`TextColorDisabled` -`RemoveTabIndexN` +`RemapColor` = `{color string}` the tab text color. +`TextColor` = `{color string}` the tab text color. +`TextColorDisabled` = `{color string}` the color for disabled tab. +`RemoveTabIndexN` = `{boolean}` . `N` is `integer` equivalent if tab index. -#### XNATextBox +#### [XNATextBox](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNATextBox.cs) _(inherits [XNAControl](#XNAControl))_ -`MaximumTextLength` +`MaximumTextLength` = `{integer}` set maximum input string length. + +#### [XNASuggestionTextBox](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNASuggestionTextBox.cs) +_(inherits [XNAControl](#XNATextBox))_ + +`Suggestion` = `{string}` set default background text when no text has typed. ### Basic Control Property Examples ```ini +[lblExample] X=100 Y=100 Text=Text Sample @@ -167,10 +198,8 @@ Location=100,100 Width=100 Height=100 Size=100,100 -Visible=true Visible=yes -Enabled=true -Enabled=yes +Enabled=false DistanceFromRightBorder=10 DistanceFromLeftBorder=10 FillWidth=10 @@ -188,27 +217,27 @@ Following controls are only available as children of `XNAOptionsPanel` and deriv ##### SettingCheckBox _(inherits XNAClientCheckBox)_ -`DefaultValue` = `{true/false or yes/no}` default state of the checkbox. Value of `Checked` will be used if it is set and this isn't. Otherwise defaults to `false`. +`DefaultValue` = `{boolean}` default state of the checkbox. Value of `Checked` will be used if it is set and this isn't. Otherwise defaults to `false`. `SettingSection` = `{string}` name of the section in settings INI the setting is saved to. Defaults to `CustomSettings`. `SettingKey` = `{string}` name of the key in settings INI the setting is saved to. Defaults to `CONTROLNAME_Value` if `WriteSettingValue` is set, otherwise `CONTROLNAME_Checked`. -`WriteSettingValue` = `{true/false or yes/no}` enable to write a specific string value to setting INI key instead of the checked state of the checkbox. Defaults to `false`. +`WriteSettingValue` = `{boolean}` enable to write a specific string value to setting INI key instead of the checked state of the checkbox. Defaults to `false`. `EnabledSettingValue` = `{string}` value to write to setting INI key if `WriteSettingValue` is set and checkbox is checked. `DisabledSettingValue` = `{string}` value to write to setting INI key if `WriteSettingValue` is set and checkbox is not checked. -`RestartRequired` = `{true/false or yes/no}` whether or not this setting requires restarting the client to apply. Defaults to `false`. +`RestartRequired` = `{boolean}` whether or not this setting requires restarting the client to apply. Defaults to `false`. `ParentCheckBoxName` = `{string}` name of a `XNAClientCheckBox` control to use as a parent checkbox that is required to either be checked or unchecked, depending on value of `ParentCheckBoxRequiredValue` for this checkbox to be enabled. Only works if name can be resolved to an existing control belonging to same parent as current checkbox. -`ParentCheckBoxRequiredValue` = `{true/false or yes/no}` state required from the parent checkbox for this one to be enabled. Defaults to `true`. +`ParentCheckBoxRequiredValue` = `{boolean}` state required from the parent checkbox for this one to be enabled. Defaults to `true`. ##### FileSettingCheckBox _(inherits XNAClientCheckBox)_ -`DefaultValue` = `{true/false or yes/no}` default state of the checkbox. Value of `Checked` will be used if it is set and this isn't. Otherwise defaults to `false`. +`DefaultValue` = `{boolean}` default state of the checkbox. Value of `Checked` will be used if it is set and this isn't. Otherwise defaults to `false`. `SettingSection` = `{string}` name of the section in settings INI the setting is saved to. Defaults to `CustomSettings`. `SettingKey` = `{string}` name of the key in settings INI the setting is saved to. Defaults to `CONTROLNAME_Value` if `WriteSettingValue` is set, otherwise `CONTROLNAME_Checked`. -`RestartRequired` = `{true/false or yes/no}` whether or not this setting requires restarting the client to apply. Defaults to `false`. +`RestartRequired` = `{boolean}` whether or not this setting requires restarting the client to apply. Defaults to `false`. `ParentCheckBoxName` = `{string}` name of a `XNAClientCheckBox` control to use as a parent checkbox that is required to either be checked or unchecked, depending on value of `ParentCheckBoxRequiredValue` for this checkbox to be enabled. Only works if name can be resolved to an existing control belonging to same parent as current checkbox. -`ParentCheckBoxRequiredValue` = `{true/false or yes/no}` state required from the parent checkbox for this one to be enabled. Defaults to `true`. -`CheckAvailability` = `{true/false or yes/no}` if set, whether or not the checkbox can be (un)checked depends on if the files to copy are actually present. Defaults to `false`. -`ResetUnavailableValue` = `{true/false or yes/no}` if set together with `CheckAvailability`, checkbox set to a value that is unavailable will be reset back to `DefaultValue`. Defaults to `false`. +`ParentCheckBoxRequiredValue` = `{boolean}` state required from the parent checkbox for this one to be enabled. Defaults to `true`. +`CheckAvailability` = `{boolean}` if set, whether or not the checkbox can be (un)checked depends on if the files to copy are actually present. Defaults to `false`. +`ResetUnavailableValue` = `{boolean}` if set together with `CheckAvailability`, checkbox set to a value that is unavailable will be reset back to `DefaultValue`. Defaults to `false`. `EnabledFileN` = `{comma-separated strings}` files to copy if checkbox is checked. N starts from 0 and is incremented by 1 until no value is found. Expects 2-3 comma-separated strings in following format: source path relative to game root folder, destination path relative to game root folder and a [file operation option](#appendix-file-operation-options). `DisabledFileN` = `{comma-separated strings}` files to copy if checkbox is not checked. N starts from 0 and is incremented by 1 until no value is found. Expects 2-3 comma-separated strings in following format: source path relative to game root folder, destination path relative to game root folder and a [file operation option](#appendix-file-operation-options). @@ -219,8 +248,8 @@ _(inherits XNAClientDropDown)_ `DefaultValue` = `{integer}` default item index of the dropdown. Defaults to 0 (first item). `SettingSection` = `{string}` name of the section in settings INI the setting is saved to. Defaults to `CustomSettings`. `SettingKey` = `{string}` name of the key in settings INI the setting is saved to. Defaults to `CONTROLNAME_Value` if `WriteSettingValue` is set, otherwise `CONTROLNAME_SelectedIndex`. -`WriteSettingValue` = `{true/false or yes/no}` enable to write selected item value to the setting INI key instead of the checked state of the checkbox. Defaults to `false`. -`RestartRequired` = `{true/false or yes/no}` whether or not this setting requires restarting the client to apply. Defaults to `false`. +`WriteSettingValue` = `{boolean}` enable to write selected item value to the setting INI key instead of the checked state of the checkbox. Defaults to `false`. +`RestartRequired` = `{boolean}` whether or not this setting requires restarting the client to apply. Defaults to `false`. ##### FileSettingDropDown _(inherits XNAClientDropDown)_ @@ -229,7 +258,7 @@ _(inherits XNAClientDropDown)_ `DefaultValue` = `{integer}` default item index of the dropdown. Defaults to 0 (first item). `SettingSection` = `{string}` name of the section in settings INI the setting is saved to. Defaults to `CustomSettings`. `SettingKey` = `{string}` name of the key in settings INI the setting is saved to. Defaults to `CONTROLNAME_SelectedIndex`. -`RestartRequired` = `{true/false or yes/no}` whether or not this setting requires restarting the client to apply. Defaults to `false`. +`RestartRequired` = `{boolean}` whether or not this setting requires restarting the client to apply. Defaults to `false`. `ItemXFileN` = `{comma-separated strings}` files to copy when dropdown item X is selected. N starts from 0 and is incremented by 1 until no value is found. Expects 2-3 comma-separated strings in following format: source path relative to game root folder, destination path relative to game root folder and a [file operation option](#appendix-file-operation-options). ##### Appendix: File Operation Options @@ -254,6 +283,7 @@ These can ONLY be used in parent controls that inherit the `INItializableWindow` ### Dynamic Control Property Examples ```ini +[lblExample] $X=100 $X=MY_X_CONSTANT $Y=100 From 944a4e650817f7ce29ec78b8adc7c5e0c20980be Mon Sep 17 00:00:00 2001 From: mah_boi <61310813+MahBoiDeveloper@users.noreply.github.com> Date: Mon, 25 Nov 2024 21:26:16 +0300 Subject: [PATCH 07/15] Add example for comma separated floats Co-authored-by: Metadorius Co-authored-by: Kerbiter --- Docs/INISystem.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docs/INISystem.md b/Docs/INISystem.md index ae2952875..62baa32cc 100644 --- a/Docs/INISystem.md +++ b/Docs/INISystem.md @@ -29,7 +29,7 @@ _NOTE: Constants can only be used in [dynamic control properties](#dynamic-contr - The `boolean` string value parses as `true` if it contains one of these symbol as first character: `t`, `y`, `1`, `a`, `e`; and if first symbol is `n`, `f`, `0`, then it parses as `false`. - The `integer` type is actually `System.Int32`. - The `float` type is actually `System.Single`. -- The `comma separated integers` or `comma separated floats` is a `integer` or `float` type, but separated with `,` character without spaces, e.g. `0.0,0.0` +- The `comma separated integers` or `comma separated floats` is a `integer` or `float` type, but separated with `,` character without spaces, e.g. `0,0` or `0.0,0.0` respectively. ## Control properties Below lists basic and dynamic control properties. Ordering of properties is important. If there is a property that relies on the size of a control, the properties must set the size of that control first. From 485f7ef8307438fea18aaf6b887cd6965a3bf8bf Mon Sep 17 00:00:00 2001 From: MahBoiDeveloper Date: Tue, 26 Nov 2024 02:10:16 +0300 Subject: [PATCH 08/15] Test Phobos INI documentation style Co-authored-by: Metadorius --- Docs/INISystem.md | 168 +++++++++++++++++++++++++--------------------- 1 file changed, 92 insertions(+), 76 deletions(-) diff --git a/Docs/INISystem.md b/Docs/INISystem.md index 62baa32cc..52fbd50dc 100644 --- a/Docs/INISystem.md +++ b/Docs/INISystem.md @@ -3,16 +3,13 @@ > _TODO work in progress_ ## Constants - The `[ParserConstants]` section of the `GlobalThemeSettings.ini` file contains constants that can be used in other INI files. ### Predefined System Constants - `RESOLUTION_WIDTH`: the width of the window when it is initialized `RESOLUTION_HEIGHT`: the height of the window when it is initialized ### User Defined Constants - ```ini MY_EXAMPLE_CONSTANT=15 ``` @@ -24,55 +21,78 @@ $X=MY_EXAMPLE_CONSTANT _NOTE: Constants can only be used in [dynamic control properties](#dynamic-control-properties)_ ### Data Types -- The `multi-line string`s use `@` as a line break. To write the real `@` character, use `\@`. Also as INI syntax uses `;` to denote comments, use `\semicolon` to write the real `;` character. +- The `text` use `@` as a line break. To write the real `@` character, use `\@`. Also as INI syntax uses `;` to denote comments, use `\semicolon` to write the real `;` character. - The `color string` use form `R,G,B` or `R,G,B,A`. All values must be between `0` and `255`. - The `boolean` string value parses as `true` if it contains one of these symbol as first character: `t`, `y`, `1`, `a`, `e`; and if first symbol is `n`, `f`, `0`, then it parses as `false`. - The `integer` type is actually `System.Int32`. - The `float` type is actually `System.Single`. -- The `comma separated integers` or `comma separated floats` is a `integer` or `float` type, but separated with `,` character without spaces, e.g. `0,0` or `0.0,0.0` respectively. +- The `comma separated integers` or `comma separated floats` is a `integer` or `float` type, but separated with `,` character without spaces e.g., `0,0` or `0.0,0.0` respectively. ## Control properties Below lists basic and dynamic control properties. Ordering of properties is important. If there is a property that relies on the size of a control, the properties must set the size of that control first. ### Basic Control Properties Basic control properties cannot use constants. +> [!WARNING] +> Do not copy-paste ini-code below without edits because it won't work! +> +> For example, +> - `X` and `Y` are conflict with `Location`, +> - `BackgroundTexture` and `SolidColorBackgroundTexture` conflicts, +> - and others. #### [XNAControl](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAControl.cs) - -`X` = `{integer}` the X location of the control. -`Y` = `{integer}` the Y location of the control. -`Location` = `{comma separated integers}` the X and Y location of the control. -`Width` = `{integer}` the Width of the control. -`Height` = `{integer}` the Height of the control. -`Size` = `{comma separated integers}` the Width and Height of the control. -`Text` = `{multi-line string}` the text to display for the control (ex: buttons, labels, etc...). -`Visible` = `{boolean}` whether or not the control should be visible by default. -`Enabled` = `{boolean}` whether or not the control should be enabled by default. -`DistanceFromRightBorder` = `{integer}` the distance of the right edge of this control from the right edge of its parent. This control MUST have a parent. -`DistanceFromBottomBorder` = `{integer}` the distance of the bottom edge of this control from the bottom edge of its parent. This control MUST have a parent. -`FillWidth` = `{integer}` this will set the width of this control to fill the parent/window MINUS this value, starting from the its X position. -`FillHeight` = `{integer}` this will set the height of this control to fill the parent/window MINUS this value, starting from the its Y position. -`DrawOrder` = `{integer}` determine the layering order of the control within its parent control's list of child controls. -`UpdateOrder` = `{integer}` determine the layering order of the control within its parent control's list of child controls. -`RemapColor` = `{color string}` this will set a theme defined color based. -`ControlDrawMode` = `{string}` this will set render option to draw control on its own render target (`UniqueRenderTarget`) or to draw control on the same render target with its parent (`Normal`). +- Basic class inherited by any other control element. +```ini +[SOMECONTROL] ; XNAControl +X=0 ; integer, the X location of the control. +Y=0 ; integer, the Y location of the control. +Location=50,100 ; comma separated integers, the X and Y location of the control. +Width=25 ; integer, the Width of the control. +Height=10 ; integer, the Height of the control. +Size=60,30 ; comma separated integers, the Width and Height of the control. +Text=Some Text@Example ; text, the text to display for the control (ex: buttons, labels, etc...). +Visible=yes ; boolean, whether or not the control should be visible by default. +Enabled=yes ; boolean, whether or not the control should be enabled by default. +DistanceFromRightBorder=5 ; integer, the distance of the right edge of this control from + ; the right edge of its parent. This control MUST have a parent. +DistanceFromBottomBorder=3 ; integer, the distance of the bottom edge of this control from the + ; bottom edge of its parent. This control MUST have a parent. +FillWidth=2 ; integer, this will set the width of this control to fill + ; the parent/window MINUS this value, starting from the its X position. +FillHeight=1 ; integer, this will set the height of this control to fill + ; the parent/window MINUS this value, starting from the its Y position. +DrawOrder=0 ; integer, determine the layering order of the control within + ; its parent control's list of child controls. +UpdateOrder=0 ; integer, determine the layering order of the control within + ; its parent control's list of child controls. +RemapColor= ; color string, this will set a theme defined color based. +ControlDrawMode=Normal ; string, this will set render option to draw control on its own render + ; target (`UniqueRenderTarget`) or to draw control on + ; the same render target with its parent (`Normal`). +``` #### [XNAIndicator](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAIndicator.cs) _(inherits [XNAControl](#XNAControl))_ -`FontIndex` = `{integer}` the index of font loaded from font list. Default value is `0`. -`HighlightColor` = `{color string}` the text color when cursor above the `XNAIndicator`. -`AlphaRate` = `{float}` the indicator's transparency changing rate per 100 milliseconds. If the indicator is transparent, it'll become non-transparent at this rate. Default value is `0.01`. +```ini +[SOMEINDICATOR] ; XNAIndicator +FontIndex=0 ; integer, the index of font loaded from font list. Default value is `0`. +HighlightColor=255,255,255 ; color string, the text color when cursor above the `XNAIndicator`. +AlphaRate=0.02 ; float, the indicator's transparency changing rate per 100 milliseconds. If the indicator is transparent, it'll become non-transparent at this rate. Default value is `0.01`. +``` #### [XNAPanel](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAPanel.cs) _(inherits [XNAControl](#XNAControl))_ - -`BorderColor` = `{color string}` this will set a border color based. -`DrawMode` = `{string}` this will set draw mode for panel. Allowed values: `Tiled`, `Centered`, `Stretched` (default option). -`AlphaRate` = `{float}` the panel's transparency changing rate per 100 milliseconds. If the panel is transparent, it'll become non-transparent at this rate. Default value is `0.01`. -`BackgroundTexture` = `{string}` loads a texture with the specific file name with suffix. If the texture isn't found from any asset search path, returns a dummy texture. -`SolidColorBackgroundTexture` = `{color string}` this will set background color stretched texture instead of user defined picture. -`DrawBorders` = `{boolean}` enables or disables borders drawing for control. Borders enabled by default. -`Padding` = `{comma separated integers}` css-like panel padding in client window, i.e. `1,2,3,4` where `1` - left, `2` - top, `3` - right, `4` - bottom. +```ini +[SOMEPANEL] ; XNAPanel +BorderColor=255,255,255 ; color string, this will set a border color based. +DrawMode=Centered ; string, this will set draw mode for panel. Allowed values: `Tiled`, `Centered`, `Stretched` (default option). +AlphaRate=0.05 ; float, the panel's transparency changing rate per 100 milliseconds. If the panel is transparent, it'll become non-transparent at this rate. Default value is `0.01`. +BackgroundTexture=back.png ; string, loads a texture with the specific file name with suffix. If the texture isn't found from any asset search path, returns a dummy texture. +SolidColorBackgroundTexture=255,255,255 ; color string, this will set background color stretched texture instead of user defined picture. +DrawBorders=true ; boolean, enables or disables borders drawing for control. Borders enabled by default. +Padding=10, 5, 10, 5 ; comma separated integers, css-like panel padding in client window, i.e. `1,2,3,4` where `1` - left, `2` - top, `3` - right, `4` - bottom. +``` #### [XNAExtraPanel](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNAExtraPanel.cs) _(inherits [XNAPanel](#XNAPanel))_ @@ -126,7 +146,7 @@ _(inherits [XNAControl](#XNAControl))_ _(inherits [XNAButton](#XNAButton))_ `MatchTextureSize` = `{boolean}` the button's width and height will match its texture properties. Default value is `false`. -`ToolTip` = `{multi-line string}` the tooltip for button. +`ToolTip` = `{text}` the tooltip for button. #### [XNALinkButton](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNALinkButton.cs) _(inherits [XNAClientButton](#XNAClientButton))_ @@ -148,7 +168,7 @@ _(inherits [XNAControl](#XNAControl))_ #### [XNAClientCheckbox](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNAClientCheckBox.cs) _(inherits [XNACheckBox](#XNACheckbox))_ -`ToolTip` = `{multi-line string}` the tooltip for checkbox. +`ToolTip` = `{text}` the tooltip for checkbox. #### [XNADropDown](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNADropDown.cs) _(inherits [XNAControl](#XNAControl))_ @@ -163,12 +183,12 @@ _(inherits [XNAControl](#XNAControl))_ `FocusColor` = `{color string}` the color for dropdown item when cursore above it. `BackColor` = `{color string}` the background color dropdown when it open. `DisabledItemColor` = `{color string}` the color for disabled dropdown item. -`OptionX` = `{string}` the text option for dropdown. `X` is an any text that helps to describe this option, e.g. `Option_FirstOption`. +`OptionX` = `{string}` the text option for dropdown. `X` is an any text that helps to describe this option e.g., `Option_FirstOption`. #### [XNAClientDropDown](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNAClientCheckBox.cs) _(inherits XNADropDown)_ -`ToolTip` = `{multi-line string}` tooltip for dropdown. +`ToolTip` = `{text}` tooltip for dropdown. #### [XNATabControl](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNATabControl.cs) _(inherits [XNAControl](#XNAControl))_ @@ -194,9 +214,8 @@ _(inherits [XNAControl](#XNATextBox))_ X=100 Y=100 Text=Text Sample -Location=100,100 -Width=100 -Height=100 +ToolTip=Big and beautiful tooltip@that help to undestand lblExample. +TextColor=255,255,255 Size=100,100 Visible=yes Enabled=false @@ -207,62 +226,59 @@ FillHeight=10 ``` ### Special Controls & Their Properties - -Some controls are only available under specific circumstances +Some controls are only available under specific circumstances. #### XNAOptionsPanel Controls - Following controls are only available as children of `XNAOptionsPanel` and derived controls. These currently use basic control properties only. ##### SettingCheckBox _(inherits XNAClientCheckBox)_ -`DefaultValue` = `{boolean}` default state of the checkbox. Value of `Checked` will be used if it is set and this isn't. Otherwise defaults to `false`. -`SettingSection` = `{string}` name of the section in settings INI the setting is saved to. Defaults to `CustomSettings`. -`SettingKey` = `{string}` name of the key in settings INI the setting is saved to. Defaults to `CONTROLNAME_Value` if `WriteSettingValue` is set, otherwise `CONTROLNAME_Checked`. -`WriteSettingValue` = `{boolean}` enable to write a specific string value to setting INI key instead of the checked state of the checkbox. Defaults to `false`. -`EnabledSettingValue` = `{string}` value to write to setting INI key if `WriteSettingValue` is set and checkbox is checked. -`DisabledSettingValue` = `{string}` value to write to setting INI key if `WriteSettingValue` is set and checkbox is not checked. -`RestartRequired` = `{boolean}` whether or not this setting requires restarting the client to apply. Defaults to `false`. -`ParentCheckBoxName` = `{string}` name of a `XNAClientCheckBox` control to use as a parent checkbox that is required to either be checked or unchecked, depending on value of `ParentCheckBoxRequiredValue` for this checkbox to be enabled. Only works if name can be resolved to an existing control belonging to same parent as current checkbox. -`ParentCheckBoxRequiredValue` = `{boolean}` state required from the parent checkbox for this one to be enabled. Defaults to `true`. +`DefaultValue` = `{boolean}` default state of the checkbox. Value of `Checked` will be used if it is set and this isn't. Otherwise defaults to `false`. +`SettingSection` = `{string}` name of the section in settings INI the setting is saved to. Defaults to `CustomSettings`. +`SettingKey` = `{string}` name of the key in settings INI the setting is saved to. Defaults to `CONTROLNAME_Value` if `WriteSettingValue` is set, otherwise `CONTROLNAME_Checked`. +`WriteSettingValue` = `{boolean}` enable to write a specific string value to setting INI key instead of the checked state of the checkbox. Defaults to `false`. +`EnabledSettingValue` = `{string}` value to write to setting INI key if `WriteSettingValue` is set and checkbox is checked. +`DisabledSettingValue` = `{string}` value to write to setting INI key if `WriteSettingValue` is set and checkbox is not checked. +`RestartRequired` = `{boolean}` whether or not this setting requires restarting the client to apply. Defaults to `false`. +`ParentCheckBoxName` = `{string}` name of a `XNAClientCheckBox` control to use as a parent checkbox that is required to either be checked or unchecked, depending on value of `ParentCheckBoxRequiredValue` for this checkbox to be enabled. Only works if name can be resolved to an existing control belonging to same parent as current checkbox. +`ParentCheckBoxRequiredValue` = `{boolean}` state required from the parent checkbox for this one to be enabled. Defaults to `true`. ##### FileSettingCheckBox _(inherits XNAClientCheckBox)_ -`DefaultValue` = `{boolean}` default state of the checkbox. Value of `Checked` will be used if it is set and this isn't. Otherwise defaults to `false`. -`SettingSection` = `{string}` name of the section in settings INI the setting is saved to. Defaults to `CustomSettings`. -`SettingKey` = `{string}` name of the key in settings INI the setting is saved to. Defaults to `CONTROLNAME_Value` if `WriteSettingValue` is set, otherwise `CONTROLNAME_Checked`. -`RestartRequired` = `{boolean}` whether or not this setting requires restarting the client to apply. Defaults to `false`. -`ParentCheckBoxName` = `{string}` name of a `XNAClientCheckBox` control to use as a parent checkbox that is required to either be checked or unchecked, depending on value of `ParentCheckBoxRequiredValue` for this checkbox to be enabled. Only works if name can be resolved to an existing control belonging to same parent as current checkbox. -`ParentCheckBoxRequiredValue` = `{boolean}` state required from the parent checkbox for this one to be enabled. Defaults to `true`. -`CheckAvailability` = `{boolean}` if set, whether or not the checkbox can be (un)checked depends on if the files to copy are actually present. Defaults to `false`. -`ResetUnavailableValue` = `{boolean}` if set together with `CheckAvailability`, checkbox set to a value that is unavailable will be reset back to `DefaultValue`. Defaults to `false`. -`EnabledFileN` = `{comma-separated strings}` files to copy if checkbox is checked. N starts from 0 and is incremented by 1 until no value is found. Expects 2-3 comma-separated strings in following format: source path relative to game root folder, destination path relative to game root folder and a [file operation option](#appendix-file-operation-options). -`DisabledFileN` = `{comma-separated strings}` files to copy if checkbox is not checked. N starts from 0 and is incremented by 1 until no value is found. Expects 2-3 comma-separated strings in following format: source path relative to game root folder, destination path relative to game root folder and a [file operation option](#appendix-file-operation-options). +`DefaultValue` = `{boolean}` default state of the checkbox. Value of `Checked` will be used if it is set and this isn't. Otherwise defaults to `false`. +`SettingSection` = `{string}` name of the section in settings INI the setting is saved to. Defaults to `CustomSettings`. +`SettingKey` = `{string}` name of the key in settings INI the setting is saved to. Defaults to `CONTROLNAME_Value` if `WriteSettingValue` is set, otherwise `CONTROLNAME_Checked`. +`RestartRequired` = `{boolean}` whether or not this setting requires restarting the client to apply. Defaults to `false`. +`ParentCheckBoxName` = `{string}` name of a `XNAClientCheckBox` control to use as a parent checkbox that is required to either be checked or unchecked, depending on value of `ParentCheckBoxRequiredValue` for this checkbox to be enabled. Only works if name can be resolved to an existing control belonging to same parent as current checkbox. +`ParentCheckBoxRequiredValue` = `{boolean}` state required from the parent checkbox for this one to be enabled. Defaults to `true`. +`CheckAvailability` = `{boolean}` if set, whether or not the checkbox can be (un)checked depends on if the files to copy are actually present. Defaults to `false`. +`ResetUnavailableValue` = `{boolean}` if set together with `CheckAvailability`, checkbox set to a value that is unavailable will be reset back to `DefaultValue`. Defaults to `false`. +`EnabledFileN` = `{comma-separated strings}` files to copy if checkbox is checked. N starts from 0 and is incremented by 1 until no value is found. Expects 2-3 comma-separated strings in following format: source path relative to game root folder, destination path relative to game root folder and a [file operation option](#appendix-file-operation-options). +`DisabledFileN` = `{comma-separated strings}` files to copy if checkbox is not checked. N starts from 0 and is incremented by 1 until no value is found. Expects 2-3 comma-separated strings in following format: source path relative to game root folder, destination path relative to game root folder and a [file operation option](#appendix-file-operation-options). ##### SettingDropDown _(inherits XNAClientDropDown)_ -`Items` = `{comma-separated strings}` comma-separated list of strings to include as items to display on the dropdown control. -`DefaultValue` = `{integer}` default item index of the dropdown. Defaults to 0 (first item). -`SettingSection` = `{string}` name of the section in settings INI the setting is saved to. Defaults to `CustomSettings`. -`SettingKey` = `{string}` name of the key in settings INI the setting is saved to. Defaults to `CONTROLNAME_Value` if `WriteSettingValue` is set, otherwise `CONTROLNAME_SelectedIndex`. -`WriteSettingValue` = `{boolean}` enable to write selected item value to the setting INI key instead of the checked state of the checkbox. Defaults to `false`. -`RestartRequired` = `{boolean}` whether or not this setting requires restarting the client to apply. Defaults to `false`. +`Items` = `{comma-separated strings}` comma-separated list of strings to include as items to display on the dropdown control. +`DefaultValue` = `{integer}` default item index of the dropdown. Defaults to 0 (first item). +`SettingSection` = `{string}` name of the section in settings INI the setting is saved to. Defaults to `CustomSettings`. +`SettingKey` = `{string}` name of the key in settings INI the setting is saved to. Defaults to `CONTROLNAME_Value` if `WriteSettingValue` is set, otherwise `CONTROLNAME_SelectedIndex`. +`WriteSettingValue` = `{boolean}` enable to write selected item value to the setting INI key instead of the checked state of the checkbox. Defaults to `false`. +`RestartRequired` = `{boolean}` whether or not this setting requires restarting the client to apply. Defaults to `false`. ##### FileSettingDropDown _(inherits XNAClientDropDown)_ -`Items` = `{comma-separated strings}` comma-separated list of strings to include as items to display on the dropdown control. -`DefaultValue` = `{integer}` default item index of the dropdown. Defaults to 0 (first item). -`SettingSection` = `{string}` name of the section in settings INI the setting is saved to. Defaults to `CustomSettings`. -`SettingKey` = `{string}` name of the key in settings INI the setting is saved to. Defaults to `CONTROLNAME_SelectedIndex`. -`RestartRequired` = `{boolean}` whether or not this setting requires restarting the client to apply. Defaults to `false`. -`ItemXFileN` = `{comma-separated strings}` files to copy when dropdown item X is selected. N starts from 0 and is incremented by 1 until no value is found. Expects 2-3 comma-separated strings in following format: source path relative to game root folder, destination path relative to game root folder and a [file operation option](#appendix-file-operation-options). +`Items` = `{comma-separated strings}` comma-separated list of strings to include as items to display on the dropdown control. +`DefaultValue` = `{integer}` default item index of the dropdown. Defaults to 0 (first item). +`SettingSection` = `{string}` name of the section in settings INI the setting is saved to. Defaults to `CustomSettings`. +`SettingKey` = `{string}` name of the key in settings INI the setting is saved to. Defaults to `CONTROLNAME_SelectedIndex`. +`RestartRequired` = `{boolean}` whether or not this setting requires restarting the client to apply. Defaults to `false`. +`ItemXFileN` = `{comma-separated strings}` files to copy when dropdown item X is selected. N starts from 0 and is incremented by 1 until no value is found. Expects 2-3 comma-separated strings in following format: source path relative to game root folder, destination path relative to game root folder and a [file operation option](#appendix-file-operation-options). ##### Appendix: File Operation Options - Valid file operation options available for files defined for `FileSettingCheckBox` and `FileSettingDropDown` are as follows: - `AlwaysOverwrite`: Always overwrites the destination file with source file. From c971d20c5cb2e68b4afcd64b5f0a40ebede7c4ba Mon Sep 17 00:00:00 2001 From: MahBoiDeveloper Date: Tue, 26 Nov 2024 14:28:08 +0300 Subject: [PATCH 09/15] Update docs style to Phobos-like --- Docs/INISystem.md | 438 +++++++++++++++++++++++++++++----------------- 1 file changed, 280 insertions(+), 158 deletions(-) diff --git a/Docs/INISystem.md b/Docs/INISystem.md index 52fbd50dc..23d9e40ed 100644 --- a/Docs/INISystem.md +++ b/Docs/INISystem.md @@ -26,7 +26,9 @@ _NOTE: Constants can only be used in [dynamic control properties](#dynamic-contr - The `boolean` string value parses as `true` if it contains one of these symbol as first character: `t`, `y`, `1`, `a`, `e`; and if first symbol is `n`, `f`, `0`, then it parses as `false`. - The `integer` type is actually `System.Int32`. - The `float` type is actually `System.Single`. -- The `comma separated integers` or `comma separated floats` is a `integer` or `float` type, but separated with `,` character without spaces e.g., `0,0` or `0.0,0.0` respectively. +- The `N integers` or `N floats` is a `integer` or `float` type values repeated `N` times, but separated with `,` character without spaces e.g., `0,0` or `0.0,0.0` respectively. +- The `comma-separated strings` is a string, but separated with `,` character without spaces e.g., `one,two,three`. + ## Control properties Below lists basic and dynamic control properties. Ordering of properties is important. If there is a property that relies on the size of a control, the properties must set the size of that control first. @@ -34,51 +36,54 @@ Below lists basic and dynamic control properties. Ordering of properties is impo ### Basic Control Properties Basic control properties cannot use constants. > [!WARNING] -> Do not copy-paste ini-code below without edits because it won't work! +> Do not copy-paste ini-code below without edits because it won't work! It shows only how to work with properties. > > For example, > - `X` and `Y` are conflict with `Location`, > - `BackgroundTexture` and `SolidColorBackgroundTexture` conflicts, -> - and others. +> - and many others. #### [XNAControl](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAControl.cs) - Basic class inherited by any other control element. ```ini [SOMECONTROL] ; XNAControl -X=0 ; integer, the X location of the control. -Y=0 ; integer, the Y location of the control. -Location=50,100 ; comma separated integers, the X and Y location of the control. -Width=25 ; integer, the Width of the control. -Height=10 ; integer, the Height of the control. -Size=60,30 ; comma separated integers, the Width and Height of the control. -Text=Some Text@Example ; text, the text to display for the control (ex: buttons, labels, etc...). -Visible=yes ; boolean, whether or not the control should be visible by default. -Enabled=yes ; boolean, whether or not the control should be enabled by default. -DistanceFromRightBorder=5 ; integer, the distance of the right edge of this control from - ; the right edge of its parent. This control MUST have a parent. -DistanceFromBottomBorder=3 ; integer, the distance of the bottom edge of this control from the - ; bottom edge of its parent. This control MUST have a parent. -FillWidth=2 ; integer, this will set the width of this control to fill - ; the parent/window MINUS this value, starting from the its X position. -FillHeight=1 ; integer, this will set the height of this control to fill - ; the parent/window MINUS this value, starting from the its Y position. -DrawOrder=0 ; integer, determine the layering order of the control within - ; its parent control's list of child controls. -UpdateOrder=0 ; integer, determine the layering order of the control within - ; its parent control's list of child controls. -RemapColor= ; color string, this will set a theme defined color based. -ControlDrawMode=Normal ; string, this will set render option to draw control on its own render - ; target (`UniqueRenderTarget`) or to draw control on - ; the same render target with its parent (`Normal`). +X=0 ; integer, the X location of the control. +Y=0 ; integer, the Y location of the control. +Location=50,100 ; 2 integers, the X and Y location of the control. +Width=25 ; integer, the Width of the control. +Height=10 ; integer, the Height of the control. +Size=60,30 ; 2 integers, the Width and Height of the control. +Text=Some Text@Example ; text, the text to display for the control (ex: buttons, labels, etc...). +Visible=yes ; boolean, whether or not the control should be visible by default. +Enabled=yes ; boolean, whether or not the control should be enabled by default. +DistanceFromRightBorder=5 ; integer, the distance of the right edge of this control from + ; the right edge of its parent. This control MUST have a parent. +DistanceFromBottomBorder=3 ; integer, the distance of the bottom edge of this control from the + ; bottom edge of its parent. This control MUST have a parent. +FillWidth=2 ; integer, this will set the width of this control to fill + ; the parent/window MINUS this value, starting from the its X position. +FillHeight=1 ; integer, this will set the height of this control to fill + ; the parent/window MINUS this value, starting from the its Y position. +DrawOrder=0 ; integer, determine the layering order of the control within + ; its parent control's list of child controls. +UpdateOrder=0 ; integer, determine the layering order of the control within + ; its parent control's list of child controls. +RemapColor= ; color string, this will set a theme defined color based. +ControlDrawMode=Normal ; enum (UniqueRenderTarget | Normal), + ; this will set render option to draw control on its own render + ; target (`UniqueRenderTarget`) or to draw control on + ; the same render target with its parent (`Normal`). ``` #### [XNAIndicator](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAIndicator.cs) _(inherits [XNAControl](#XNAControl))_ ```ini [SOMEINDICATOR] ; XNAIndicator -FontIndex=0 ; integer, the index of font loaded from font list. Default value is `0`. +FontIndex=0 ; integer, the index of font loaded from font list. Default value is `0`. HighlightColor=255,255,255 ; color string, the text color when cursor above the `XNAIndicator`. -AlphaRate=0.02 ; float, the indicator's transparency changing rate per 100 milliseconds. If the indicator is transparent, it'll become non-transparent at this rate. Default value is `0.01`. +AlphaRate=0.02 ; float, the indicator's transparency changing rate per 100 milliseconds. + ; If the indicator is transparent, it'll become non-transparent at this rate. + ; Default value is `0.01`. ``` #### [XNAPanel](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAPanel.cs) @@ -86,127 +91,185 @@ _(inherits [XNAControl](#XNAControl))_ ```ini [SOMEPANEL] ; XNAPanel BorderColor=255,255,255 ; color string, this will set a border color based. -DrawMode=Centered ; string, this will set draw mode for panel. Allowed values: `Tiled`, `Centered`, `Stretched` (default option). -AlphaRate=0.05 ; float, the panel's transparency changing rate per 100 milliseconds. If the panel is transparent, it'll become non-transparent at this rate. Default value is `0.01`. -BackgroundTexture=back.png ; string, loads a texture with the specific file name with suffix. If the texture isn't found from any asset search path, returns a dummy texture. -SolidColorBackgroundTexture=255,255,255 ; color string, this will set background color stretched texture instead of user defined picture. -DrawBorders=true ; boolean, enables or disables borders drawing for control. Borders enabled by default. -Padding=10, 5, 10, 5 ; comma separated integers, css-like panel padding in client window, i.e. `1,2,3,4` where `1` - left, `2` - top, `3` - right, `4` - bottom. +AlphaRate=0.05 ; float, the panel's transparency changing rate per 100 milliseconds. + ; If the panel is transparent, it'll become non-transparent at this rate. + ; Default value is `0.01`. +BackgroundTexture=back.png ; string, loads a texture with the specific file name with suffix. + ; If the texture isn't found from any asset search path, + ; returns a dummy texture. +SolidColorBackgroundTexture=255,255,255 ; color string, this will set background color stretched texture instead of + ; user defined picture. +DrawBorders=true ; boolean, enables or disables borders drawing for control. + ; Borders enabled by default. +Padding=10,5,10,5 ; 4 integers, css-like panel padding in client window e.g., + ; `1,2,3,4` where `1` - left, `2` - top, `3` - right, `4` - bottom. +DrawMode=Centered ; enum (Tiled | Centered | Stretched), this will set draw mode for panel. + ; Default value is `Stretched`. ``` #### [XNAExtraPanel](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNAExtraPanel.cs) _(inherits [XNAPanel](#XNAPanel))_ - -`BackgroundTexture` = `{string}` same as [XNAPanel](#XNAControl)'s `BackgroundTexture`. +```ini +[SOMEEXTRAPANEL] ; XNAExtraPanel +BackgroundTexture=back.png ; string, same as XNAControl's `BackgroundTexture`. +``` #### [XNATextBlock](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNATextBlock.cs) _(inherits [XNAPanel](#XNAPanel))_ -`TextColor` = `{color string}` defines text color for text block. +```ini +[SOMETEXTBLOCK] ; XNATextBlock +TextColor=255,255,255 ; color string, defines text color for text block. +``` #### [XNAMultiColumnListBox](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAMultiColumnListBox.cs) _(inherits [XNAPanel](#XNAPanel))_ -`FontIndex` = `{integer}` the index of font loaded from font list. Default value is `0`. -`DrawSelectionUnderScrollbar` = `{boolean}`. Default value is `true`. -`ColumnWidthN` = `{integer}` the default columns width in pixels. `N` is integer column index. -`ColumnX` = `{string}:{intgerer}` the column definition. `{string}` is a column header text. `{integer}` is a column width in pixels. `X` is an any text. -`ListBoxYAttribute:Attrname` = `{string}` allows setting list box attributes. `Attrname` is column attribute. +```ini +[SOMEMULTICOLUMBLISTBOX] ; XNAMultiColumnListBox +FontIndex=0 ; integer, the index of font loaded from font list. Default value is `0`. +DrawSelectionUnderScrollbar=yes ; boolean, enable/disable scroll bar, default value is `true`. +ColumnWidthN=0 ; integer, the default columns width in pixels. `N` is integer column index. +ColumnX=Number,0 ; string:integer, the column definition. `string` is a column header text. + ; `integer` is a column width in pixels. `X` is an any text. +ListBoxYAttribute:Attrname=Value ; string, allows setting list box attributes. `Attrname` is column attribute. + ; `Value` is column attribute value. +``` #### [XNATrackbar](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNATrackbar.cs) _(inherits [XNAPanel](#XNAPanel))_ -`MinValue` = `{integer}` the minumum value available for `XNATrackbar`. Default value is `0`. -`MaxValue` = `{integer}` the maximum value available for `XNATrackbar`. Default value is `10`. -`Value` = `{integer}` the default value available for `XNATrackbar`. Default value is `0`. -`ClickSound` = `{string}` loads a sound with the specific file name with suffix as `XNATrackbar` click sound. +```ini +[SOMETRACKBAR] ; XNATrackbar +MinValue=1 ; integer, the minumum value available for XNATrackbar. Default value is `0`. +MaxValue=9 ; integer, the maximum value available for XNATrackbar. Default value is `10`. +Value=4 ; integer, the default value available for XNATrackbar. Default value is `0`. +ClickSound=click.wav ; string, loads a sound with the specific file name with suffix as XNATrackbar click sound. +``` #### [XNALabel](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAButton.cs) _(inherits [XNAControl](#XNAControl))_ - -`RemapColor` = `{color string}` same as [XNAControl](#XNAControl)'s `RemapColor`. -`TextColor` = `{color string}` determine color of the text in label. -`FontIndex` = `{integer}` the index of font loaded from font list. Default value is `0`. -`AnchorPoint` = `{comma separated floats}` this will set a label's text start drawing point. Default value is `0.0,0.0` -`TextAnchor` = `{string}` this will set a text anchor in label draw box. Available values are `NONE`, `LEFT`, `RIGHT`, `HORIZONTAL_CENTER`, `TOP`, `BOTTOM`, `VERTICAL_CENTER` -`TextShadowDistance` = `{float}` the distance between text and its shadow. +```ini +[SOMELABEL] ; XNALabel +RemapColor=255,255,255 ; color string, same as XNAControl's `RemapColor`. +TextColor=255,255,255 ; color string, determine color of the text in label. +FontIndex=0 ; integer, the index of font loaded from font list. Default value is `0`. +AnchorPoint=0.5,0.5 ; 2 floats, this will set a label's text start drawing point. Default value is `0.0,0.0` +TextShadowDistance=0.04 ; float, the distance between text and its shadow. +TextAnchor=TOP ; enum (NONE | LEFT | RIGHT | HORIZONTAL_CENTER | TOP | BOTTOM | VERTICAL_CENTER), + ; this will set a text anchor in label draw box. +``` #### [XNAButton](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAButton.cs) _(inherits [XNAControl](#XNAControl))_ - -`TextColorIdle` = `{color string}` the text color when cursor isn't above the button. -`TextColorHover` = `{color string}` the text color when cursor above the button. -`HoverSoundEffect` = `{string}` loads a sound with the specific file name with suffix as button hover sound. -`ClickSoundEffect` = `{string}` loads a sound with the specific file name with suffix as button click sound. -`AdaptiveText` = `{boolean}` specifies how the client should change the start text drawing position in the button to fill all the free space. Default value is `true`. -`AlphaRate` = `{float}` the button's transparency changing rate per 100 milliseconds. If the button is transparent, it'll become non-transparent at this rate. Default value is `0.01`. -`FontIndex` = `{integer}` the index of loaded from font list. Default value is `0`. -`IdleTexture` = `{string}` loads a texture with the specific file name with suffix as button idle texture. -`HoverTexture` = `{string}` loads a texture with the specific file name with suffix as button hover texture. -`TextShadowDistance` = `{float}` the distance between text and its shadow. +```ini +[SOMEBUTTON] ; XNAButton +TextColorIdle=255,255,255 ; color string, the text color when cursor isn't above the button. +TextColorHover=255,255,255 ; color string, the text color when cursor above the button. +HoverSoundEffect=hover_button.wav ; string, loads a sound with the specific file name with suffix as button hover sound. +ClickSoundEffect=click_button.wav ; string, loads a sound with the specific file name with suffix as button click sound. +AdaptiveText=enable ; boolean, specifies how the client should change the start text drawing position + ; in the button to fill all the free space. Default value is `true`. +AlphaRate=0.04 ; float, the button's transparency changing rate per 100 milliseconds. + ; If the button is transparent, it'll become non-transparent at this rate. + ; Default value is `0.01`. +FontIndex=0 ; integer, the index of loaded from font list. Default value is `0`. +IdleTexture=button.png ; string, loads a texture with the specific file name with suffix as button idle texture. +HoverTexture=button_h.png ; string, loads a texture with the specific file name with suffix as button hover texture. +TextShadowDistance=0.03 ; float, the distance between text and its shadow. +``` #### [XNAClientButton](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNAClientButton.cs) _(inherits [XNAButton](#XNAButton))_ - -`MatchTextureSize` = `{boolean}` the button's width and height will match its texture properties. Default value is `false`. -`ToolTip` = `{text}` the tooltip for button. +```ini +[SOMECLIENTBUTTON] ; XNAClientButton +MatchTextureSize=true ; boolean, the button's width and height will match its texture properties. + ; Default value is `false`. +ToolTip=Big and helpful tooltip. ; text, the tooltip for button. +``` #### [XNALinkButton](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNALinkButton.cs) _(inherits [XNAClientButton](#XNAClientButton))_ - -`URL` = `{string}` the URL-link for OS Windows. -`UnixURL` = `{string}` the URL-link for Unix-like OS. -`Arguments` = `{string}` the arguments separated with space for URL-link. +```ini +[SOMELINKBUTTON] ; XNALinkButton +URL=https://www.cncnet.org ; `{string}` the URL-link for OS Windows. +UnixURL=https://www.cncnet.org ; `{string}` the URL-link for Unix-like OS. +Arguments=1 2 3 4 ; `{string}` the arguments separated with space for URL-link. +``` #### [XNACheckbox](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNACheckBox.cs) _(inherits [XNAControl](#XNAControl))_ - -`FontIndex` = `{integer}` the index of font loaded from font list. Default value is `0`. -`IdleColor` = `{color string}` the the text color when cursor isn't above the checkbox. -`HighlightColor` = `{color string}` the text color when cursor above the checkbox. -`AlphaRate` = `{float}` the checkbox's transparency changing rate per 100 milliseconds. If the checkbox is transparent, it'll become non-transparent at this rate. Default value is `0.01`. -`AllowChecking` = `{boolean}` the allows user to check/uncheck checkbox. Default value is `true`. -`Checked` = `{boolean}` the default checkbox status. Default value is `true`. +```ini +[SOMECHECKBOX] ; XNACheckbox +FontIndex=0 ; integer, the index of font loaded from font list. Default value is `0`. +IdleColor=255,255,255 ; color string, the the text color when cursor isn't above the checkbox. +HighlightColor=255,255,255 ; color string, the text color when cursor above the checkbox. +AlphaRate=0.1 ; float, the checkbox's transparency changing rate per 100 milliseconds. + ; If the checkbox is transparent, it'll become non-transparent at this rate. + ; Default value is `0.01`. +AllowChecking=yes ; boolean, the allows user to check/uncheck checkbox. Default value is `true`. +Checked=no ; boolean, the default checkbox status. Default value is `true`. +``` #### [XNAClientCheckbox](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNAClientCheckBox.cs) _(inherits [XNACheckBox](#XNACheckbox))_ - -`ToolTip` = `{text}` the tooltip for checkbox. +```ini +[SOMECLIENTCHECKBOX] ; XNAClientCheckbox +ToolTip=Some Text ; text, the tooltip for checkbox. +``` #### [XNADropDown](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNADropDown.cs) _(inherits [XNAControl](#XNAControl))_ - -`OpenUp` = `{boolean}` defines open/close default status. -`DropDownTexture` = `{stiring}` loads a texture with the specific file name with suffix as texture when dropdown closed. -`DropDownOpenTexture` = `{string}` loads a texture with the specific file name with suffix as texture when dropdown opened. -`ItemHeight` = `{integer}` the height of each dropdown item in pixels. -`ClickSoundEffect` = `{string}` loads a sound with the specific file name with suffix as dropdown click sound. -`FontIndex` = `{integer}` the index of font loaded from font list. Default value is `0`. -`BorderColor` = `{color string}` the color for dropdown's border line when it open. -`FocusColor` = `{color string}` the color for dropdown item when cursore above it. -`BackColor` = `{color string}` the background color dropdown when it open. -`DisabledItemColor` = `{color string}` the color for disabled dropdown item. -`OptionX` = `{string}` the text option for dropdown. `X` is an any text that helps to describe this option e.g., `Option_FirstOption`. +```ini +[SOMEDROPDOWN] ; XNADropDown +OpenUp=false ; boolean, defines open/close default status. +DropDownTexture=dd.png ; string, loads a texture with the specific file name with suffix as + ; texture when dropdown closed. +DropDownOpenTexture=dd_open.png ; string, loads a texture with the specific file name with suffix as + ; texture when dropdown opened. +ItemHeight=10 ; integer, the height of each dropdown item in pixels. +ClickSoundEffect=dd_click.wav ; string, loads a sound with the specific file name with suffix as + ; dropdown click sound. +FontIndex=0 ; integer, the index of font loaded from font list. Default value is `0`. +BorderColor=255,255,255 ; color string, the color for dropdown's border line when it open. +FocusColor=255,255,255 ; color string, the color for dropdown item when cursore above it. +BackColor=255,255,255 ; color string, the background color dropdown when it open. +DisabledItemColor=255,255,255 ; color string, the color for disabled dropdown item. +OptionX=First ; string, the text option for dropdown. `X` is an any text that helps to + ; describe this option e.g., `Option_FirstOption`. +; Option_FirstOption=1 +; Option_SecondOption=two +; Option_ThirdOption=33333 +``` #### [XNAClientDropDown](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNAClientCheckBox.cs) _(inherits XNADropDown)_ - -`ToolTip` = `{text}` tooltip for dropdown. +```ini +[SOMECLIENTDROPDOWN] ; XNAClientDropDown +ToolTip=Some Text ; text, tooltip for dropdown. +``` #### [XNATabControl](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNATabControl.cs) _(inherits [XNAControl](#XNAControl))_ - -`RemapColor` = `{color string}` the tab text color. -`TextColor` = `{color string}` the tab text color. -`TextColorDisabled` = `{color string}` the color for disabled tab. -`RemoveTabIndexN` = `{boolean}` . `N` is `integer` equivalent if tab index. +```ini +[SOMETABCONTROL] ; XNATabControl +RemapColor=255,255,255 ; color string, the tab text color. +TextColor=255,255,255 ; color string, the tab text color. +TextColorDisabled=255,255,255 ; color string, the color for disabled tab. +RemoveTabIndexN=false ; boolean, `N` is `integer` equivalent of tab index. +; RemoveTabIndex0=true +``` #### [XNATextBox](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNATextBox.cs) _(inherits [XNAControl](#XNAControl))_ - -`MaximumTextLength` = `{integer}` set maximum input string length. +```ini +[SOMETEXTBOX] ; XNATextBox +MaximumTextLength=10 ; integer, set maximum input string length. +``` #### [XNASuggestionTextBox](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNASuggestionTextBox.cs) _(inherits [XNAControl](#XNATextBox))_ - -`Suggestion` = `{string}` set default background text when no text has typed. +```ini +[SOMESUGGESTIONTEXTBOX] ; XNASuggestionTextBox +Suggestion=Type some text here... ; string, set default background text when no text has typed. +``` ### Basic Control Property Examples ```ini @@ -231,52 +294,108 @@ Some controls are only available under specific circumstances. #### XNAOptionsPanel Controls Following controls are only available as children of `XNAOptionsPanel` and derived controls. These currently use basic control properties only. -##### SettingCheckBox -_(inherits XNAClientCheckBox)_ - -`DefaultValue` = `{boolean}` default state of the checkbox. Value of `Checked` will be used if it is set and this isn't. Otherwise defaults to `false`. -`SettingSection` = `{string}` name of the section in settings INI the setting is saved to. Defaults to `CustomSettings`. -`SettingKey` = `{string}` name of the key in settings INI the setting is saved to. Defaults to `CONTROLNAME_Value` if `WriteSettingValue` is set, otherwise `CONTROLNAME_Checked`. -`WriteSettingValue` = `{boolean}` enable to write a specific string value to setting INI key instead of the checked state of the checkbox. Defaults to `false`. -`EnabledSettingValue` = `{string}` value to write to setting INI key if `WriteSettingValue` is set and checkbox is checked. -`DisabledSettingValue` = `{string}` value to write to setting INI key if `WriteSettingValue` is set and checkbox is not checked. -`RestartRequired` = `{boolean}` whether or not this setting requires restarting the client to apply. Defaults to `false`. -`ParentCheckBoxName` = `{string}` name of a `XNAClientCheckBox` control to use as a parent checkbox that is required to either be checked or unchecked, depending on value of `ParentCheckBoxRequiredValue` for this checkbox to be enabled. Only works if name can be resolved to an existing control belonging to same parent as current checkbox. -`ParentCheckBoxRequiredValue` = `{boolean}` state required from the parent checkbox for this one to be enabled. Defaults to `true`. - -##### FileSettingCheckBox -_(inherits XNAClientCheckBox)_ - -`DefaultValue` = `{boolean}` default state of the checkbox. Value of `Checked` will be used if it is set and this isn't. Otherwise defaults to `false`. -`SettingSection` = `{string}` name of the section in settings INI the setting is saved to. Defaults to `CustomSettings`. -`SettingKey` = `{string}` name of the key in settings INI the setting is saved to. Defaults to `CONTROLNAME_Value` if `WriteSettingValue` is set, otherwise `CONTROLNAME_Checked`. -`RestartRequired` = `{boolean}` whether or not this setting requires restarting the client to apply. Defaults to `false`. -`ParentCheckBoxName` = `{string}` name of a `XNAClientCheckBox` control to use as a parent checkbox that is required to either be checked or unchecked, depending on value of `ParentCheckBoxRequiredValue` for this checkbox to be enabled. Only works if name can be resolved to an existing control belonging to same parent as current checkbox. -`ParentCheckBoxRequiredValue` = `{boolean}` state required from the parent checkbox for this one to be enabled. Defaults to `true`. -`CheckAvailability` = `{boolean}` if set, whether or not the checkbox can be (un)checked depends on if the files to copy are actually present. Defaults to `false`. -`ResetUnavailableValue` = `{boolean}` if set together with `CheckAvailability`, checkbox set to a value that is unavailable will be reset back to `DefaultValue`. Defaults to `false`. -`EnabledFileN` = `{comma-separated strings}` files to copy if checkbox is checked. N starts from 0 and is incremented by 1 until no value is found. Expects 2-3 comma-separated strings in following format: source path relative to game root folder, destination path relative to game root folder and a [file operation option](#appendix-file-operation-options). -`DisabledFileN` = `{comma-separated strings}` files to copy if checkbox is not checked. N starts from 0 and is incremented by 1 until no value is found. Expects 2-3 comma-separated strings in following format: source path relative to game root folder, destination path relative to game root folder and a [file operation option](#appendix-file-operation-options). - -##### SettingDropDown -_(inherits XNAClientDropDown)_ - -`Items` = `{comma-separated strings}` comma-separated list of strings to include as items to display on the dropdown control. -`DefaultValue` = `{integer}` default item index of the dropdown. Defaults to 0 (first item). -`SettingSection` = `{string}` name of the section in settings INI the setting is saved to. Defaults to `CustomSettings`. -`SettingKey` = `{string}` name of the key in settings INI the setting is saved to. Defaults to `CONTROLNAME_Value` if `WriteSettingValue` is set, otherwise `CONTROLNAME_SelectedIndex`. -`WriteSettingValue` = `{boolean}` enable to write selected item value to the setting INI key instead of the checked state of the checkbox. Defaults to `false`. -`RestartRequired` = `{boolean}` whether or not this setting requires restarting the client to apply. Defaults to `false`. - -##### FileSettingDropDown -_(inherits XNAClientDropDown)_ - -`Items` = `{comma-separated strings}` comma-separated list of strings to include as items to display on the dropdown control. -`DefaultValue` = `{integer}` default item index of the dropdown. Defaults to 0 (first item). -`SettingSection` = `{string}` name of the section in settings INI the setting is saved to. Defaults to `CustomSettings`. -`SettingKey` = `{string}` name of the key in settings INI the setting is saved to. Defaults to `CONTROLNAME_SelectedIndex`. -`RestartRequired` = `{boolean}` whether or not this setting requires restarting the client to apply. Defaults to `false`. -`ItemXFileN` = `{comma-separated strings}` files to copy when dropdown item X is selected. N starts from 0 and is incremented by 1 until no value is found. Expects 2-3 comma-separated strings in following format: source path relative to game root folder, destination path relative to game root folder and a [file operation option](#appendix-file-operation-options). +##### [SettingCheckBox](https://github.com/CnCNet/xna-cncnet-client/blob/develop/DTAConfig/Settings/SettingCheckBox.cs) +_(inherits [XNAClientCheckBox](#XNAClientCheckBox))_ +```ini +[SOMESETTINGCHECKBOX] ; SettingCheckBox +DefaultValue=false ; boolean, default state of the checkbox. Value of `Checked` will be used + ; if it is set and this isn't. Otherwise defaults to `false`. +SettingSection=CustomSettings ; string, name of the section in settings INI the setting is saved to. + ; Defaults to `CustomSettings`. +SettingKey=Key ; string, name of the key in settings INI the setting is saved to. + ; Defaults to `CONTROLNAME_Value` if `WriteSettingValue` is set, + ; otherwise `CONTROLNAME_Checked`. +WriteSettingValue=true ; boolean, enable to write a specific string value to setting INI key + ; instead of the checked state of the checkbox. Defaults to `false`. +EnabledSettingValue=true ; string, value to write to setting INI key if `WriteSettingValue` + ; is set and checkbox is checked. +DisabledSettingValue=false ; string, value to write to setting INI key if `WriteSettingValue` + ; is set and checkbox is not checked. +RestartRequired=no ; boolean, whether or not this setting requires restarting the client to apply. + ; Defaults to `false`. +ParentCheckBoxName=SomeParent ; string, name of a `XNAClientCheckBox` control to use as a parent checkbox + ; that is required to either be checked or unchecked, depending on value + ; of ParentCheckBoxRequiredValue for this checkbox to be enabled. + ; Only works if name can be resolved to an existing control belonging + ; to same parent as current checkbox. +ParentCheckBoxRequiredValue=true ; boolean, state required from the parent checkbox for this one to be enabled. + ; Defaults to `true`. +``` + +##### [FileSettingCheckBox](https://github.com/CnCNet/xna-cncnet-client/blob/develop/DTAConfig/Settings/FileSettingCheckBox.cs) +_(inherits [XNAClientCheckBox](#XNAClientCheckBox))_ +```ini +[SOMEFILESETTINGCHECKBOX] ; FileSettingCheckBox +DefaultValue=false ; boolean, default state of the checkbox. Value of `Checked` + ; will be used if it is set and this isn't. Otherwise defaults to `false`. +SettingSection=Settings ; string, name of the section in settings INI the setting is saved to. + ; Defaults to `CustomSettings`. +SettingKey=ThisKey ; string, name of the key in settings INI the setting is saved to. + ; Defaults to `CONTROLNAME_Value` if `WriteSettingValue` is set, + ; otherwise `CONTROLNAME_Checked`. +RestartRequired=yes ; boolean, whether or not this setting requires restarting the client to apply. + ; Defaults to `false`. +ParentCheckBoxName=SomeParent ; string, name of a `XNAClientCheckBox` control to use as a parent checkbox that + ; is required to either be checked or unchecked, depending on value of + ; `ParentCheckBoxRequiredValue` for this checkbox to be enabled. + ; Only works if name can be resolved to an existing control belonging + ; to same parent as current checkbox. +ParentCheckBoxRequiredValue=true ; boolean, state required from the parent checkbox for this one to be enabled. + ; Defaults to `true`. +CheckAvailability=true ; boolean, if set, whether or not the checkbox can be (un)checked depends on if + ; the files to copy are actually present. Defaults to `false`. +ResetUnavailableValue=no ; boolean, if set together with `CheckAvailability`, checkbox set to a value that + ; is unavailable will be reset back to `DefaultValue`. Defaults to `false`. +EnabledFileN=a.cfg,src/q.cfg ; comma-separated strings, + ; files to copy if checkbox is checked. + ; `N` starts from 0 and is incremented by 1 until no value is found. + ; Expects 2-3 comma-separated strings in following format: + ; source path relative to game root folder, destination path + ; relative to game root folder and a file operation option + ; (see #appendix-file-operation-options). +DisabledFileN=b.cfg,src/q.cfg,KeepChanges ; comma-separated strings, + ; files to copy if checkbox is not checked. + ; `N` starts from 0 and is incremented by 1 until no value is found. + ; Expects 2-3 comma-separated strings in following format: + ; source path relative to game root folder, destination path + ; relative to game root folder and a file operation option + ; (see #appendix-file-operation-options). +``` + +##### [SettingDropDown](https://github.com/CnCNet/xna-cncnet-client/blob/develop/DTAConfig/Settings/SettingDropDown.cs) +_(inherits [XNAClientDropDown](#XNAClientDropDown))_ +```ini +[SOMESETTINGDROPDOWN] ; SettingDropDown +Items=0,1,2,3,4 ; comma-separated strings, + ; comma-separated list of strings to include as items to display on the dropdown control. +DefaultValue=0 ; integer, default item index of the dropdown. Defaults to 0 (first item). +SettingSection=section ; string, name of the section in settings INI the setting is saved to. Defaults to `CustomSettings`. +SettingKey=key ; string, name of the key in settings INI the setting is saved to. Defaults to `CONTROLNAME_Value` + ; if `WriteSettingValue` is set, otherwise `CONTROLNAME_SelectedIndex`. +WriteSettingValue=true ; boolean, enable to write selected item value to the setting INI key instead of the + ; checked state of the checkbox. Defaults to `false`. +RestartRequired=true ; boolean, whether or not this setting requires restarting the client to apply. Defaults to `false`. +``` + +##### [FileSettingDropDown](https://github.com/CnCNet/xna-cncnet-client/blob/develop/DTAConfig/Settings/FileSettingDropDown.cs) +_(inherits [XNAClientDropDown](#XNAClientDropDown))_ +```ini +[SOMEFILESETTINGDROPDOWN] ; FileSettingDropDown +Items=1st,2nd,3rd ; comma-separated strings, + ; comma-separated list of strings to include as items to display on the dropdown control. +DefaultValue=1 ; integer, default item index of the dropdown. Defaults to 0 (first item). +SettingSection=MySection ; string, name of the section in settings INI the setting is saved to. Defaults to `CustomSettings`. +SettingKey=MyKey ; string, name of the key in settings INI the setting is saved to. + ; Defaults to `CONTROLNAME_SelectedIndex`. +RestartRequired=false ; boolean, whether or not this setting requires restarting the client to apply. Defaults to `false`. +ItemXFileN=src/a.ini,b.ini ; comma-separated strings, + ; files to copy when dropdown item `X` is selected. + ; `N` starts from 0 and is incremented by 1 until no value is found. + ; Expects 2-3 comma-separated strings in following format: + ; source path relative to game root folder, + ; destination path relative to game root folder and a file operation option + ; (see #appendix-file-operation-options). +``` ##### Appendix: File Operation Options Valid file operation options available for files defined for `FileSettingCheckBox` and `FileSettingDropDown` are as follows: @@ -287,15 +406,18 @@ Valid file operation options available for files defined for `FileSettingCheckBo - `KeepChanges`: Carries over the destination file with any changes manually made to by caching the file if deleted by disabling the option and then re-enabling it. ### Dynamic Control Properties -Dynamic Control Properties CAN use constants +Dynamic Control Properties CAN use constants. -These can ONLY be used in parent controls that inherit the `INItializableWindow` class +These can ONLY be used in parent controls that inherit the `INItializableWindow` class. -`$X` = `{integer}` the X location of the control -`$Y` = `{integer}` the Y location of the control -`$Width` = `{integer}` the Width of the control -`$Height` = `{integer}` the Height of the control -`$TextAnchor` +```ini +$X=10 ; integer, the X location of the control +$Y=20 ; integer, the Y location of the control +$Width=50 ; integer, the Width of the control +$Height=10 ; integer, the Height of the control +$TextAnchor=LEFT ; enum (NONE | LEFT | RIGHT | HORIZONTAL_CENTER | TOP | BOTTOM | VERTICAL_CENTER), + ; this will set a text anchor in label draw box. +``` ### Dynamic Control Property Examples ```ini From 667b12cb828a5609e9c4703d54a2c9080b9dfb4f Mon Sep 17 00:00:00 2001 From: MahBoiDeveloper Date: Tue, 26 Nov 2024 17:41:28 +0300 Subject: [PATCH 10/15] Replace `color string` to `color` Co-authored-by: Metadorius --- Docs/INISystem.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docs/INISystem.md b/Docs/INISystem.md index 23d9e40ed..696f2ac35 100644 --- a/Docs/INISystem.md +++ b/Docs/INISystem.md @@ -22,7 +22,7 @@ _NOTE: Constants can only be used in [dynamic control properties](#dynamic-contr ### Data Types - The `text` use `@` as a line break. To write the real `@` character, use `\@`. Also as INI syntax uses `;` to denote comments, use `\semicolon` to write the real `;` character. -- The `color string` use form `R,G,B` or `R,G,B,A`. All values must be between `0` and `255`. +- The `color` use string form `R,G,B` or `R,G,B,A`. All values must be between `0` and `255`. Example: `255,255,255`, `255,255,255,255`. - The `boolean` string value parses as `true` if it contains one of these symbol as first character: `t`, `y`, `1`, `a`, `e`; and if first symbol is `n`, `f`, `0`, then it parses as `false`. - The `integer` type is actually `System.Int32`. - The `float` type is actually `System.Single`. From 11b923044f9b833f0088671320d15f35aafb94ad Mon Sep 17 00:00:00 2001 From: mah_boi <61310813+MahBoiDeveloper@users.noreply.github.com> Date: Tue, 26 Nov 2024 17:49:14 +0300 Subject: [PATCH 11/15] Update Docs/INISystem.md Co-authored-by: Kerbiter --- Docs/INISystem.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docs/INISystem.md b/Docs/INISystem.md index 696f2ac35..f61a7607e 100644 --- a/Docs/INISystem.md +++ b/Docs/INISystem.md @@ -26,7 +26,7 @@ _NOTE: Constants can only be used in [dynamic control properties](#dynamic-contr - The `boolean` string value parses as `true` if it contains one of these symbol as first character: `t`, `y`, `1`, `a`, `e`; and if first symbol is `n`, `f`, `0`, then it parses as `false`. - The `integer` type is actually `System.Int32`. - The `float` type is actually `System.Single`. -- The `N integers` or `N floats` is a `integer` or `float` type values repeated `N` times, but separated with `,` character without spaces e.g., `0,0` or `0.0,0.0` respectively. +- The `N integers` or `N floats` is a `integer` or `float` type values repeated `N` times, but separated with `,` character without spaces e.g., `0,0` or `0.0,0.0` for `2 integers` or `2 floats` respectively. - The `comma-separated strings` is a string, but separated with `,` character without spaces e.g., `one,two,three`. From bc5ac954dc3b753db3e5c1d0bee9a311a1e4a201 Mon Sep 17 00:00:00 2001 From: MahBoiDeveloper Date: Tue, 26 Nov 2024 19:17:00 +0300 Subject: [PATCH 12/15] Add \n from request Co-authored-by: Metadorius --- Docs/INISystem.md | 56 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) diff --git a/Docs/INISystem.md b/Docs/INISystem.md index f61a7607e..c961b1113 100644 --- a/Docs/INISystem.md +++ b/Docs/INISystem.md @@ -10,10 +10,13 @@ The `[ParserConstants]` section of the `GlobalThemeSettings.ini` file contains c `RESOLUTION_HEIGHT`: the height of the window when it is initialized ### User Defined Constants + ```ini MY_EXAMPLE_CONSTANT=15 ``` + The above user-defined or system constants can be used elsewhere as: + ```ini [MyExampleControl] $X=MY_EXAMPLE_CONSTANT @@ -21,6 +24,7 @@ $X=MY_EXAMPLE_CONSTANT _NOTE: Constants can only be used in [dynamic control properties](#dynamic-control-properties)_ ### Data Types + - The `text` use `@` as a line break. To write the real `@` character, use `\@`. Also as INI syntax uses `;` to denote comments, use `\semicolon` to write the real `;` character. - The `color` use string form `R,G,B` or `R,G,B,A`. All values must be between `0` and `255`. Example: `255,255,255`, `255,255,255,255`. - The `boolean` string value parses as `true` if it contains one of these symbol as first character: `t`, `y`, `1`, `a`, `e`; and if first symbol is `n`, `f`, `0`, then it parses as `false`. @@ -31,9 +35,11 @@ _NOTE: Constants can only be used in [dynamic control properties](#dynamic-contr ## Control properties + Below lists basic and dynamic control properties. Ordering of properties is important. If there is a property that relies on the size of a control, the properties must set the size of that control first. ### Basic Control Properties + Basic control properties cannot use constants. > [!WARNING] > Do not copy-paste ini-code below without edits because it won't work! It shows only how to work with properties. @@ -44,7 +50,9 @@ Basic control properties cannot use constants. > - and many others. #### [XNAControl](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAControl.cs) + - Basic class inherited by any other control element. + ```ini [SOMECONTROL] ; XNAControl X=0 ; integer, the X location of the control. @@ -76,7 +84,9 @@ ControlDrawMode=Normal ; enum (UniqueRenderTarget | Normal), ``` #### [XNAIndicator](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAIndicator.cs) + _(inherits [XNAControl](#XNAControl))_ + ```ini [SOMEINDICATOR] ; XNAIndicator FontIndex=0 ; integer, the index of font loaded from font list. Default value is `0`. @@ -87,7 +97,9 @@ AlphaRate=0.02 ; float, the indicator's transparency changing ``` #### [XNAPanel](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAPanel.cs) + _(inherits [XNAControl](#XNAControl))_ + ```ini [SOMEPANEL] ; XNAPanel BorderColor=255,255,255 ; color string, this will set a border color based. @@ -108,21 +120,27 @@ DrawMode=Centered ; enum (Tiled | Centered | Stretched), t ``` #### [XNAExtraPanel](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNAExtraPanel.cs) + _(inherits [XNAPanel](#XNAPanel))_ + ```ini [SOMEEXTRAPANEL] ; XNAExtraPanel BackgroundTexture=back.png ; string, same as XNAControl's `BackgroundTexture`. ``` #### [XNATextBlock](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNATextBlock.cs) + _(inherits [XNAPanel](#XNAPanel))_ + ```ini [SOMETEXTBLOCK] ; XNATextBlock TextColor=255,255,255 ; color string, defines text color for text block. ``` #### [XNAMultiColumnListBox](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAMultiColumnListBox.cs) + _(inherits [XNAPanel](#XNAPanel))_ + ```ini [SOMEMULTICOLUMBLISTBOX] ; XNAMultiColumnListBox FontIndex=0 ; integer, the index of font loaded from font list. Default value is `0`. @@ -135,7 +153,9 @@ ListBoxYAttribute:Attrname=Value ; string, allows setting list box attri ``` #### [XNATrackbar](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNATrackbar.cs) + _(inherits [XNAPanel](#XNAPanel))_ + ```ini [SOMETRACKBAR] ; XNATrackbar MinValue=1 ; integer, the minumum value available for XNATrackbar. Default value is `0`. @@ -145,7 +165,9 @@ ClickSound=click.wav ; string, loads a sound with the specific file name with su ``` #### [XNALabel](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAButton.cs) + _(inherits [XNAControl](#XNAControl))_ + ```ini [SOMELABEL] ; XNALabel RemapColor=255,255,255 ; color string, same as XNAControl's `RemapColor`. @@ -158,7 +180,9 @@ TextAnchor=TOP ; enum (NONE | LEFT | RIGHT | HORIZONTAL_CENTER | TOP | ``` #### [XNAButton](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAButton.cs) + _(inherits [XNAControl](#XNAControl))_ + ```ini [SOMEBUTTON] ; XNAButton TextColorIdle=255,255,255 ; color string, the text color when cursor isn't above the button. @@ -177,7 +201,9 @@ TextShadowDistance=0.03 ; float, the distance between text and ``` #### [XNAClientButton](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNAClientButton.cs) + _(inherits [XNAButton](#XNAButton))_ + ```ini [SOMECLIENTBUTTON] ; XNAClientButton MatchTextureSize=true ; boolean, the button's width and height will match its texture properties. @@ -186,7 +212,9 @@ ToolTip=Big and helpful tooltip. ; text, the tooltip for button. ``` #### [XNALinkButton](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNALinkButton.cs) + _(inherits [XNAClientButton](#XNAClientButton))_ + ```ini [SOMELINKBUTTON] ; XNALinkButton URL=https://www.cncnet.org ; `{string}` the URL-link for OS Windows. @@ -195,7 +223,9 @@ Arguments=1 2 3 4 ; `{string}` the arguments separated with space f ``` #### [XNACheckbox](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNACheckBox.cs) + _(inherits [XNAControl](#XNAControl))_ + ```ini [SOMECHECKBOX] ; XNACheckbox FontIndex=0 ; integer, the index of font loaded from font list. Default value is `0`. @@ -209,14 +239,18 @@ Checked=no ; boolean, the default checkbox status. Default ``` #### [XNAClientCheckbox](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNAClientCheckBox.cs) + _(inherits [XNACheckBox](#XNACheckbox))_ + ```ini [SOMECLIENTCHECKBOX] ; XNAClientCheckbox ToolTip=Some Text ; text, the tooltip for checkbox. ``` #### [XNADropDown](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNADropDown.cs) + _(inherits [XNAControl](#XNAControl))_ + ```ini [SOMEDROPDOWN] ; XNADropDown OpenUp=false ; boolean, defines open/close default status. @@ -240,14 +274,18 @@ OptionX=First ; string, the text option for dropdown. `X ``` #### [XNAClientDropDown](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNAClientCheckBox.cs) + _(inherits XNADropDown)_ + ```ini [SOMECLIENTDROPDOWN] ; XNAClientDropDown ToolTip=Some Text ; text, tooltip for dropdown. ``` #### [XNATabControl](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNATabControl.cs) + _(inherits [XNAControl](#XNAControl))_ + ```ini [SOMETABCONTROL] ; XNATabControl RemapColor=255,255,255 ; color string, the tab text color. @@ -258,20 +296,25 @@ RemoveTabIndexN=false ; boolean, `N` is `integer` equivalent of tab ``` #### [XNATextBox](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNATextBox.cs) + _(inherits [XNAControl](#XNAControl))_ + ```ini [SOMETEXTBOX] ; XNATextBox MaximumTextLength=10 ; integer, set maximum input string length. ``` #### [XNASuggestionTextBox](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNASuggestionTextBox.cs) + _(inherits [XNAControl](#XNATextBox))_ + ```ini [SOMESUGGESTIONTEXTBOX] ; XNASuggestionTextBox Suggestion=Type some text here... ; string, set default background text when no text has typed. ``` ### Basic Control Property Examples + ```ini [lblExample] X=100 @@ -289,13 +332,17 @@ FillHeight=10 ``` ### Special Controls & Their Properties + Some controls are only available under specific circumstances. #### XNAOptionsPanel Controls + Following controls are only available as children of `XNAOptionsPanel` and derived controls. These currently use basic control properties only. ##### [SettingCheckBox](https://github.com/CnCNet/xna-cncnet-client/blob/develop/DTAConfig/Settings/SettingCheckBox.cs) + _(inherits [XNAClientCheckBox](#XNAClientCheckBox))_ + ```ini [SOMESETTINGCHECKBOX] ; SettingCheckBox DefaultValue=false ; boolean, default state of the checkbox. Value of `Checked` will be used @@ -323,7 +370,9 @@ ParentCheckBoxRequiredValue=true ; boolean, state required from the parent check ``` ##### [FileSettingCheckBox](https://github.com/CnCNet/xna-cncnet-client/blob/develop/DTAConfig/Settings/FileSettingCheckBox.cs) + _(inherits [XNAClientCheckBox](#XNAClientCheckBox))_ + ```ini [SOMEFILESETTINGCHECKBOX] ; FileSettingCheckBox DefaultValue=false ; boolean, default state of the checkbox. Value of `Checked` @@ -363,7 +412,9 @@ DisabledFileN=b.cfg,src/q.cfg,KeepChanges ; comma-separated strings, ``` ##### [SettingDropDown](https://github.com/CnCNet/xna-cncnet-client/blob/develop/DTAConfig/Settings/SettingDropDown.cs) + _(inherits [XNAClientDropDown](#XNAClientDropDown))_ + ```ini [SOMESETTINGDROPDOWN] ; SettingDropDown Items=0,1,2,3,4 ; comma-separated strings, @@ -378,7 +429,9 @@ RestartRequired=true ; boolean, whether or not this setting requires restartin ``` ##### [FileSettingDropDown](https://github.com/CnCNet/xna-cncnet-client/blob/develop/DTAConfig/Settings/FileSettingDropDown.cs) + _(inherits [XNAClientDropDown](#XNAClientDropDown))_ + ```ini [SOMEFILESETTINGDROPDOWN] ; FileSettingDropDown Items=1st,2nd,3rd ; comma-separated strings, @@ -398,6 +451,7 @@ ItemXFileN=src/a.ini,b.ini ; comma-separated strings, ``` ##### Appendix: File Operation Options + Valid file operation options available for files defined for `FileSettingCheckBox` and `FileSettingDropDown` are as follows: - `AlwaysOverwrite`: Always overwrites the destination file with source file. @@ -406,6 +460,7 @@ Valid file operation options available for files defined for `FileSettingCheckBo - `KeepChanges`: Carries over the destination file with any changes manually made to by caching the file if deleted by disabling the option and then re-enabling it. ### Dynamic Control Properties + Dynamic Control Properties CAN use constants. These can ONLY be used in parent controls that inherit the `INItializableWindow` class. @@ -420,6 +475,7 @@ $TextAnchor=LEFT ; enum (NONE | LEFT | RIGHT | HORIZONTAL_CENTER | TOP | BOTTOM ``` ### Dynamic Control Property Examples + ```ini [lblExample] $X=100 From e19e711396acba67add64851411d1dbac3ef9cb4 Mon Sep 17 00:00:00 2001 From: MahBoiDeveloper Date: Tue, 26 Nov 2024 21:31:44 +0300 Subject: [PATCH 13/15] Update keys default values --- Docs/INISystem.md | 375 +++++++++++++++++++++++----------------------- 1 file changed, 184 insertions(+), 191 deletions(-) diff --git a/Docs/INISystem.md b/Docs/INISystem.md index c961b1113..c2504e95a 100644 --- a/Docs/INISystem.md +++ b/Docs/INISystem.md @@ -54,33 +54,33 @@ Basic control properties cannot use constants. - Basic class inherited by any other control element. ```ini -[SOMECONTROL] ; XNAControl -X=0 ; integer, the X location of the control. -Y=0 ; integer, the Y location of the control. -Location=50,100 ; 2 integers, the X and Y location of the control. -Width=25 ; integer, the Width of the control. -Height=10 ; integer, the Height of the control. -Size=60,30 ; 2 integers, the Width and Height of the control. -Text=Some Text@Example ; text, the text to display for the control (ex: buttons, labels, etc...). -Visible=yes ; boolean, whether or not the control should be visible by default. -Enabled=yes ; boolean, whether or not the control should be enabled by default. -DistanceFromRightBorder=5 ; integer, the distance of the right edge of this control from - ; the right edge of its parent. This control MUST have a parent. -DistanceFromBottomBorder=3 ; integer, the distance of the bottom edge of this control from the - ; bottom edge of its parent. This control MUST have a parent. -FillWidth=2 ; integer, this will set the width of this control to fill - ; the parent/window MINUS this value, starting from the its X position. -FillHeight=1 ; integer, this will set the height of this control to fill - ; the parent/window MINUS this value, starting from the its Y position. -DrawOrder=0 ; integer, determine the layering order of the control within - ; its parent control's list of child controls. -UpdateOrder=0 ; integer, determine the layering order of the control within - ; its parent control's list of child controls. -RemapColor= ; color string, this will set a theme defined color based. -ControlDrawMode=Normal ; enum (UniqueRenderTarget | Normal), - ; this will set render option to draw control on its own render - ; target (`UniqueRenderTarget`) or to draw control on - ; the same render target with its parent (`Normal`). +[SOMECONTROL] ; XNAControl +X= ; integer, the X location of the control. +Y= ; integer, the Y location of the control. +Location= ; 2 integers, the X and Y location of the control. +Width= ; integer, the Width of the control. +Height= ; integer, the Height of the control. +Size= ; 2 integers, the Width and Height of the control. +Text= ; text, the text to display for the control (ex: buttons, labels, etc...). +Visible=true ; boolean, whether or not the control should be visible by default. +Enabled=true ; boolean, whether or not the control should be enabled by default. +DistanceFromRightBorder=0 ; integer, the distance of the right edge of this control from + ; the right edge of its parent. This control MUST have a parent. +DistanceFromBottomBorder=0 ; integer, the distance of the bottom edge of this control from the + ; bottom edge of its parent. This control MUST have a parent. +FillWidth=0 ; integer, this will set the width of this control to fill + ; the parent/window MINUS this value, starting from the its X position. +FillHeight=0 ; integer, this will set the height of this control to fill + ; the parent/window MINUS this value, starting from the its Y position. +DrawOrder=0 ; integer, determine the layering order of the control within + ; its parent control's list of child controls. +UpdateOrder=0 ; integer, determine the layering order of the control within + ; its parent control's list of child controls. +RemapColor= ; color, this will set a theme defined color based. +ControlDrawMode=UniqueRenderTarget ; enum (UniqueRenderTarget | Normal), + ; this will set render option to draw control on its own render + ; target (`UniqueRenderTarget`) or to draw control on + ; the same render target with its parent (`Normal`). ``` #### [XNAIndicator](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAIndicator.cs) @@ -88,12 +88,11 @@ ControlDrawMode=Normal ; enum (UniqueRenderTarget | Normal), _(inherits [XNAControl](#XNAControl))_ ```ini -[SOMEINDICATOR] ; XNAIndicator -FontIndex=0 ; integer, the index of font loaded from font list. Default value is `0`. -HighlightColor=255,255,255 ; color string, the text color when cursor above the `XNAIndicator`. -AlphaRate=0.02 ; float, the indicator's transparency changing rate per 100 milliseconds. - ; If the indicator is transparent, it'll become non-transparent at this rate. - ; Default value is `0.01`. +[SOMEINDICATOR] ; XNAIndicator +FontIndex=0 ; integer, the index of font loaded from font list. Default value is `0`. +HighlightColor= ; color, the text color when cursor above the `XNAIndicator`. +AlphaRate=0.1 ; float, the indicator's transparency changing rate per 100 milliseconds. + ; If the indicator is transparent, it'll become non-transparent at this rate. ``` #### [XNAPanel](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAPanel.cs) @@ -101,22 +100,21 @@ AlphaRate=0.02 ; float, the indicator's transparency changing _(inherits [XNAControl](#XNAControl))_ ```ini -[SOMEPANEL] ; XNAPanel -BorderColor=255,255,255 ; color string, this will set a border color based. -AlphaRate=0.05 ; float, the panel's transparency changing rate per 100 milliseconds. - ; If the panel is transparent, it'll become non-transparent at this rate. - ; Default value is `0.01`. -BackgroundTexture=back.png ; string, loads a texture with the specific file name with suffix. - ; If the texture isn't found from any asset search path, - ; returns a dummy texture. -SolidColorBackgroundTexture=255,255,255 ; color string, this will set background color stretched texture instead of - ; user defined picture. -DrawBorders=true ; boolean, enables or disables borders drawing for control. - ; Borders enabled by default. -Padding=10,5,10,5 ; 4 integers, css-like panel padding in client window e.g., - ; `1,2,3,4` where `1` - left, `2` - top, `3` - right, `4` - bottom. -DrawMode=Centered ; enum (Tiled | Centered | Stretched), this will set draw mode for panel. - ; Default value is `Stretched`. +[SOMEPANEL] ; XNAPanel +BorderColor= ; color, this will set a border color based. +AlphaRate=0.01 ; float, the panel's transparency changing rate per 100 milliseconds. + ; If the panel is transparent, it'll become non-transparent at this rate. +BackgroundTexture= ; string, loads a texture with the specific file name with suffix. + ; If the texture isn't found from any asset search path, + ; returns a dummy texture. +SolidColorBackgroundTexture= ; color, this will set background color stretched texture instead of + ; user defined picture. +DrawBorders=true ; boolean, enables or disables borders drawing for control. + ; Borders enabled by default. +Padding= ; 4 integers, css-like panel padding in client window e.g., + ; `1,2,3,4` where `1` - left, `2` - top, `3` - right, `4` - bottom. +DrawMode=Stretched ; enum (Tiled | Centered | Stretched), + ; this will set draw mode for panel. ``` #### [XNAExtraPanel](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNAExtraPanel.cs) @@ -124,8 +122,8 @@ DrawMode=Centered ; enum (Tiled | Centered | Stretched), t _(inherits [XNAPanel](#XNAPanel))_ ```ini -[SOMEEXTRAPANEL] ; XNAExtraPanel -BackgroundTexture=back.png ; string, same as XNAControl's `BackgroundTexture`. +[SOMEEXTRAPANEL] ; XNAExtraPanel +BackgroundTexture= ; string, same as XNAControl's `BackgroundTexture`. ``` #### [XNATextBlock](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNATextBlock.cs) @@ -133,8 +131,8 @@ BackgroundTexture=back.png ; string, same as XNAControl's `BackgroundTexture`. _(inherits [XNAPanel](#XNAPanel))_ ```ini -[SOMETEXTBLOCK] ; XNATextBlock -TextColor=255,255,255 ; color string, defines text color for text block. +[SOMETEXTBLOCK] ; XNATextBlock +TextColor= ; color, defines text color for text block. ``` #### [XNAMultiColumnListBox](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAMultiColumnListBox.cs) @@ -143,10 +141,10 @@ _(inherits [XNAPanel](#XNAPanel))_ ```ini [SOMEMULTICOLUMBLISTBOX] ; XNAMultiColumnListBox -FontIndex=0 ; integer, the index of font loaded from font list. Default value is `0`. +FontIndex=0 ; integer, the index of font loaded from font list. DrawSelectionUnderScrollbar=yes ; boolean, enable/disable scroll bar, default value is `true`. -ColumnWidthN=0 ; integer, the default columns width in pixels. `N` is integer column index. -ColumnX=Number,0 ; string:integer, the column definition. `string` is a column header text. +ColumnWidthN= ; integer, the default columns width in pixels. `N` is integer column index. +ColumnX= ; string:integer, the column definition. `string` is a column header text. ; `integer` is a column width in pixels. `X` is an any text. ListBoxYAttribute:Attrname=Value ; string, allows setting list box attributes. `Attrname` is column attribute. ; `Value` is column attribute value. @@ -157,26 +155,26 @@ ListBoxYAttribute:Attrname=Value ; string, allows setting list box attri _(inherits [XNAPanel](#XNAPanel))_ ```ini -[SOMETRACKBAR] ; XNATrackbar -MinValue=1 ; integer, the minumum value available for XNATrackbar. Default value is `0`. -MaxValue=9 ; integer, the maximum value available for XNATrackbar. Default value is `10`. -Value=4 ; integer, the default value available for XNATrackbar. Default value is `0`. -ClickSound=click.wav ; string, loads a sound with the specific file name with suffix as XNATrackbar click sound. +[SOMETRACKBAR] ; XNATrackbar +MinValue=0 ; integer, the minumum value available for XNATrackbar. +MaxValue=10 ; integer, the maximum value available for XNATrackbar. +Value=0 ; integer, the default value available for XNATrackbar. +ClickSound= ; string, loads a sound with the specific file name with suffix as XNATrackbar click sound. ``` -#### [XNALabel](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAButton.cs) +#### [XNALabel](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNALabel.cs) _(inherits [XNAControl](#XNAControl))_ ```ini -[SOMELABEL] ; XNALabel -RemapColor=255,255,255 ; color string, same as XNAControl's `RemapColor`. -TextColor=255,255,255 ; color string, determine color of the text in label. -FontIndex=0 ; integer, the index of font loaded from font list. Default value is `0`. -AnchorPoint=0.5,0.5 ; 2 floats, this will set a label's text start drawing point. Default value is `0.0,0.0` -TextShadowDistance=0.04 ; float, the distance between text and its shadow. -TextAnchor=TOP ; enum (NONE | LEFT | RIGHT | HORIZONTAL_CENTER | TOP | BOTTOM | VERTICAL_CENTER), - ; this will set a text anchor in label draw box. +[SOMELABEL] ; XNALabel +RemapColor= ; color, same as XNAControl's `RemapColor`. +TextColor= ; color, determine color of the text in label. +FontIndex=0 ; integer, the index of font loaded from font list. +AnchorPoint=0.0,0.0 ; 2 floats, this will set a label's text start drawing point. +TextShadowDistance=0.1 ; float, the distance between text and its shadow. +TextAnchor= ; enum (NONE | LEFT | RIGHT | HORIZONTAL_CENTER | TOP | BOTTOM | VERTICAL_CENTER), + ; this will set a text anchor in label draw box. ``` #### [XNAButton](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAButton.cs) @@ -184,20 +182,19 @@ TextAnchor=TOP ; enum (NONE | LEFT | RIGHT | HORIZONTAL_CENTER | TOP | _(inherits [XNAControl](#XNAControl))_ ```ini -[SOMEBUTTON] ; XNAButton -TextColorIdle=255,255,255 ; color string, the text color when cursor isn't above the button. -TextColorHover=255,255,255 ; color string, the text color when cursor above the button. -HoverSoundEffect=hover_button.wav ; string, loads a sound with the specific file name with suffix as button hover sound. -ClickSoundEffect=click_button.wav ; string, loads a sound with the specific file name with suffix as button click sound. -AdaptiveText=enable ; boolean, specifies how the client should change the start text drawing position - ; in the button to fill all the free space. Default value is `true`. -AlphaRate=0.04 ; float, the button's transparency changing rate per 100 milliseconds. - ; If the button is transparent, it'll become non-transparent at this rate. - ; Default value is `0.01`. -FontIndex=0 ; integer, the index of loaded from font list. Default value is `0`. -IdleTexture=button.png ; string, loads a texture with the specific file name with suffix as button idle texture. -HoverTexture=button_h.png ; string, loads a texture with the specific file name with suffix as button hover texture. -TextShadowDistance=0.03 ; float, the distance between text and its shadow. +[SOMEBUTTON] ; XNAButton +TextColorIdle= ; color, the text color when cursor isn't above the button. +TextColorHover= ; color, the text color when cursor above the button. +HoverSoundEffect= ; string, loads a sound with the specific file name with suffix as button hover sound. +ClickSoundEffect= ; string, loads a sound with the specific file name with suffix as button click sound. +AdaptiveText=true ; boolean, specifies how the client should change the start text drawing position + ; in the button to fill all the free space. Default value is `true`. +AlphaRate=0.01 ; float, the button's transparency changing rate per 100 milliseconds. + ; If the button is transparent, it'll become non-transparent at this rate. +FontIndex=0 ; integer, the index of loaded from font list. +IdleTexture= ; string, loads a texture with the specific file name with suffix as button idle texture. +HoverTexture= ; string, loads a texture with the specific file name with suffix as button hover texture. +TextShadowDistance=0.1 ; float, the distance between text and its shadow. ``` #### [XNAClientButton](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNAClientButton.cs) @@ -205,10 +202,9 @@ TextShadowDistance=0.03 ; float, the distance between text and _(inherits [XNAButton](#XNAButton))_ ```ini -[SOMECLIENTBUTTON] ; XNAClientButton -MatchTextureSize=true ; boolean, the button's width and height will match its texture properties. - ; Default value is `false`. -ToolTip=Big and helpful tooltip. ; text, the tooltip for button. +[SOMECLIENTBUTTON] ; XNAClientButton +MatchTextureSize= ; boolean, the button's width and height will match its texture properties. +ToolTip= ; text, the tooltip for button. ``` #### [XNALinkButton](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNALinkButton.cs) @@ -216,10 +212,10 @@ ToolTip=Big and helpful tooltip. ; text, the tooltip for button. _(inherits [XNAClientButton](#XNAClientButton))_ ```ini -[SOMELINKBUTTON] ; XNALinkButton -URL=https://www.cncnet.org ; `{string}` the URL-link for OS Windows. -UnixURL=https://www.cncnet.org ; `{string}` the URL-link for Unix-like OS. -Arguments=1 2 3 4 ; `{string}` the arguments separated with space for URL-link. +[SOMELINKBUTTON] ; XNALinkButton +URL= ; string, the URL-link for OS Windows. +UnixURL= ; string, the URL-link for Unix-like OS. +Arguments= ; string, the arguments separated with space for URL-link. ``` #### [XNACheckbox](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNACheckBox.cs) @@ -227,15 +223,14 @@ Arguments=1 2 3 4 ; `{string}` the arguments separated with space f _(inherits [XNAControl](#XNAControl))_ ```ini -[SOMECHECKBOX] ; XNACheckbox -FontIndex=0 ; integer, the index of font loaded from font list. Default value is `0`. -IdleColor=255,255,255 ; color string, the the text color when cursor isn't above the checkbox. -HighlightColor=255,255,255 ; color string, the text color when cursor above the checkbox. -AlphaRate=0.1 ; float, the checkbox's transparency changing rate per 100 milliseconds. - ; If the checkbox is transparent, it'll become non-transparent at this rate. - ; Default value is `0.01`. -AllowChecking=yes ; boolean, the allows user to check/uncheck checkbox. Default value is `true`. -Checked=no ; boolean, the default checkbox status. Default value is `true`. +[SOMECHECKBOX] ; XNACheckbox +FontIndex=0 ; integer, the index of font loaded from font list. +IdleColor= ; color, the the text color when cursor isn't above the checkbox. +HighlightColor= ; color, the text color when cursor above the checkbox. +AlphaRate=0.1 ; float, the checkbox's transparency changing rate per 100 milliseconds. + ; If the checkbox is transparent, it'll become non-transparent at this rate. +AllowChecking=true ; boolean, the allows user to check/uncheck checkbox. +Checked=true ; boolean, the default checkbox status. ``` #### [XNAClientCheckbox](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNAClientCheckBox.cs) @@ -244,7 +239,7 @@ _(inherits [XNACheckBox](#XNACheckbox))_ ```ini [SOMECLIENTCHECKBOX] ; XNAClientCheckbox -ToolTip=Some Text ; text, the tooltip for checkbox. +ToolTip= ; text, the tooltip for checkbox. ``` #### [XNADropDown](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNADropDown.cs) @@ -253,21 +248,21 @@ _(inherits [XNAControl](#XNAControl))_ ```ini [SOMEDROPDOWN] ; XNADropDown -OpenUp=false ; boolean, defines open/close default status. -DropDownTexture=dd.png ; string, loads a texture with the specific file name with suffix as - ; texture when dropdown closed. -DropDownOpenTexture=dd_open.png ; string, loads a texture with the specific file name with suffix as - ; texture when dropdown opened. -ItemHeight=10 ; integer, the height of each dropdown item in pixels. -ClickSoundEffect=dd_click.wav ; string, loads a sound with the specific file name with suffix as - ; dropdown click sound. -FontIndex=0 ; integer, the index of font loaded from font list. Default value is `0`. -BorderColor=255,255,255 ; color string, the color for dropdown's border line when it open. -FocusColor=255,255,255 ; color string, the color for dropdown item when cursore above it. -BackColor=255,255,255 ; color string, the background color dropdown when it open. -DisabledItemColor=255,255,255 ; color string, the color for disabled dropdown item. -OptionX=First ; string, the text option for dropdown. `X` is an any text that helps to - ; describe this option e.g., `Option_FirstOption`. +OpenUp=false ; boolean, defines open/close default status. +DropDownTexture= ; string, loads a texture with the specific file name with suffix as + ; texture when dropdown closed. +DropDownOpenTexture= ; string, loads a texture with the specific file name with suffix as + ; texture when dropdown opened. +ItemHeight=17 ; integer, the height of each dropdown item in pixels. +ClickSoundEffect= ; string, loads a sound with the specific file name with suffix as + ; dropdown click sound. +FontIndex=0 ; integer, the index of font loaded from font list. +BorderColor= ; color, the color for dropdown's border line when it open. +FocusColor= ; color, the color for dropdown item when cursore above it. +BackColor= ; color, the background color dropdown when it open. +DisabledItemColor= ; color, the color for disabled dropdown item. +OptionX= ; string, the text option for dropdown. `X` is an any text that helps to + ; describe this option e.g., `Option_FirstOption`. ; Option_FirstOption=1 ; Option_SecondOption=two ; Option_ThirdOption=33333 @@ -279,7 +274,7 @@ _(inherits XNADropDown)_ ```ini [SOMECLIENTDROPDOWN] ; XNAClientDropDown -ToolTip=Some Text ; text, tooltip for dropdown. +ToolTip= ; text, tooltip for dropdown. ``` #### [XNATabControl](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNATabControl.cs) @@ -287,11 +282,12 @@ ToolTip=Some Text ; text, tooltip for dropdown. _(inherits [XNAControl](#XNAControl))_ ```ini -[SOMETABCONTROL] ; XNATabControl -RemapColor=255,255,255 ; color string, the tab text color. -TextColor=255,255,255 ; color string, the tab text color. -TextColorDisabled=255,255,255 ; color string, the color for disabled tab. -RemoveTabIndexN=false ; boolean, `N` is `integer` equivalent of tab index. +[SOMETABCONTROL] ; XNATabControl +RemapColor= ; color, the tab text color. +TextColor= ; color, the tab text color. +TextColorDisabled= ; color, the color for disabled tab. +RemoveTabIndexN=false ; boolean, `N` is `integer` equivalent of tab index. + ; RemoveTabIndex0=true ``` @@ -300,8 +296,8 @@ RemoveTabIndexN=false ; boolean, `N` is `integer` equivalent of tab _(inherits [XNAControl](#XNAControl))_ ```ini -[SOMETEXTBOX] ; XNATextBox -MaximumTextLength=10 ; integer, set maximum input string length. +[SOMETEXTBOX] ; XNATextBox +MaximumTextLength=2147483647 ; integer, set maximum input string length. ``` #### [XNASuggestionTextBox](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNASuggestionTextBox.cs) @@ -310,7 +306,7 @@ _(inherits [XNAControl](#XNATextBox))_ ```ini [SOMESUGGESTIONTEXTBOX] ; XNASuggestionTextBox -Suggestion=Type some text here... ; string, set default background text when no text has typed. +Suggestion= ; string, set default background text when no text has typed. ``` ### Basic Control Property Examples @@ -348,25 +344,22 @@ _(inherits [XNAClientCheckBox](#XNAClientCheckBox))_ DefaultValue=false ; boolean, default state of the checkbox. Value of `Checked` will be used ; if it is set and this isn't. Otherwise defaults to `false`. SettingSection=CustomSettings ; string, name of the section in settings INI the setting is saved to. - ; Defaults to `CustomSettings`. -SettingKey=Key ; string, name of the key in settings INI the setting is saved to. +SettingKey= ; string, name of the key in settings INI the setting is saved to. ; Defaults to `CONTROLNAME_Value` if `WriteSettingValue` is set, ; otherwise `CONTROLNAME_Checked`. WriteSettingValue=true ; boolean, enable to write a specific string value to setting INI key ; instead of the checked state of the checkbox. Defaults to `false`. -EnabledSettingValue=true ; string, value to write to setting INI key if `WriteSettingValue` +EnabledSettingValue= ; string, value to write to setting INI key if `WriteSettingValue` ; is set and checkbox is checked. -DisabledSettingValue=false ; string, value to write to setting INI key if `WriteSettingValue` +DisabledSettingValue= ; string, value to write to setting INI key if `WriteSettingValue` ; is set and checkbox is not checked. -RestartRequired=no ; boolean, whether or not this setting requires restarting the client to apply. - ; Defaults to `false`. -ParentCheckBoxName=SomeParent ; string, name of a `XNAClientCheckBox` control to use as a parent checkbox +RestartRequired=false ; boolean, whether or not this setting requires restarting the client to apply. +ParentCheckBoxName= ; string, name of a `XNAClientCheckBox` control to use as a parent checkbox ; that is required to either be checked or unchecked, depending on value ; of ParentCheckBoxRequiredValue for this checkbox to be enabled. ; Only works if name can be resolved to an existing control belonging ; to same parent as current checkbox. ParentCheckBoxRequiredValue=true ; boolean, state required from the parent checkbox for this one to be enabled. - ; Defaults to `true`. ``` ##### [FileSettingCheckBox](https://github.com/CnCNet/xna-cncnet-client/blob/develop/DTAConfig/Settings/FileSettingCheckBox.cs) @@ -374,41 +367,39 @@ ParentCheckBoxRequiredValue=true ; boolean, state required from the parent check _(inherits [XNAClientCheckBox](#XNAClientCheckBox))_ ```ini -[SOMEFILESETTINGCHECKBOX] ; FileSettingCheckBox -DefaultValue=false ; boolean, default state of the checkbox. Value of `Checked` - ; will be used if it is set and this isn't. Otherwise defaults to `false`. -SettingSection=Settings ; string, name of the section in settings INI the setting is saved to. - ; Defaults to `CustomSettings`. -SettingKey=ThisKey ; string, name of the key in settings INI the setting is saved to. - ; Defaults to `CONTROLNAME_Value` if `WriteSettingValue` is set, - ; otherwise `CONTROLNAME_Checked`. -RestartRequired=yes ; boolean, whether or not this setting requires restarting the client to apply. - ; Defaults to `false`. -ParentCheckBoxName=SomeParent ; string, name of a `XNAClientCheckBox` control to use as a parent checkbox that - ; is required to either be checked or unchecked, depending on value of - ; `ParentCheckBoxRequiredValue` for this checkbox to be enabled. - ; Only works if name can be resolved to an existing control belonging - ; to same parent as current checkbox. -ParentCheckBoxRequiredValue=true ; boolean, state required from the parent checkbox for this one to be enabled. - ; Defaults to `true`. -CheckAvailability=true ; boolean, if set, whether or not the checkbox can be (un)checked depends on if - ; the files to copy are actually present. Defaults to `false`. -ResetUnavailableValue=no ; boolean, if set together with `CheckAvailability`, checkbox set to a value that - ; is unavailable will be reset back to `DefaultValue`. Defaults to `false`. -EnabledFileN=a.cfg,src/q.cfg ; comma-separated strings, - ; files to copy if checkbox is checked. - ; `N` starts from 0 and is incremented by 1 until no value is found. - ; Expects 2-3 comma-separated strings in following format: - ; source path relative to game root folder, destination path - ; relative to game root folder and a file operation option - ; (see #appendix-file-operation-options). -DisabledFileN=b.cfg,src/q.cfg,KeepChanges ; comma-separated strings, - ; files to copy if checkbox is not checked. - ; `N` starts from 0 and is incremented by 1 until no value is found. - ; Expects 2-3 comma-separated strings in following format: - ; source path relative to game root folder, destination path - ; relative to game root folder and a file operation option - ; (see #appendix-file-operation-options). +[SOMEFILESETTINGCHECKBOX] ; FileSettingCheckBox +DefaultValue=false ; boolean, default state of the checkbox. Value of `Checked` + ; will be used if it is set and this isn't. Otherwise defaults to `false`. +SettingSection= ; string, name of the section in settings INI the setting is saved to. + ; Defaults to `CustomSettings`. +SettingKey= ; string, name of the key in settings INI the setting is saved to. + ; Defaults to `CONTROLNAME_Value` if `WriteSettingValue` is set, + ; otherwise `CONTROLNAME_Checked`. +RestartRequired=false ; boolean, whether or not this setting requires restarting the client to apply. +ParentCheckBoxName= ; string, name of a `XNAClientCheckBox` control to use as a parent checkbox that + ; is required to either be checked or unchecked, depending on value of + ; `ParentCheckBoxRequiredValue` for this checkbox to be enabled. + ; Only works if name can be resolved to an existing control belonging + ; to same parent as current checkbox. +ParentCheckBoxRequiredValue=true ; boolean, state required from the parent checkbox for this one to be enabled. +CheckAvailability=false ; boolean, if set, whether or not the checkbox can be (un)checked depends on if + ; the files to copy are actually present. +ResetUnavailableValue=false ; boolean, if set together with `CheckAvailability`, checkbox set to a value that + ; is unavailable will be reset back to `DefaultValue`. +EnabledFileN= ; comma-separated strings, + ; files to copy if checkbox is checked. + ; `N` starts from 0 and is incremented by 1 until no value is found. + ; Expects 2-3 comma-separated strings in following format: + ; source path relative to game root folder, destination path + ; relative to game root folder and a file operation option + ; (see #appendix-file-operation-options). +DisabledFileN= ; comma-separated strings, + ; files to copy if checkbox is not checked. + ; `N` starts from 0 and is incremented by 1 until no value is found. + ; Expects 2-3 comma-separated strings in following format: + ; source path relative to game root folder, destination path + ; relative to game root folder and a file operation option + ; (see #appendix-file-operation-options). ``` ##### [SettingDropDown](https://github.com/CnCNet/xna-cncnet-client/blob/develop/DTAConfig/Settings/SettingDropDown.cs) @@ -417,15 +408,15 @@ _(inherits [XNAClientDropDown](#XNAClientDropDown))_ ```ini [SOMESETTINGDROPDOWN] ; SettingDropDown -Items=0,1,2,3,4 ; comma-separated strings, +Items= ; comma-separated strings, ; comma-separated list of strings to include as items to display on the dropdown control. -DefaultValue=0 ; integer, default item index of the dropdown. Defaults to 0 (first item). -SettingSection=section ; string, name of the section in settings INI the setting is saved to. Defaults to `CustomSettings`. -SettingKey=key ; string, name of the key in settings INI the setting is saved to. Defaults to `CONTROLNAME_Value` +DefaultValue=0 ; integer, default item index of the dropdown. +SettingSection= ; string, name of the section in settings INI the setting is saved to. Defaults to `CustomSettings`. +SettingKey= ; string, name of the key in settings INI the setting is saved to. Defaults to `CONTROLNAME_Value` ; if `WriteSettingValue` is set, otherwise `CONTROLNAME_SelectedIndex`. -WriteSettingValue=true ; boolean, enable to write selected item value to the setting INI key instead of the - ; checked state of the checkbox. Defaults to `false`. -RestartRequired=true ; boolean, whether or not this setting requires restarting the client to apply. Defaults to `false`. +WriteItemValue=false ; boolean, enable to write selected item value to the setting INI key instead of the + ; checked state of the checkbox. +RestartRequired=true ; boolean, whether or not this setting requires restarting the client to apply. ``` ##### [FileSettingDropDown](https://github.com/CnCNet/xna-cncnet-client/blob/develop/DTAConfig/Settings/FileSettingDropDown.cs) @@ -433,21 +424,23 @@ RestartRequired=true ; boolean, whether or not this setting requires restartin _(inherits [XNAClientDropDown](#XNAClientDropDown))_ ```ini -[SOMEFILESETTINGDROPDOWN] ; FileSettingDropDown -Items=1st,2nd,3rd ; comma-separated strings, - ; comma-separated list of strings to include as items to display on the dropdown control. -DefaultValue=1 ; integer, default item index of the dropdown. Defaults to 0 (first item). -SettingSection=MySection ; string, name of the section in settings INI the setting is saved to. Defaults to `CustomSettings`. -SettingKey=MyKey ; string, name of the key in settings INI the setting is saved to. - ; Defaults to `CONTROLNAME_SelectedIndex`. -RestartRequired=false ; boolean, whether or not this setting requires restarting the client to apply. Defaults to `false`. -ItemXFileN=src/a.ini,b.ini ; comma-separated strings, - ; files to copy when dropdown item `X` is selected. - ; `N` starts from 0 and is incremented by 1 until no value is found. - ; Expects 2-3 comma-separated strings in following format: - ; source path relative to game root folder, - ; destination path relative to game root folder and a file operation option - ; (see #appendix-file-operation-options). +[SOMEFILESETTINGDROPDOWN] ; FileSettingDropDown +Items= ; comma-separated strings, + ; comma-separated list of strings to include as items + ; to display on the dropdown control. +DefaultValue=0 ; integer, default item index of the dropdown. +SettingSection=CustomSettings ; string, name of the section in settings INI the setting is saved to. +SettingKey=CONTROLNAME_SelectedIndex ; string, name of the key in settings INI the setting is saved to. +RestartRequired=false ; boolean, whether or not this setting requires restarting the client to apply. +ResetUnavailableValue=false ; boolean, determines if the client would adjust the setting value automatically + ; if the current value becomes unavailable. +ItemXFileN= ; comma-separated strings, + ; files to copy when dropdown item `X` is selected. + ; `N` starts from 0 and is incremented by 1 until no value is found. + ; Expects 2-3 comma-separated strings in following format: + ; source path relative to game root folder, + ; destination path relative to game root folder and a file operation option + ; (see #appendix-file-operation-options). ``` ##### Appendix: File Operation Options From e492bfbd325be858b4268d758521067280f1c04a Mon Sep 17 00:00:00 2001 From: MahBoiDeveloper Date: Wed, 27 Nov 2024 00:25:36 +0300 Subject: [PATCH 14/15] Update default colors --- Docs/INISystem.md | 82 +++++++++++++++++++++++------------------------ 1 file changed, 41 insertions(+), 41 deletions(-) diff --git a/Docs/INISystem.md b/Docs/INISystem.md index c2504e95a..1a39c3c13 100644 --- a/Docs/INISystem.md +++ b/Docs/INISystem.md @@ -76,7 +76,7 @@ DrawOrder=0 ; integer, determine the layering order of ; its parent control's list of child controls. UpdateOrder=0 ; integer, determine the layering order of the control within ; its parent control's list of child controls. -RemapColor= ; color, this will set a theme defined color based. +RemapColor=255,255,255 ; color, this will set a theme defined color based. ControlDrawMode=UniqueRenderTarget ; enum (UniqueRenderTarget | Normal), ; this will set render option to draw control on its own render ; target (`UniqueRenderTarget`) or to draw control on @@ -88,11 +88,11 @@ ControlDrawMode=UniqueRenderTarget ; enum (UniqueRenderTarget | Normal), _(inherits [XNAControl](#XNAControl))_ ```ini -[SOMEINDICATOR] ; XNAIndicator -FontIndex=0 ; integer, the index of font loaded from font list. Default value is `0`. -HighlightColor= ; color, the text color when cursor above the `XNAIndicator`. -AlphaRate=0.1 ; float, the indicator's transparency changing rate per 100 milliseconds. - ; If the indicator is transparent, it'll become non-transparent at this rate. +[SOMEINDICATOR] ; XNAIndicator +FontIndex=0 ; integer, the index of font loaded from font list. Default value is `0`. +HighlightColor=255,255,255 ; color, the text color when cursor above the `XNAIndicator`. +AlphaRate=0.1 ; float, the indicator's transparency changing rate per 100 milliseconds. + ; If the indicator is transparent, it'll become non-transparent at this rate. ``` #### [XNAPanel](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAPanel.cs) @@ -101,7 +101,7 @@ _(inherits [XNAControl](#XNAControl))_ ```ini [SOMEPANEL] ; XNAPanel -BorderColor= ; color, this will set a border color based. +BorderColor=196,196,196 ; color, this will set a border color based. AlphaRate=0.01 ; float, the panel's transparency changing rate per 100 milliseconds. ; If the panel is transparent, it'll become non-transparent at this rate. BackgroundTexture= ; string, loads a texture with the specific file name with suffix. @@ -131,8 +131,8 @@ BackgroundTexture= ; string, same as XNAControl's `BackgroundTexture`. _(inherits [XNAPanel](#XNAPanel))_ ```ini -[SOMETEXTBLOCK] ; XNATextBlock -TextColor= ; color, defines text color for text block. +[SOMETEXTBLOCK] ; XNATextBlock +TextColor=196,196,196 ; color, defines text color for text block. ``` #### [XNAMultiColumnListBox](https://github.com/Rampastring/Rampastring.XNAUI/blob/master/XNAControls/XNAMultiColumnListBox.cs) @@ -168,8 +168,8 @@ _(inherits [XNAControl](#XNAControl))_ ```ini [SOMELABEL] ; XNALabel -RemapColor= ; color, same as XNAControl's `RemapColor`. -TextColor= ; color, determine color of the text in label. +RemapColor=255,255,255 ; color, same as XNAControl's `RemapColor`. +TextColor=196,196,196 ; color, determine color of the text in label. FontIndex=0 ; integer, the index of font loaded from font list. AnchorPoint=0.0,0.0 ; 2 floats, this will set a label's text start drawing point. TextShadowDistance=0.1 ; float, the distance between text and its shadow. @@ -182,19 +182,19 @@ TextAnchor= ; enum (NONE | LEFT | RIGHT | HORIZONTAL_CENTER | TOP | B _(inherits [XNAControl](#XNAControl))_ ```ini -[SOMEBUTTON] ; XNAButton -TextColorIdle= ; color, the text color when cursor isn't above the button. -TextColorHover= ; color, the text color when cursor above the button. -HoverSoundEffect= ; string, loads a sound with the specific file name with suffix as button hover sound. -ClickSoundEffect= ; string, loads a sound with the specific file name with suffix as button click sound. -AdaptiveText=true ; boolean, specifies how the client should change the start text drawing position - ; in the button to fill all the free space. Default value is `true`. -AlphaRate=0.01 ; float, the button's transparency changing rate per 100 milliseconds. - ; If the button is transparent, it'll become non-transparent at this rate. -FontIndex=0 ; integer, the index of loaded from font list. -IdleTexture= ; string, loads a texture with the specific file name with suffix as button idle texture. -HoverTexture= ; string, loads a texture with the specific file name with suffix as button hover texture. -TextShadowDistance=0.1 ; float, the distance between text and its shadow. +[SOMEBUTTON] ; XNAButton +TextColorIdle=255,255,255 ; color, the text color when cursor isn't above the button. +TextColorHover=255,255,255 ; color, the text color when cursor above the button. +HoverSoundEffect= ; string, loads a sound with the specific file name with suffix as button hover sound. +ClickSoundEffect= ; string, loads a sound with the specific file name with suffix as button click sound. +AdaptiveText=true ; boolean, specifies how the client should change the start text drawing position + ; in the button to fill all the free space. Default value is `true`. +AlphaRate=0.01 ; float, the button's transparency changing rate per 100 milliseconds. + ; If the button is transparent, it'll become non-transparent at this rate. +FontIndex=0 ; integer, the index of loaded from font list. +IdleTexture= ; string, loads a texture with the specific file name with suffix as button idle texture. +HoverTexture= ; string, loads a texture with the specific file name with suffix as button hover texture. +TextShadowDistance=0.1 ; float, the distance between text and its shadow. ``` #### [XNAClientButton](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNAClientButton.cs) @@ -223,14 +223,14 @@ Arguments= ; string, the arguments separated with space for URL-link. _(inherits [XNAControl](#XNAControl))_ ```ini -[SOMECHECKBOX] ; XNACheckbox -FontIndex=0 ; integer, the index of font loaded from font list. -IdleColor= ; color, the the text color when cursor isn't above the checkbox. -HighlightColor= ; color, the text color when cursor above the checkbox. -AlphaRate=0.1 ; float, the checkbox's transparency changing rate per 100 milliseconds. - ; If the checkbox is transparent, it'll become non-transparent at this rate. -AllowChecking=true ; boolean, the allows user to check/uncheck checkbox. -Checked=true ; boolean, the default checkbox status. +[SOMECHECKBOX] ; XNACheckbox +FontIndex=0 ; integer, the index of font loaded from font list. +IdleColor=196,196,196 ; color, the the text color when cursor isn't above the checkbox. +HighlightColor=255,255,255 ; color, the text color when cursor above the checkbox. +AlphaRate=0.1 ; float, the checkbox's transparency changing rate per 100 milliseconds. + ; If the checkbox is transparent, it'll become non-transparent at this rate. +AllowChecking=true ; boolean, the allows user to check/uncheck checkbox. +Checked=true ; boolean, the default checkbox status. ``` #### [XNAClientCheckbox](https://github.com/CnCNet/xna-cncnet-client/blob/develop/ClientGUI/XNAClientCheckBox.cs) @@ -257,10 +257,10 @@ ItemHeight=17 ; integer, the height of each dropdown item in p ClickSoundEffect= ; string, loads a sound with the specific file name with suffix as ; dropdown click sound. FontIndex=0 ; integer, the index of font loaded from font list. -BorderColor= ; color, the color for dropdown's border line when it open. -FocusColor= ; color, the color for dropdown item when cursore above it. -BackColor= ; color, the background color dropdown when it open. -DisabledItemColor= ; color, the color for disabled dropdown item. +BorderColor=196,196,196 ; color, the color for dropdown's border line when it open. +FocusColor=64,64,64 ; color, the color for dropdown item when cursore above it. +BackColor=0,0,0 ; color, the background color dropdown when it open. +DisabledItemColor=169,169,169 ; color, the color for disabled dropdown item. OptionX= ; string, the text option for dropdown. `X` is an any text that helps to ; describe this option e.g., `Option_FirstOption`. ; Option_FirstOption=1 @@ -282,11 +282,11 @@ ToolTip= ; text, tooltip for dropdown. _(inherits [XNAControl](#XNAControl))_ ```ini -[SOMETABCONTROL] ; XNATabControl -RemapColor= ; color, the tab text color. -TextColor= ; color, the tab text color. -TextColorDisabled= ; color, the color for disabled tab. -RemoveTabIndexN=false ; boolean, `N` is `integer` equivalent of tab index. +[SOMETABCONTROL] ; XNATabControl +RemapColor=255,255,255 ; color, the tab text color. +TextColor=255,255,255 ; color, the tab text color. +TextColorDisabled=169,169,169 ; color, the color for disabled tab. +RemoveTabIndexN=false ; boolean, `N` is `integer` equivalent of tab index. ; RemoveTabIndex0=true ``` From e0c60677266eeda27d75edc0ae6241f6d203c7bb Mon Sep 17 00:00:00 2001 From: Kerbiter Date: Tue, 26 Nov 2024 23:30:12 +0200 Subject: [PATCH 15/15] Update Docs/INISystem.md --- Docs/INISystem.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Docs/INISystem.md b/Docs/INISystem.md index 1a39c3c13..085df2a10 100644 --- a/Docs/INISystem.md +++ b/Docs/INISystem.md @@ -63,7 +63,7 @@ Height= ; integer, the Height of the control. Size= ; 2 integers, the Width and Height of the control. Text= ; text, the text to display for the control (ex: buttons, labels, etc...). Visible=true ; boolean, whether or not the control should be visible by default. -Enabled=true ; boolean, whether or not the control should be enabled by default. +Enabled=true ; boolean, whether or not the control can be interacted with by default. DistanceFromRightBorder=0 ; integer, the distance of the right edge of this control from ; the right edge of its parent. This control MUST have a parent. DistanceFromBottomBorder=0 ; integer, the distance of the bottom edge of this control from the