|
|
(257 intermediate revisions by 2 users not shown) |
Line 1: |
Line 1: |
| {{SideTOC}} | | {{TOC|side}} |
| == Introduction ==
| | If you have ever wondered why you scenario is running so badly, performance profiling is the way to find it out. It allows you to find bottlenecks and slow code by capturing a "slow" frame. |
| Dialogs are one way to provide custom graphical user interface in your missions and allow interaction with the player aswell as they are able to run [[Code|code]]. They are defined as classes in the [[Description.ext|missionConfigFile]] ([[description.ext]]), [[campaignConfigFile]] ([[Campaign Description.ext]]) or [[configFile]] ([[config.cpp]]).
| | The captured data can then be viewed and analysed. |
| <gallery>
| |
| A3_GUI_Example_1.jpg|Custom Briefing Editor
| |
| A3_GUI_Example_2.jpg|Teamswitch GUI
| |
| A3_GUI_Example_3.jpg|Dynamic Groups GUI
| |
| </gallery>
| |
|
| |
|
| == Terminology == | | == Getting the correct Version == |
| | Profiling is enabled in the following {{arma3}} versions |
| | * arma3profiling_x64.exe - '''Part of the Performance Profiling Build''' |
| | * arma3diag_x64.exe - '''Part of the Development Build''' |
|
| |
|
| '''GUI'''<br>
| | Read [[Arma_3: Steam Branches]] for a guide on how to access these branches. |
| '''G'''raphical '''U'''ser '''I'''nterface which let's the user interact with the software through graphical controls like buttons, lists and so on.
| |
|
| |
|
| '''UI'''<br> | | {{Feature|informative|It is recommended to use the '''Performance Profiling Build''' (arma3profiling_x64.exe) for performance profiling because: |
| '''U'''ser '''I'''nterface which let's the user interact with the software through a console application | | * Has tools that might not make it into development build |
| | * Has all the profiling related commands that ''arma3diag_x64.exe'' has |
| | * Its performance is closer to the default ''arma3_x64.exe''}} |
|
| |
|
| '''IGUI'''<br>
| | == Frame Capturing == |
| '''I'''ntegrated '''G'''raphical '''U'''ser '''I'''nterface, usually used when talking about vanilla menus in {{arma3}}.
| | There are several commands that allow you to capture a frame. |
| | * [[diag_captureFrame]] |
| | * [[diag_captureSlowFrame]] |
| | * [[diag_logSlowFrame]] - not available in Arma 3 :( |
| | * [[diag_captureFrameToFile]] |
| | In most cases you do not want to capture any or all frames, you just want to capture "slow" frames. A slow frame is a frame that takes longer than the average frame and slows down the game. |
|
| |
|
| | == How to Use == |
| | # Run a mission |
| | # Execute a scripted command <sqf inline>diag_captureSlowFrame ["total", 0.3];</sqf> using any means ([[Arma 3: Debug Console|Debug Console]], mission radio trigger...) |
| | # Once a slow frame is detected, a window will open |
| | # In the window you will be able to browse a lot of performance-related data, which can be interesting |
| | # To export the gathered information for sharing with others: |
| | ## Select Main Thread (if not selected yet) |
| | ## Press the Copy button |
| | ## Open an external text editor |
| | ## Paste the text into a new file |
| | ## Save the file |
|
| |
|
| === User Interface Types === | | == Capture Frame UI == |
| '''Dialog'''
| | [[File: arma3-capture frame ui overview.png]] |
| *Can be created upon an existing display. Parent display will be hidden.
| |
|
| |
|
| **Player movement is blocked by dialog
| | # {{Wiki|TODO}} |
| **'''Commands:''' [[createDialog]], [[closeDialog]], [[allControls]], [[dialog]] [[User:7erra|7erra]] ([[User talk:7erra|talk]])
| | # {{Wiki|TODO}} |
| | # {{Wiki|TODO}} |
| | # {{Wiki|TODO}} |
| | # {{Wiki|TODO}} |
| | # {{Wiki|TODO}} |
| | # {{Wiki|TODO}} |
| | # {{Wiki|TODO}} |
| | # {{Wiki|TODO}} |
|
| |
|
| '''Display'''
| | == External Viewer == |
| *Can be created upon an existing display. Parent display will be hidden. | | * chrome://tracing |
| *Player movement is not blocked by display, if it hasn't been blocked by its parent display already. | | * https://ui.perfetto.dev/ |
| **'''Commands:''' [[createDisplay]], [[closeDisplay]], [[allControls]], [[allDisplays]]
| |
|
| |
|
| {{Informative|Generally speaking, dialogs and displays are identical. They are only differentiated by the way they are created ([[createDisplay]], [[createDialog]]).}}
| | [[File:Performance_Profiling_04.png|thumb|diag_captureFrame sample output with custom subtree]] |
| | == Creating Your Own Subtree == |
|
| |
|
| [[User:7erra|7erra]] ([[User talk:7erra|talk]]): [[displayParent]] is only available for createDisplay displays, createDisplay will return the display while createDialog will only return success flag. [[dialog]] will return false for displays created with createDisplay. | | When Profiling Per-Frame Eventhandlers (PFH), [[diag_captureFrame]] only shows one blob called siFEH that contains all PFH's so you can't see what part of that is caused by your PFH.<br> |
| | You can create your own subtree inside siFEH by wrapping your function call inside a [[isNil]] CODE statement like this:<br> |
| | Turn your old call which may look like this: |
| | <sqf> |
| | addMissionEventHandler ["EachFrame", { |
| | call myPFHFunction |
| | }]; |
| | </sqf> |
|
| |
|
| '''HUD'''
| | Into something like this: |
| *Is created in a new, or already existing layer. The user can not interact with it. Usually used to show information, like stamina, ammunition and so on.
| | <sqf> |
| **'''Commands:''' [[allCutLayers]], [[titleRsc]], [[cutText]], [[cutObj]], [[cutFadeOut]], [[setTitleEffect]], [[allActiveTitleEffects]]
| | addMissionEventHandler ["EachFrame", { |
| | isNil { call myPFHFunction } // isNil creates the subtree |
| | }]; |
| | </sqf> |
|
| |
|
| {{Informative|Some of the commands have different effects. Please check the command's biki page for detailed information.}}
| | Now when you run [[diag_captureFrame]] inside of siPFH you will have a subtree called gsEva and behind that you can see the first line of code inside the isNil statement.<br> |
| | It will only show a part of the first line of that code so you should put something descriptive into the [[isNil]] statement.<br> |
| | You can use the same to create a subtree for any function you like. This will also work inside [[Scheduler#Scheduled_Environment|Scheduled]] ([[spawn]]ed) scripts. <br> |
| | But using this method to "subtree" a function with return values requires a little bit of trickery to get the return value out. |
|
| |
|
| == Display and Dialog== | | |
| Displays and dialogs are defined in the config file. They are usually used to simplify user interactions, through controls like buttons, list boxes and so on.
| | == Notes == |
| === Properties === | | |
| {| class="wikitable sortable" Style = "Width: 100%" | | * 0.3 is a time in second used to determine what duration of a frame you consider abnormal, and first such frame will be captured. |
| | * 0.3 is definitely something you should not see in a normal game. |
| | * If you do not capture any frames with 0.3, try lowering it to 0.2 or 0.1. |
| | * If it triggers too early, before the main slowdown happens, increase it to a higher value, e.g. 1.0. |
| | |
| | == Scopes == |
| | {| class="wikitable sortable" |
| | |- |
| | ! Technical Name !! Descriptive Name !! Description |
| | |- |
| | | Main |
| | | |
| | | |
| | |- |
| | | total |
| | | |
| | | |
| | |- |
| | | fsPHa |
| | | |
| | | |
| | |- |
| | | winMs |
| | | |
| | | |
| | |- |
| | | dlcSim |
| | | |
| | | |
| | |- |
| | | steamCbk |
| | | |
| | | |
| |- | | |- |
| ! Name !! Type!! Remark
| | | input |
| | | |
| | | |
| |- | | |- |
| | '''idd''' | | | wSimu |
| | [[Integer]] | | | |
| | The unique ID number of this dialog. Used with [[findDisplay]] to find the display. Can be -1 if no access is required from within a script. | | | |
| |- | | |- |
| | '''access''' | | | docSim |
| | [[Integer]] | | | |
| | | | | |
| *0 - ReadAndWrite - this is the default case where properties can still be added or overridden.
| |
| *1 - ReadAndCreate - this only allows creating new properties.
| |
| *2 - ReadOnly - this does not allow to do anything in deriving classes.
| |
| *3 - ReadOnlyVerified - this does not allow to do anything either in deriving classes, and a CRC check will be performed.
| |
| |- | | |- |
| | '''movingEnable''' | | | wSimDisp |
| | [[Boolean]] | | | |
| | Specifies whether the dialog can be moved or not (if enabled one of the dialogs controls should have the ''moving'' property set to 1 so it becomes the "handle" the dialog can be moved with). Doesn't seem to matter in Arma 3 | | | |
| |- | | |- |
| | '''enableSimulation''' | | | MFDManager |
| | [[Boolean]] | | | |
| | Specifies whether the game continues while the dialog is shown or not. | | | |
| |- | | |- |
| | '''onLoad''' | | | wDisp |
| | [[String]] | | | |
| | Expression executed when the dialog is opened. See [https://community.bistudio.com/wiki/User_Interface_Event_Handlers#onLoad User Interface Event Handlers] | | | |
| |- | | |- |
| | '''onUnload''' | | | EventPrcs |
| | [[String]] | | | |
| | Expression executed when the dialog is closed. See [https://community.bistudio.com/wiki/User_Interface_Event_Handlers#onUnload User Interface Event Handlers] | | | |
| |- | | |- |
| | '''controlsBackground''' | | | gsEva |
| | [[Array]] | | | |
| | Contains class names of all background controls associated to this dialog.<br> | | | |
| The sequence in which the controls are listed will decide their z-index (i.e. the last ones will on top of the first ones).
| |
| |- | | |- |
| | '''controls''' | | | gbFrm |
| | [[Array]] | | | |
| | Contains class names of all foreground controls associated to this dialog. | | | |
| |- | | |- |
| | '''objects''' | | | memLo |
| | [[Array]] | | | |
| | | | | |
| |} | | |- |
| | | | siScr |
| *'''Example Config:'''
| | | |
| <syntaxhighlight lang="cpp">class DefaultDialog
| | | |
| {
| | |- |
| idd = -1;
| | | scrVM |
| access = 0;
| | | |
| movingEnable = true;
| | | |
| onLoad = "hint str _this";
| | |- |
| onUnload = "hint str _this";
| | | wsSet |
| enableSimulation = false;
| | | |
| controlsBackground[] =
| | | |
| {
| | |- |
| //Background controls;
| | | sLand |
| };
| | | |
| controls[] =
| | | |
| {
| | |- |
| //Controls;
| | | simSW |
| };
| | | |
| objects[] =
| | | |
| {
| | |- |
| //Objects
| | | cLWObj |
| };
| | | |
| };</syntaxhighlight>
| | | |
| | | |- |
| === Opening a display or dialog ===
| | | oTemp |
| There are two ways of creating a display or dialog. One can either use [[createDialog]] or [[createDisplay]] command.
| | | |
| | | | |
| === Closing a display or dialog===
| | |- |
| There are several ways how a dialog can be closed.
| | | FPres |
| * by pressing the '''Escape-key'''
| | | |
| * by using [[closeDialog]]
| | | |
| * by using [[closeDisplay]]
| | |- |
| * when the user presses a button with IDC 0, 1 or 2
| | | waitSnd |
| | | | |
| == HUDs ==
| | | |
| HUDs are define in the class RscTitles, unlike displays or dialogs which are root classes in the config file. Additionally, their properties are different.
| | |- |
| === Properties ===
| | | job |
| {| class="wikitable sortable" Style="Width: 100%"
| | | |
| | | |
| | |- |
| | | sound |
| | | |
| | | |
| | |- |
| | | ssAdv |
| | | |
| | | |
| | |- |
| | | snCmt |
| | | |
| | | |
| | |- |
| | | play |
| | | |
| | | |
| | |- |
| | | ARTCpl |
| | | |
| | | |
| | |- |
| | | rendr |
| | | |
| | | |
| | |- |
| | | drwVi |
| | | |
| | | |
| | |- |
| | | txHLi |
| | | |
| | | |
| | |- |
| | | txPMM |
| | | |
| | | |
| | |- |
| | | dsr2t |
| | | |
| | | |
| | |- |
| | | wPrep |
| | | |
| | | |
| | |- |
| | | dPr |
| | | |
| | | |
| | |- |
| | | fmiRun |
| | | |
| | | |
| | |- |
| | | fmiWait |
| | | |
| | | |
| | |- |
| | | fmiMDrw |
| | | |
| | | |
| | |- |
| | | fmiSIns |
| | | |
| | | |
| | |- |
| | | wPrepFtr |
| | | |
| | | |
| | |- |
| | | clPrp |
| | | |
| | | |
| | |- |
| | | oPrep |
| | | |
| | | |
| | |- |
| | | sceAC |
| | | |
| | | |
| | |- |
| | | oSplt |
| | | |
| | | |
| | |- |
| | | sceACTA |
| | | |
| | | |
| | |- |
| | | sceACPrx |
| | | |
| | | |
| | |- |
| | | lodUL |
| | | |
| | | |
| | |- |
| | | PrxObj |
| | | |
| | | |
| | |- |
| | | manAn |
| | | |
| | | |
| | |- |
| | | ppdOT |
| | | |
| | | |
| | |- |
| | | flProx |
| | | |
| | | |
| | |- |
| | | PrxObjTransport |
| | | |
| | | |
| | |- |
| | | oSoSL |
| | | |
| | | |
| | |- |
| | | oSoJE |
| | | |
| | | |
| | |- |
| | | oSoJE1 |
| | | |
| | | |
| | |- |
| | | oSoJE2 |
| | | |
| | | |
| | |- |
| | | oSo1OFOv |
| | | |
| | | |
| | |- |
| | | oSo1ON |
| | | |
| | | |
| | |- |
| | | sceCLsHSH |
| | | |
| | | |
| | |- |
| | | prpAMCt |
| | | |
| | | |
| | |- |
| | | oSoJEw |
| | | |
| | | |
| | |- |
| | | pDrwFNP |
| | | |
| | | |
| | |- |
| | | oSoSLu |
| | | |
| | | |
| | |- |
| | | lPGCl |
| | | |
| | | |
| | |- |
| | | pdDrw |
| | | |
| | | |
| | |- |
| | | lDGnd |
| | | |
| | | |
| | |- |
| | | lGSMM |
| | | |
| | | |
| | |- |
| | | recCB |
| | | |
| | | |
| | |- |
| | | mtPmj |
| | | |
| | | |
| | |- |
| | | cuDrw |
| | | |
| | | |
| | |- |
| | | prepT |
| | | |
| | | |
| |- | | |- |
| ! Name !! Type !! Remark
| | | drwCB |
| | | |
| | | |
| |- | | |- |
| | '''idd''' | | | oPasD |
| | [[Integer]] | | | |
| | The unique ID number of this HUD. Used with [[findDisplay]] to find the display. Can be -1 if no access is required from within a script. | | | |
| |- | | |- |
| | '''fadeIn''' | | | o1Drw |
| | [[Integer]] | | | |
| | Duration of fade in effect when opening in seconds. | | | |
| |- | | |- |
| | '''fadeOut''' | | | lckDnBf |
| | [[Integer]] | | | |
| | Duration of fade out effect when closing in seconds. | | | |
| |- | | |- |
| | '''duration''' | | | prpTx |
| | [[Integer]] | | | |
| | Duration the HUD is displayed after opening in seconds. Use a very large number to have it always open. | | | |
| |- | | |- |
| | '''onLoad''' | | | inst |
| | [[String]] | | | |
| | Expression executed when the dialog is opened. See [https://community.bistudio.com/wiki/User_Interface_Event_Handlers#onLoad User Interface Event Handlers] | | | |
| |- | | |- |
| | '''onUnload''' | | | stpSctnTL |
| | [[String]] | | | |
| | Expression executed when the dialog is closed. See [https://community.bistudio.com/wiki/User_Interface_Event_Handlers#onUnload User Interface Event Handlers] | | | |
| |- | | |- |
| | '''controls''' | | | o1ShV |
| | [[Array]] | | | |
| | Contains class names of all foreground controls associated to this dialog.
| | | |
| |}
| |
| | |
| *'''Example Config:'''
| |
| <syntaxhighlight lang="cpp">
| |
| #include "\a3\ui_f\hpp\definecommongrids.inc"
| |
| class RscTitles
| |
| {
| |
| class RscInfoText
| |
| {
| |
| idd = 3100;
| |
| fadein = 0;
| |
| fadeout = 0;
| |
| duration = 1e+011;
| |
| onLoad = "uinamespace setvariable ['BIS_InfoText',_this select 0]";
| |
| onUnLoad = "uinamespace setvariable ['BIS_InfoText',nil]";
| |
| class Controls
| |
| {
| |
| class InfoText
| |
| {
| |
| idc = 3101;
| |
| style = "0x01 + 0x10 + 0x200 + 0x100";
| |
| font = "RobotoCondensedBold";
| |
| x = "(profilenamespace getvariable [""IGUI_GRID_MISSION_X"",(safezoneX + safezoneW - 21 * (GUI_GRID_WAbs / 40))])";
| |
| y = "(profilenamespace getvariable [""IGUI_GRID_MISSION_Y"",(safezoneY + safezoneH - 10.5 * (GUI_GRID_HAbs / 25))])";
| |
| w = "20 * (GUI_GRID_WAbs / 40)";
| |
| h = "5 * ((GUI_GRID_WAbs / 1.2) / 25)";
| |
| colorText[] = {1,1,1,1};
| |
| colorBackground[] = {0,0,0,0};
| |
| text = "";
| |
| lineSpacing = 1;
| |
| sizeEx = 0.045;
| |
| fixedWidth = 1;
| |
| deletable = 0;
| |
| fade = 0;
| |
| access = 0;
| |
| type = 0;
| |
| shadow = 1;
| |
| colorShadow[] = {0,0,0,0.5};
| |
| tooltipColorText[] = {1,1,1,1};
| |
| tooltipColorBox[] = {1,1,1,1};
| |
| tooltipColorShade[] = {0,0,0,0.65};
| |
| };
| |
| };
| |
| };
| |
| };</syntaxhighlight>
| |
| | |
| == Controls ==
| |
| Controls are used to allow the player to interact with the GUI. Controls range from simple rectangles to 3D objects. Like dialogs, displays and HUDs, controls can have a unique ID to access them from within scripts. The classname of controls have to be unique.
| |
| | |
| What properties a control needs is defined by its ''type'' property. However most controls share a set of properties described in the following sections. For control specific properties visit the corresponding pages.
| |
| | |
| === Common Properties ===
| |
| | |
| {| class="wikitable" Width="100%" |
| |
| |- | | |- |
| ! bgcolor="#ddddff" | Name
| | | scSVI |
| ! bgcolor="#ddddff" | Type
| | | |
| ! bgcolor="#ddddff" | Remark
| | | |
| |- | | |- |
| | '''idc''' | | | oPas3 |
| | [[Integer]] | | | |
| | The unique ID number of this control. Can be -1 if you don't require access to the control itself from within a script | | | |
| |- | | |- |
| | '''moving''' | | | sssmC |
| | [[Boolean]] | | | |
| | Whether the dialog will be moved if this control is dragged (may require "movingEnable" to be 1 in the dialog. In Arma 3 works regardless). Another way of allowing moving of the dialog is to have control of style ST_TITLE_BAR | | | |
| |- | | |- |
| | '''type''' | | | sbDrw |
| | [[Integer]] | | | |
| | See [[#Control Types|Control Types]] | | | |
| |- | | |- |
| | '''style''' | | | aniMt |
| | [[Integer]] | | | |
| | See [[#Control Styles|Control Styles]]. {{Inline code|style <nowiki>=</nowiki> "0x400+0x02+0x10";}} | | | |
| |- | | |- |
| | '''x/y/w/h''' | | | ppSSSM |
| | [[Number]] | | | |
| | The position and size of the control in fractions of screen size. | | | |
| |- | | |- |
| | '''sizeEx''' | | | drwROM |
| | [[Number]] | | | |
| | The font size of text in fractions of screen size. Behaves similar to '''h''' property. For some controls it's named '''size'''. | | | |
| |- | | |- |
| | '''font''' | | | drwIn |
| | [[String]] | | | |
| | The font to use. See the list of [[Fonts#Available_Fonts|available fonts]] for possible values. | | | |
| |- | | |- |
| | '''colorText''' | | | wDraw |
| | [[Array]] | | | |
| | Text color | | | |
| |- | | |- |
| | '''colorBackground''' | | | lDPGT |
| | [[Array]] | | | |
| | Background color | | | |
| |- | | |- |
| | '''text''' | | | oSDrw |
| | [[String]] | | | |
| | The text '''or picture''' to display. | | | |
| |- | | |- |
| | '''shadow''' | | | oPasO |
| | [[Integer]] | | | |
| | Can be applied to most controls (0 = no shadow, 1 = drop shadow with soft edges, 2 = stroke). | | | |
| |- | | |- |
| | '''tooltip''' | | | lDSky |
| | [[String]] | | | |
| | Text to display in a tooltip when control is moused over. A tooltip can be added to any control type except CT_STATIC and CT_STRUCTURED_TEXT. Note: As of {{GVI|a3|1.48}}, most controls now support tooltips. A linebreak can be created by adding '''\n'''. | | | |
| |- | | |- |
| | '''tooltipColorShade''' | | | swRdr |
| | [[Array]] | | | |
| | Tooltip background color | | | |
| |- | | |- |
| | '''tooltipColorText''' | | | ppSWDD |
| | [[Array]] | | | |
| | Tooltip text color | | | |
| |- | | |- |
| | '''tooltipColorBox''' | | | swRdGeom |
| | [[Array]] | | | |
| | Tooltip border color | | | |
| <!---
| |
| |- | | |- |
| | '''autocomplete''' | | | swRdGeomVB |
| | [[String]] | | | |
| | Option for entry fields (e.g. RscEdit) to activate autocompletion. For known script commands and functions use autocomplete = "scripting". | | | |
| |- | | |- |
| | '''url''' | | | swFillV |
| | [[String]] | | | |
| | URL which will be opened when clicking on the control. Used on e.g. a button control. Does not utilize the Steam Overlay browser if enabled, opens the link in the default browser set by the OS.
| | | |
| --->
| |
| |}
| |
| | |
| === Attributes Class ===
| |
| {| class="wikitable" width="25%" |
| |
| |- | | |- |
| ! bgcolor="#ddddff" | Name
| | | oPasA |
| ! bgcolor="#ddddff" | Type
| | | |
| ! bgcolor="#ddddff" | Remark
| | | |
| |- | | |- |
| | '''font''' | | | ppShrpn |
| | [[String]] | | | |
| | [[FXY_File_Format#Available_Fonts|Available Fonts]] | | | |
| |- | | |- |
| | '''color''' | | | lDWat |
| | HTML color | | | |
| | [https://html-color-codes.info/ HTML Color Codes] | | | |
| |- | | |- |
| | '''align''' | | | oPas2 |
| | [[String]] | | | |
| | "center", "left", "right" | | | |
| |- | | |- |
| | '''shadow''' | | | o2Drw |
| | [[Integer]] | | | |
| | 0 = no shadow, 1 = drop shadow with soft edges, 2 = stroke
| | | |
| |}
| |
| | |
| === AttributesImage Class ===
| |
| {| class="wikitable" width="25%" |
| |
| |- | | |- |
| ! bgcolor="#ddddff" | Name
| | | oPas5 |
| ! bgcolor="#ddddff" | Type
| | | |
| ! bgcolor="#ddddff" | Remark
| | | |
| |- | | |- |
| | '''font''' | | | o5Drw |
| | [[String]] | | | |
| | [[FXY_File_Format#Available_Fonts|Available Fonts]] (Optional) | | | |
| |- | | |- |
| | '''color''' | | | EDraw3D |
| | HTML color | | | |
| | [https://html-color-codes.info/ HTML Color Codes] | | | |
| |- | | |- |
| | '''align''' | | | MEventPrcs |
| | [[String]] | | | |
| | "center", "left", "Right" (optional) | | | |
| |- | | |- |
| |}<br clear="all"> | | | cLGSY |
| | | | |
| *'''Example Config:'''
| | | |
| <syntaxhighlight lang="cpp">
| |
| #include "\a3\ui_f\hpp\definecommongrids.inc"
| |
| class RscButton
| |
| {
| |
| deletable = 0;
| |
| fade = 0;
| |
| access = 0;
| |
| type = 1;
| |
| text = "";
| |
| colorText[] = {1,1,1,1};
| |
| colorDisabled[] = {1,1,1,0.25};
| |
| colorBackground[] = {0,0,0,0.5};
| |
| colorBackgroundDisabled[] = {0,0,0,0.5};
| |
| colorBackgroundActive[] = {0,0,0,1};
| |
| colorFocused[] = {0,0,0,1};
| |
| colorShadow[] = {0,0,0,0};
| |
| colorBorder[] = {0,0,0,1};
| |
| soundEnter[] = {"\A3\ui_f\data\sound\RscButton\soundEnter",0.09,1};
| |
| soundPush[] = {"\A3\ui_f\data\sound\RscButton\soundPush",0.09,1};
| |
| soundClick[] = {"\A3\ui_f\data\sound\RscButton\soundClick",0.09,1};
| |
| soundEscape[] = {"\A3\ui_f\data\sound\RscButton\soundEscape",0.09,1};
| |
| idc = -1;
| |
| style = 2;
| |
| x = 0;
| |
| y = 0;
| |
| w = 0.095589;
| |
| h = 0.039216;
| |
| shadow = 2;
| |
| font = "RobotoCondensed";
| |
| sizeEx = "GUI_GRID_HAbs / 25";
| |
| url = "";
| |
| offsetX = 0;
| |
| offsetY = 0;
| |
| offsetPressedX = 0;
| |
| offsetPressedY = 0;
| |
| borderSize = 0;
| |
| };</syntaxhighlight>
| |
| | |
| === Control Types ===
| |
| The type property of controls defines what type of control they are. For example an edit box has the type 2.
| |
| There is an ingame dialog with examples of how the control types look and act like:
| |
| <code>[[createDialog]] "RscTestControlTypes";</code>
| |
| | |
| {| class="wikitable sortable" Style ="Width: 100%"
| |
| ! Define !! Decimal !! Hexadecimal !! Remark !! Define !! Decimal !! Hexadecimal !! Remark
| |
| |- | | |- |
| | [[CT_STATIC]] || 0 || 0x00 || || [[CT_XLISTBOX]] || 42 || 0x2A || | | | stpAll |
| | | |
| | | |
| |- | | |- |
| | [[CT_BUTTON]] || 1 || 0x01 || || [[CT_XSLIDER]] || 43 || 0x2B || | | | stpCB |
| | | |
| | | |
| |- | | |- |
| | [[CT_EDIT]] || 2 || 0x02 || || [[CT_XCOMBO]] || 44 || 0x2C || | | | stpTxtCS |
| | | |
| | | |
| |- | | |- |
| | [[CT_SLIDER]] || 3 || 0x03 || || [[CT_ANIMATED_TEXTURE]] || 45 || 0x2D || | | | stpUAVsCS |
| | | |
| | | |
| |- | | |- |
| | [[CT_COMBO]] || 4 || 0x04 || || [[CT_MENU]] || 46 || 0x2E || Arma 3 (EDEN) | | | ppHDRCL |
| | | |
| | | |
| |- | | |- |
| | [[CT_LISTBOX]] || 5 || 0x05 || || [[CT_MENU_STRIP]] || 47 || 0x2F || Arma 3 (EDEN) | | | ppGSB |
| | | |
| | | |
| |- | | |- |
| | [[CT_TOOLBOX]] || 6 || 0x06 || || CT_CHECKBOX || 77 || 0x4D || Arma 3 | | | ppDOF |
| | | |
| | | |
| |- | | |- |
| | [[CT_CHECKBOXES]] || 7 || 0x07 || || [[CT_OBJECT]] || 80 || 0x50 || | | | ppGlwNw |
| | | |
| | | |
| |- | | |- |
| | [[CT_PROGRESS]] || 8 || 0x08 || || [[CT_OBJECT_ZOOM]] || 81 || 0x51 || | | | ppGLu |
| | | |
| | | |
| |- | | |- |
| | [[CT_HTML]] || 9 || 0x09 || || [[CT_OBJECT_CONTAINER]] || 82 || 0x52 || | | | stpCBUpd |
| | | |
| | | |
| |- | | |- |
| | CT_STATIC_SKEW || 10 || 0x0A || || CT_OBJECT_CONT_ANIM || 83 || 0x53 || | | | ppQWt |
| | | |
| | | |
| |- | | |- |
| | [[CT_ACTIVETEXT#CT_ACTIVETEXT=11|CT_ACTIVETEXT]] || 11|| 0x0B|| || [[CT_LINEBREAK]] || 98 || 0x62 || | | | ppCMAA |
| | | |
| | | |
| |- | | |- |
| | [[CT_TREE]] || 12 || 0x0C || || [[CT_USER]] || 99 || 0x63 || | | | hudDr |
| | | |
| | | |
| |- | | |- |
| | [[CT_STRUCTURED_TEXT]] || 13 || 0x0D || || [[CT_MAP]] || 100 || 0x64 || | | | 3DEN_UI_OnDraw |
| | | |
| | | |
| |- | | |- |
| | [[CT_CONTEXT_MENU]] || 14 || 0x0E || || [[CT_MAP_MAIN]] || 101 || 0x65 || | | | 3DEN_PrepareDraw |
| | | |
| | | |
| |- | | |- |
| | [[CT_CONTROLS_GROUP]] || 15 || 0x0F || || [[CT_LISTNBOX]] || 102 || 0x66 || | | | clObL |
| | | |
| | | |
| |- | | |- |
| | [[CT_SHORTCUTBUTTON]] || 16 || 0x10 || || CT_ITEMSLOT || 103 || 0x67 || | | | 3DEN_Drawing |
| | | |
| | | |
| |- | | |- |
| | CT_HITZONES || 17 || 0x11 || || CT_LISTNBOX_CHECKABLE || 104 || 0x68 || | | | stpTxtGS |
| | | |
| | | |
| |- | | |- |
| | CT_VEHICLETOGGLES || 18 || 0x12 || || CT_VEHICLE_DIRECTION || 105 || 0x69 || | | | txt2D |
| | | |
| | | |
| |- | | |- |
| | [[CT_CONTROLS_TABLE]] || 19 || 0x13 || | | | mapDr |
| | | |
| | | |
| |- | | |- |
| | [[CT_XKEYDESC]] || 40 || 0x28 || | | | mapSeaAndNormal |
| | | |
| | | |
| |- | | |- |
| | CT_XBUTTON || 41 || 0x29 || | | | mapPM |
| |}
| | | |
| | | | |
| *'''Control Types Defines:'''
| |
| ''All defines can be retrieved by executing''
| |
| <code>"Default" [[call]] [[BIS_fnc_exportGUIBaseClasses]];</code>
| |
| <syntaxhighlight lang="cpp">
| |
| #define CT_STATIC 0
| |
| #define CT_BUTTON 1
| |
| #define CT_EDIT 2
| |
| #define CT_SLIDER 3
| |
| #define CT_COMBO 4
| |
| #define CT_LISTBOX 5
| |
| #define CT_TOOLBOX 6
| |
| #define CT_CHECKBOXES 7
| |
| #define CT_PROGRESS 8
| |
| #define CT_HTML 9
| |
| #define CT_STATIC_SKEW 10
| |
| #define CT_ACTIVETEXT 11
| |
| #define CT_TREE 12
| |
| #define CT_STRUCTURED_TEXT 13
| |
| #define CT_CONTEXT_MENU 14
| |
| #define CT_CONTROLS_GROUP 15
| |
| #define CT_SHORTCUTBUTTON 16
| |
| #define CT_HITZONES 17
| |
| #define CT_VEHICLETOGGLES 18
| |
| #define CT_CONTROLS_TABLE 19
| |
| #define CT_XKEYDESC 40
| |
| #define CT_XBUTTON 41
| |
| #define CT_XLISTBOX 42
| |
| #define CT_XSLIDER 43
| |
| #define CT_XCOMBO 44
| |
| #define CT_ANIMATED_TEXTURE 45
| |
| #define CT_MENU 46
| |
| #define CT_MENU_STRIP 47
| |
| #define CT_CHECKBOX 77
| |
| #define CT_OBJECT 80
| |
| #define CT_OBJECT_ZOOM 81
| |
| #define CT_OBJECT_CONTAINER 82
| |
| #define CT_OBJECT_CONT_ANIM 83
| |
| #define CT_LINEBREAK 98
| |
| #define CT_USER 99
| |
| #define CT_MAP 100
| |
| #define CT_MAP_MAIN 101
| |
| #define CT_LISTNBOX 102
| |
| #define CT_ITEMSLOT 103
| |
| #define CT_LISTNBOX_CHECKABLE 104
| |
| #define CT_VEHICLE_DIRECTION 105
| |
| </syntaxhighlight>
| |
| | |
| === Control Styles ===
| |
| To further customize controls there are several different styles for each control type available.<br>
| |
| | |
| To get an idea of how the styles look like you can create the following dialog:
| |
| <code>[[createDialog]] "RscTestControlStyles";</code>
| |
| | |
| {{Important | Note that drawing of vertical text is not supported and any attempt to use <tt>ST_UP</tt>, <tt>ST_DOWN</tt>, <tt>ST_VCENTER</tt> is likely to result in the following ''.rpt'' spam:<br><tt>Obsolete, sizeH and sizeW calculation missing</tt><br>In addition, <tt>ST_UP</tt>, <tt>ST_DOWN</tt>, <tt>ST_VCENTER</tt> are stand alone styles and should not be mixed with any other styles}}
| |
| | |
| {| class="wikitable" Style="Width: 100%"
| |
| ! Define !! Decimal !! Hexadecimal !! Remark
| |
| |- | | |- |
| | ST_LEFT || 0 || 0x00 || Default, text left aligned | | | lndPM |
| | | |
| | | |
| |- | | |- |
| | ST_RIGHT || 1 || 0x01 || Modifier, adding this to another style will force text to be aligned to the right | | | MapObjectsPrepTask |
| | | |
| | | |
| |- | | |- |
| | ST_CENTER || 2 || 0x02 || Modifier, adding this to another style will force text to be centered | | | mapSeaAndNormalDraw |
| | | |
| | | |
| |- | | |- |
| | ST_DOWN || 4 || 0x04 || Vertical text alignment (See the note above) | | | mapCntDraw |
| | | |
| | | |
| |- | | |- |
| | ST_UP || 8 || 0x08 || Vertical text alignment (See the note above) | | | mapObjectsDraw |
| | | |
| | | |
| |- | | |- |
| | ST_VCENTER || 12 || 0x0C || Vertical text alignment, same as ST_DOWN + ST_UP (See the note above) | | | mapForestShape |
| | | |
| | | |
| |- | | |- |
| | ST_SINGLE || 0 || 0x00 || Plain single line box without a border | | | mapGrid |
| | | |
| | | |
| |- | | |- |
| | ST_MULTI || 16 || 0x10 || Plain multiple line box with a slight border. To remove border add 512 (+ ST_NO_RECT) to the style (style 528, 529 and 530 are therefore border-less). Additional parameter ''lineSpacing'' is required for this style. ''lineSpacing'' = 1; is normal line spacing. Any '''\n''' character in the text string will be interpreted as new line. | | | drwFn |
| | | |
| | | |
| |- | | |- |
| | ST_TITLE_BAR || 32 || 0x20 || Plain single line box with semi-transparent background and somewhat embossed border. When this style is used, the dialog containing control becomes draggable by this control | | | dtTot |
| | | |
| | | |
| |- | | |- |
| | ST_PICTURE || 48 || 0x30 || Border-less picture box. Text string is treated as a path to a texture. Alignment has no effect. The texture is stretched to fit the box by default. To force original aspect ratio add 2048 (+ ST_KEEP_ASPECT_RATIO) to the style. Background is ignored, ''colorText'' controls texture colour and opacity | | | wFram |
| | | |
| | | |
| |- | | |- |
| | ST_FRAME || 64 || 0x40 || Legend like frame without background with text showing over the frame edge. Alignment has no effect. ''colorText'' defines both text and frame colour | | | 3dSwp |
| | | |
| | | |
| |- | | |- |
| | ST_BACKGROUND || 80 || 0x50 || Single line box with always black opaque background and thick raised beveled border | | | preLd |
| | | |
| | | |
| |- | | |- |
| | ST_GROUP_BOX || 96 || 0x60 || Single line box with delicate semi-transparent background and slight border. Only text colour can be controlled | | | preLV |
| | | |
| | | |
| |- | | |- |
| | ST_GROUP_BOX2 || 112 || 0x70 || Plain single line box, same as ST_SINGLE, only with a slight border similar to ST_MULTI box border | | | actObjPrld |
| | | |
| | | |
| |- | | |- |
| | ST_HUD_BACKGROUND || 128 || 0x80 || Sets special texture for corners. It was used for rounded corners in OFP, Arma and Arma 2. In Arma 3, square corners are used everywhere, so the texture is adapted to the unified style, but the technology is not removed. In Arma 3 it looks the same as normal ST_SINGLE. Corner textures are defined in <tt>[[configFile]] >> "CfgInGameUI" >> "imageCornerElement"</tt> (can be set only globally for the whole game, not per control)” | | | hashChk |
| | | |
| | | |
| |- | | |- |
| | ST_TILE_PICTURE || 144 || 0x90 || The picture is tiled according to ''tileH'' and ''tileW'' values. To force tiled picture to keep aspect ratio of original image, add 2048 (+ ST_KEEP_ASPECT_RATIO) to the style. | | | sSim |
| | | |
| | | |
| |- | | |- |
| | ST_WITH_RECT || 160 || 0xA0 || Single line box frame, similar to ST_FRAME box. The text however is displayed inside the frame. Frame and text colour are set with ''colorText'' | | | enfWorkShort |
| | | |
| | | |
| |- | | |- |
| | ST_LINE || 176 || 0xB0 || Diagonal line going from left top corner to bottom right corner. To control line direction, width ''w'' and height ''h'' parameters of the box could be negative. Line and text colour are set with ''colorText'' | | | updAttPos |
| | | |
| | | |
| |- | | |- |
| | ST_UPPERCASE || 192 || 0xC0 || Forces control text to upper case | | | oSo1AN |
| | | |
| | | |
| |- | | |- |
| | ST_LOWERCASE || 208 || 0xD0 || Forces control text to lower case | | | prpAMCf |
| | | |
| | | |
| |- | | |- |
| | ST_ADDITIONAL_INFO || 3840 || 0x0F00 || ST_SHADOW + ST_NO_RECT + SL_HORZ + ST_KEEP_ASPECT_RATIO | | | prpAMCSlt |
| | | |
| | | |
| |- | | |- |
| | ST_SHADOW || 256 || 0x0100 || | | | prpSDM |
| | | |
| | | |
| |- | | |- |
| | ST_NO_RECT || 512 || 0x0200 || This style works for [[CT_STATIC]] in conjunction with ST_MULTI | | | locL |
| | | |
| | | |
| |- | | |- |
| | ST_KEEP_ASPECT_RATIO || 2048 || 0x0800 || When used with image or texture, stops it from stretching to fit the control | | | mapSeaAndNormalWork |
| | | |
| | | |
| |- | | |- |
| | ST_TITLE || 34 || 0x22 || ST_TITLE_BAR + ST_CENTER | | | mapObjectsPrepWork |
| |} | | | |
| | | | |
| ==== Control Specific Styles ====
| |
| | |
| '''[[CT_LISTBOX]] Specific Styles'''
| |
| {| class="wikitable"
| |
| ! Define !! Decimal !! Hexadecimal !! Remark
| |
| |- | | |- |
| | LB_TEXTURES || 16 || 0x10 || | | | drwIdxPrm |
| | | |
| | | |
| |- | | |- |
| | LB_MULTI || 32 || 0x20 || Makes [[CT_LISTBOX]] multi-selectable | | | oSo3 |
| |} | | | |
| | | | |
| '''[[CT_PROGRESS]] Specific Styles'''
| |
| {| class="wikitable" width="20%"
| |
| ! Define !! Decimal !! Hexadecimal
| |
| |- | | |- |
| | ST_VERTICAL || 1 || 0x01 | | | lsCVB |
| | | |
| | | |
| |- | | |- |
| | ST_HORIZONTAL || 0 || 0x00 | | | oSo5 |
| |} | | | |
| | | | |
| '''[[CT_SLIDER]] Specific Styles'''
| |
| {| class="wikitable" width="20%"
| |
| |- | | |- |
| ! Define !! Decimal !! Hexadecimal
| | | oSo2CL |
| | | |
| | | |
| |- | | |- |
| | SL_VERT || 0 || 0x00 | | | oSo1AF |
| | | |
| | | |
| |- | | |- |
| | SL_HORZ || 1024 || 0x0400 | | | Visualize |
| | | |
| | | |
| |- | | |- |
| | SL_TEXTURES || 16 || 0x10 | | | visul |
| |} | | | |
| | | | |
| '''[[CT_TREE]] Specific Styles'''
| |
| {| class="wikitable" width="20%"
| |
| ! Define !! Decimal !! Hexadecimal
| |
| |- | | |- |
| | TR_SHOWROOT || 1 || 0x01 | | | txMLo |
| | | |
| | | |
| |- | | |- |
| | TR_AUTOCOLLAPSE || 2 || 0x02 | | | oSo2Srt |
| |}
| | | |
| | | | |
| *'''Control Styles Definitions:'''
| |
| ''All defines can be retrieved by executing''
| |
| <code>"Default" [[call]] [[BIS_fnc_exportGUIBaseClasses]];</code>
| |
| <syntaxhighlight lang="cpp">
| |
| #define ST_LEFT 0x00
| |
| #define ST_RIGHT 0x01
| |
| #define ST_CENTER 0x02
| |
| #define ST_DOWN 0x04
| |
| #define ST_UP 0x08
| |
| #define ST_VCENTER 0x0C
| |
| #define ST_SINGLE 0x00
| |
| #define ST_MULTI 0x10
| |
| #define ST_TITLE_BAR 0x20
| |
| #define ST_PICTURE 0x30
| |
| #define ST_FRAME 0x40
| |
| #define ST_BACKGROUND 0x50
| |
| #define ST_GROUP_BOX 0x60
| |
| #define ST_GROUP_BOX2 0x70
| |
| #define ST_HUD_BACKGROUND 0x80
| |
| #define ST_TILE_PICTURE 0x90
| |
| #define ST_WITH_RECT 0xA0
| |
| #define ST_LINE 0xB0
| |
| #define ST_UPPERCASE 0xC0
| |
| #define ST_LOWERCASE 0xD0
| |
| #define ST_ADDITIONAL_INFO 0x0F00
| |
| #define ST_SHADOW 0x0100
| |
| #define ST_NO_RECT 0x0200
| |
| #define ST_KEEP_ASPECT_RATIO 0x0800
| |
| #define ST_TITLE ST_TITLE_BAR + ST_CENTER
| |
| #define SL_VERT 0
| |
| #define SL_HORZ 0x400
| |
| #define SL_TEXTURES 0x10
| |
| #define ST_VERTICAL 0x01
| |
| #define ST_HORIZONTAL 0
| |
| #define LB_TEXTURES 0x10
| |
| #define LB_MULTI 0x20
| |
| #define TR_SHOWROOT 1
| |
| #define TR_AUTOCOLLAPSE 2
| |
| </syntaxhighlight>
| |
| | |
| === Positioning ===
| |
| The position has to fulfill the following goals:
| |
| * Scale properly with interface size set by the user
| |
| * Work on all common aspect rations and resolution (Mainly 1920p by 1080p and 16:9 aspect ratio according to valve's statistic from 2020)
| |
| {{wip}}
| |
| //Some description, common issues/problems, best practices
| |
| * [[Arma_3_GUI_Coordinates]]
| |
| * [[Arma 3 Pixel Grid System]]
| |
| * [[SafeZone]]
| |
| | |
| [[User:7erra|7erra]] ([[User talk:7erra|talk]]): Remind user that not everyone has the same settings as him. Best practice is to create the UI with the following settings (even if they look like s*it): UI size: Very Large, Ratio: 4:3 (actually 5:4 but no one uses that one). Here is a graph I created which shows the resolutions used by Steam users: https://imgur.com/a/WrFXZaN
| |
| | |
| == Inheritance ==
| |
| <!-- added by Dr_Eyeball. Example not tested. 11 May 2007. Modify it as you see fit, but don't forget this important topic. -->
| |
| <!-- Nasty person and Java developer that I am, I dared to move all opening braces at the end of the previous line to make it look more compact. Furthermore I removed some placeholders, because they didn't seem to be needed that much. I hope you don't mind. Also, I love to meddle… :) ~~~~ -->
| |
| Using inheritance can reduce your dialog class definitions significantly by standardising common attributes in base classes and just changing unique attributes in derived classes. There is no need to redeclare all attributes for each class definition.
| |
| | |
| [[User:7erra|7erra]] ([[User talk:7erra|talk]]): As well as keeping a uniform style.
| |
| | |
| *'''Example Config:'''
| |
| <syntaxhighlight lang="cpp">class RscText // Base definition used for inheritance
| |
| {
| |
| type = CT_STATIC;
| |
| idc = -1;
| |
| style = ST_LEFT;
| |
| colorBackground[] = {0, 0, 0, 1};
| |
| colorText[] = {1, 1, 1, 1};
| |
| font = FontM;
| |
| sizeEx = 0.04;
| |
| h = 0.04;
| |
| text = "";
| |
| };
| |
| | |
| class My_BlueText : RscText // My_BlueText inherits all attributes from RscText defined above, thus only x,w & colorText need to be changed
| |
| {
| |
| colorText[] = {0, 0, 1, 1};
| |
| x = 0.1;
| |
| w = 0.4;
| |
| };
| |
| | |
| class My_Dialog
| |
| {
| |
| //…
| |
| | |
| controls[] = {
| |
| My_Text_1,
| |
| My_Text_2
| |
| };
| |
| | |
| class My_Text_1 : My_BlueText // My_Text_1 inherits all attribute from My_BlueText, therefore only text & y attributes have to be changed
| |
| {
| |
| text = "Line 1";
| |
| y = 0.2;
| |
| };
| |
| | |
| class My_Text_2 : My_BlueText
| |
| {
| |
| text = "Line 2";
| |
| y = 0.25;
| |
| };
| |
| };
| |
| </syntaxhighlight>
| |
| | |
| == Preprocessor instructions ==
| |
| Note that you can also add your own [[PreProcessor_Commands|preprocessor instructions]] for commonly used data, eg. for colors, to save yourself the hassle of writing it in several different places and then adapt each of them if you want to change them afterwards (especially if class inheritance isn't applicable). Also it can make your code look more readable sometimes.
| |
| | |
| *'''Example Config:'''
| |
| <syntaxhighlight lang="cpp">
| |
| #define COLOR_LIGHTBROWN { 0.776, 0.749, 0.658, 1 }
| |
| #define COLOR_HALF_BLACK { 0, 0, 0, 0.5 }
| |
| #define COLOR_TRANSPARENT { 0, 0, 0, 0 }
| |
| | |
| class MyDialog
| |
| {
| |
| idd = -1;
| |
| movingEnable = 1;
| |
| objects[] = {};
| |
| controlsBackground[] = { MyDialogBackground };
| |
| controls[] = { MyDialogText };
| |
| | |
| class MyDialogBackground : RscText
| |
| {
| |
| colorBackground[] = COLOR_HALF_BLACK;
| |
| x = 0.7; y = 0.1;
| |
| w = 0.25; h = 0.15;
| |
| };
| |
| | |
| class MyDialogText : RscText
| |
| {
| |
| style = ST_MULTI;
| |
| colorBackground[] = COLOR_TRANSPARENT;
| |
| colorText[] = COLOR_LIGHTBROWN;
| |
| text = "No power in the 'Verse can stop me.";
| |
| lineSpacing = 1;
| |
| x = 0.71; y = 0.11;
| |
| w = 0.23; h = 0.13;
| |
| };
| |
| };</syntaxhighlight>
| |
| | |
| === Useful includes ===
| |
| {{arma3}} offers a wide range of useful files which can be included to get access to some helpful macros.
| |
| {| class="wikitable"
| |
| |- | | |- |
| ! Include Code !! Description / Content
| | | oSoSdw |
| | | |
| | | |
| |- | | |- |
| | <syntaxhighlight lang="cpp">#include "\a3\3DEN\UI\macros.inc"</syntaxhighlight> || Defines for [[Eden Editor]] like colors, text sizes custom pixel grid macros. | | | prpAMCbsi |
| | | |
| | | |
| |- | | |- |
| | <syntaxhighlight lang="cpp">#include "\a3\3DEN\UI\macroexecs.inc"</syntaxhighlight> || Defines for [[Eden Editor]] to calculate text sizes etc. | | | prpAMCp |
| | | |
| | | |
| |- | | |- |
| | <syntaxhighlight lang="cpp">#include "\a3\ui_f\hpp\definedikcodes.inc"</syntaxhighlight> || Useful when working with custom shortcuts. Contains defines for key codes. | | | Render |
| | | |
| | | |
| |- | | |- |
| | <syntaxhighlight lang="cpp">#include "\a3\ui_f\hpp\definecommoncolors.inc"</syntaxhighlight> || Colors used in {{arma3}}, like background color set by the user. | | | bgD3D |
| | | |
| | | |
| |- | | |- |
| | <syntaxhighlight lang="cpp">#include "\a3\ui_f\hpp\definecommongrids.inc"</syntaxhighlight> || UI grids such as GUI_GRID and all its variants. | | | stpTxtVS |
| | | |
| | | |
| |- | | |- |
| | <syntaxhighlight lang="cpp">#include "\a3\ui_f\hpp\defineresincl.inc"</syntaxhighlight> || IDCs and IDDs of many {{arma3}} UIs. | | | ppHBAOPlus |
| | | |
| | | |
| |} | | |} |
|
| |
|
| | <sqf> |
| | private _ctrlTV = ctrlparent (_this select 0) displayCtrl 101; |
| | |
| | private _export = "{| class=""wikitable sortable""" + endl + "|-" + endl; |
| | _export = _export + "! Technical Name !! Descriptive Name !! Description"; |
| | |
| | private _fnc_logChilden = |
| | { |
| | params ["_path"]; |
| | |
| | for "_i" from 0 to ((_ctrlTV tvCount _path) - 1) do |
| | { |
| | private _text = _ctrlTV tvText (_path + [_i]); |
| | _text = _text splitString " " select 0; |
|
| |
|
| = Eventhandlers =
| | if !(_text in _export) then |
| To give the dialog its functionality, one will have to use user interface eventhandlers (UIEH). This way you can assign actions to buttons, listboxes, etc.
| | { |
| * [[User Interface Event Handlers]]
| | _export = _export + endl + "|-" + endl + "| " + _text + endl + "| " + endl + "| "; |
| | }; |
|
| |
|
| = Scripting =
| | if (_ctrlTV tvCount (_path + [_i]) > 0 ) then |
| There are several commands to influence your dialog after its initial creation. These command are listed on the following pages:
| | { |
| * [[:Category:Command Group: GUI Control|GUI Commands]]
| | [_path + [_i]] call _fnc_logChilden; |
| * [[:Category:Function_Group:_GUI|GUI Functions]]
| | }; |
| | }; |
| | }; |
|
| |
|
| = Native {{arma3}} GUIs =
| | [[]] call _fnc_logChilden; |
| {{arma3}} comes with a wide varity of various displays and dialogs. They can be found in:
| |
| *[[configFile]] usually with names like '''Rsc'''SomeDisplayName or '''Display'''SomeDisplayName
| |
|
| |
|
| Additonally, {{arma3}} offers some customizeable GUIs which can be accessed by scripts.
| | copyToClipboard (_export + endl + "|}" + endl); |
| * [[BIS_fnc_3DENShowMessage]]
| | </sqf> |
| * [[BIS_fnc_guiMessage]]
| |
| * [[BIS_fnc_GUIhint]]
| |
| * [[hint]], [[hintSilent]], [[hintC]]
| |
|
| |
|
| = GUI References = | | == See Also == |
| Sometimes it's a good idea so see how others created their GUIs. Here's a list of a few resources:
| |
| * [https://github.com/7erra/-Terra-s-Editing-Extensions/tree/master/TER_editing/gui Terra's Editing Extentions]
| |
| * [https://github.com/ConnorAU/A3ExtendedFunctionViewer A3ExtendedFunctionViewer]
| |
| * [https://github.com/ConnorAU/A3UserInputMenus A3UserInputMenus]
| |
| * [https://github.com/ConnorAU/A3ColorPicker A3ColorPicker]
| |
| * [https://github.com/R3voA3/3den-Enhanced/tree/master/3denEnhanced/GUI 3den Enhanced]
| |
|
| |
|
| = Tips for creating GUIs =
| | * [[Code Optimisation]] |
| * Functionality
| | * [[Mission Optimisation]] |
| * Layout
| |
| * Style
| |
| * Behaviour | |
| * Customizability | |
| * ...
| |
| {{wip}}
| |
|
| |
|
| = Tutorials =
| |
| {{wip}}
| |
|
| |
|
| = Misc =
| | [[Category:Arma Scripting Tutorials]] |
| * [[Arma_3_IDD_List]]
| |
| * [[Arma 3 User Interface Editor]]
| |