Lou Montana/Sandbox – User

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Future Template:Header/Tutorial template)
m (Test [edit] links)
Line 1: Line 1:
[[Category: Sandbox]]
[[Category: Sandbox]]
<noinclude>
<includeonly>
-----
{{#switch: {{lc:{{{1}}}}}
Future [[Template:Header/Tutorial|Header/Tutorial]] template
 
</noinclude><includeonly>{{Feature|informative
|intro = {{#ifeq:{{uc:{{FULLPAGENAME}}}}|TEMPLATE:CT||{{DISPLAYTITLE:{{{macro}}}}}}}{{Navbox/CT}}
|
{{ConfigPage|start}}
* {{#if:{{{target|}}}
== Introduction ==
| Target: {{#switch:{{{target}}}
{{{description}}}
  |0= newcomer
{{#if: {{{gallery|}}}|
  |1= beginner
{{#tag:gallery|{{{gallery}}}|mode="slideshow"|heights=240px|widths=240px}}
  |2= moderate
  |3= advanced
  |4= expert
  |#default= -wrong target defined-
}}
}}
| -no target defined-}}
 
* {{#if:{{{difficulty|}}}
=== Related commands & functions ===
| Difficulty: {{#switch:{{{difficulty}}}
* [[:Category:Command_Group:_GUI_Control|Commands: General]]
  |0= easy {{Colorball|green}}
* [[:Category:Command_Group:_GUI_Control_-_Event_Handlers|Commands: UI Eventhandlers]]<!--
  |1= normal {{Colorball|orange}}
-->{{#if: {{{commands|}}} |  
  |2= hard {{Colorball|red}}
{{{commands}}}
  |#default= -wrong difficulty defined-
}}
}}
| -no difficulty defined-}}
 
{{#if:{{{prerequisites|}}}
=== Related User Interface Eventhandlers ===
|
* [[User_Interface_Event_Handlers#Generic_events|Events: General]]<!--
* Prerequisites:<br>
-->{{#if: {{{events|}}} |  
{{{prerequisites}}}
{{{events}}}
}}
}}
}}</includeonly><noinclude>{{Doc/Template
 
|descr= Tutorial header.
== Alphabetical Order ==
|param1= target
{{Feature|Informative|TokenNames common to most controls, such as x, y, w, h, text, idc... can be found [[Arma:_GUI_Configuration#Common_Properties|'''here''']].}}
|descr1= number in range 0..4: newcomer - beginner - moderate - advanced - expert
{{Feature|Warning|Not all of the listed attributes might have an effect nor might the list be complete. All attributes were gathered with [https://github.com/7erra/BIKI.VR/blob/master/fnc/generateCTPage.sqf this] config crawler.}}
|param2= difficulty
{{#tag:syntaxhighlight|#define {{{macro}}} {{{value}}}|lang=cpp}}
|descr2= number in range 0..2: easy - normal - hard
 
|param3= prerequisites
|abc start = {{ConfigPage|abc}}
|descr3= (Optional) free text for prerequisite tutorials/knowledge. make a (sub-)list with <nowiki>**</nowiki> and new lines
 
|example1= <nowiki>{{Header/Tutorial}}</nowiki>
|attribute =<nowiki/>
|result1= {{User:Lou_Montana/Sandbox}}
==== {{{name}}} ====
|example2= <nowiki>{{Header/Tutorial|target=0}}</nowiki>
{{#if: {{{mandatory|}}} |{{Feature|important|This attribute is mandatory for the control to work!}}}}
|result2= {{User:Lou_Montana/Sandbox|target=0}}
; Type: [[TokenNameValueTypes|{{{type1}}}]]{{#if: {{{type2|}}} | , [[TokenNameValueTypes|{{{type2}}}]]}}{{#if: {{{type3|}}} | , [[TokenNameValueTypes|{{{type3}}}]]}}{{#if: {{{type4|}}} | , [[TokenNameValueTypes|{{{type4}}}]]}}
|example3= <nowiki>{{Header/Tutorial|target=0|difficulty=0}}</nowiki>
; Description: {{#if: {{{description|}}}|{{{description}}}|n/a}}
|result3= {{User:Lou_Montana/Sandbox|target=0|difficulty=0}}
{{#if: {{{type2|}}}|{{{type1}}} example:}}
|example4= <nowiki>{{Header/Tutorial|target=0|difficulty=1|prerequisites=a prerequisite}}</nowiki>
{{#tag:syntaxhighlight|{{#switch: {{{type1}}}
|result4= {{User:Lou_Montana/Sandbox|target=0|difficulty=1|prerequisites=a prerequisite}}
| Array = {{{name}}}[] = {{{value1}}};
|example5= <span style="white-space: pre"><nowiki>{{Header/Tutorial|target=0|difficulty=2|prerequisites=** prerequisite 1
| Class = {{{value1}}}
** prerequisite 2}}</nowiki></span>
| {{{name}}} {{=}} {{{value1}}};
|result5= {{User:Lou_Montana/Sandbox|target=0|difficulty=2|prerequisites=** prerequisite 1
}}|lang="cpp"}}
** prerequisite 2}}
{{#if: {{{type2|}}}|{{{type2}}} example:
}}</noinclude>
{{#tag:syntaxhighlight|{{#switch: {{{type2}}}
| Array = {{{name}}}[] = {{{value2}}};
| Class = {{{value2}}}
| {{{name}}} {{=}} {{{value2}}};
}}|lang=cpp}}}}
{{#if: {{{type3|}}}|{{{type3}}} example:
{{#tag:syntaxhighlight|----
{{#switch: {{{type3}}}
| Array = {{{name}}}[] = {{{value3}}};
| Class = {{{value3}}}
| {{{name}}} {{=}} {{{value3}}};
}}|lang=cpp}}}}
{{#if: {{{type4|}}}|{{{type4}}} example:
{{#tag:syntaxhighlight|----
{{#switch: {{{type4}}}
| Array = {{{name}}}[] = {{{value4}}};
| Class = {{{value4}}}
| {{{name}}} {{=}} {{{value4}}};
}}|lang=cpp}}}}
 
|abc end = {{ConfigPage|end}}
 
|examples = == Default Classes ==
{{Feature|arma3|'''AddOns:''' Classes need to be initialised first with {{ic|class SomeClass;}}
----
'''Missions:''' Since {{arma3}} v2.02 one can use {{ic|[[import]] SomeClass;}} to initialise a class. In older versions, use {{ic|"Default" [[call]] [[BIS_fnc_exportGUIBaseClasses]];}} and paste the result into the [[Description.ext|description.ext]].}}}}
</includeonly><noinclude>
== Usage ==
<pre>{{User:Lou Montana/Sandbox|mode|arg1=value|arg2=value2|...}}</pre>
{| class="wikitable"
! Mode !! Arguments !! Description !! Example
|-
| rowspan="6" | '''intro''' || macro || Control type macro from [[BIS_fnc_exportGUIBaseClasses]]. || <pre>CT_STATIC</pre>
|-
| value || Value of the macro. || <pre>0</pre>
|-
| description || Some text to give info about the CT. || <pre>This is CT_MAP. It is a map.</pre>
|-
| gallery || List of images to display in a gallery below the description. || <pre>File:Image.jpg{{!}}This is an image of the control.</pre>
|-
| commands || List of commands associated with the control. ||<pre>* [[:Category:Command_Group:_GUI_Control_-_Controls_Table|Commands: Controls Table]]</pre>
|-
| events || List of UIEH that work on the control. || <pre>* [[User_Interface_Event_Handlers|Events: All]]</pre>
|-
| colspan="4" |
|-
| '''abc start''' || no arguments || Marks the beggining of the config reference part with the use of the '''attribute''' mode. ||
|-
| colspan="4" |
|-
| rowspan="5" | '''attribute''' || name || Name of the attribute. || <pre>text</pre>
|-
| value1-4 || Possible values of the config entry. Has to match the type given by type1-4. || <pre>"This is a string"</pre>
|-
| type1-4 || Type of the respective value. Possible values: Number, String, Array, Class. Each type/value pair gets an example.|| <pre>String</pre>
|-
| description || What does the attribute do? || <pre>This string displays text.</pre>
|-
| mandatory || If defined a yellow warning box will be displayed at the attributes position. Mandatory attributes throw an error in RPT when omitted. || <pre>1</pre>
|-
| colspan="4" |
|-
| '''abc end''' || no arguments || Marks the end of the config reference. ||
|-
| colspan="4" |
|-
| '''examples''' || no arguments || Inserts the header and a disclaimer at this position. ||
|}
 
You can inspect the generator code for this page by clicking EDIT on the top right. The code starts below this line:<br>
------------------------------------------------------------------------------------------------------------------------
 
{{User:Lou Montana/Sandbox|intro
|macro = CT_TREE
|value = 1234
|description = Informative text about this control type.
|gallery = File:CT COMBO.jpg {{!}}Example image 1.
File:BIS fnc 3DENDiagFonts example.jpg{{!}}Image 2.
|commands = * command group CT
|events =  
* event1
* event2
}}
 
{{User:Lou Montana/Sandbox|abc start}}
=== T ===
{{User:Lou Montana/Sandbox|attribute
| name=testArray
| value1={1,0,0,1}
| type1=Array
| description=This is a test array to test arrays. {{Feature|important|Notice Me!}}
}}
{{User:Lou Montana/Sandbox|attribute
| name=testAttribute
| value1="test"
| type1=String
| mandatory=1
}}
 
{{User:Lou Montana/Sandbox|attribute
| name=testClass
| type1=Class
| value1=class ComboScrollBar
{
color[] = {1,1,1,1};
colorActive[] = {1,1,1,1};
colorDisabled[] = {1,1,1,0.3};
thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa";
shadow = 0;
scrollSpeed = 0.06;
width = 0;
height = 0;
autoScrollEnabled = 0;
autoScrollSpeed = -1;
autoScrollDelay = 5;
autoScrollRewind = 0;
};
| type2=Number
| value2=9876
| description=This is a test class to test classes.
}}
{{User:Lou Montana/Sandbox|abc end}}
 
{{User:Lou Montana/Sandbox|examples}}
=== RscExample ===
<syntaxhighlight lang="cpp">
class RscExample
{
deletable = 0;
fade = 0;
access = 0;
type = CT_TYPEMACRO;
style = SL_HORZ;
color[] = {1,1,1,0.8};
colorActive[] = {1,1,1,1};
shadow = 0;
x = 0;
y = 0;
w = 0.3;
h = 0.025;
};
</syntaxhighlight>
 
[[Category:Templates|{{uc:{{PAGENAME}}}}]]
</noinclude>

Revision as of 11:12, 27 July 2022


Usage

{{User:Lou Montana/Sandbox|mode|arg1=value|arg2=value2|...}}
Mode Arguments Description Example
intro macro Control type macro from BIS_fnc_exportGUIBaseClasses.
CT_STATIC
value Value of the macro.
0
description Some text to give info about the CT.
This is CT_MAP. It is a map.
gallery List of images to display in a gallery below the description.
File:Image.jpg{{!}}This is an image of the control.
commands List of commands associated with the control.
* [[:Category:Command_Group:_GUI_Control_-_Controls_Table|Commands: Controls Table]]
events List of UIEH that work on the control.
* [[User_Interface_Event_Handlers|Events: All]]
abc start no arguments Marks the beggining of the config reference part with the use of the attribute mode.
attribute name Name of the attribute.
text
value1-4 Possible values of the config entry. Has to match the type given by type1-4.
"This is a string"
type1-4 Type of the respective value. Possible values: Number, String, Array, Class. Each type/value pair gets an example.
String
description What does the attribute do?
This string displays text.
mandatory If defined a yellow warning box will be displayed at the attributes position. Mandatory attributes throw an error in RPT when omitted.
1
abc end no arguments Marks the end of the config reference.
examples no arguments Inserts the header and a disclaimer at this position.

You can inspect the generator code for this page by clicking EDIT on the top right. The code starts below this line:


Introduction

Informative text about this control type.

Related commands & functions

Related User Interface Eventhandlers

Alphabetical Order

TokenNames common to most controls, such as x, y, w, h, text, idc... can be found here.
Not all of the listed attributes might have an effect nor might the list be complete. All attributes were gathered with this config crawler.
#define CT_TREE 1234

T

testArray

Type
Array
Description
This is a test array to test arrays.
Notice Me!
testArray[] = {1,0,0,1};

testAttribute

This attribute is mandatory for the control to work!
Type
String
Description
n/a
testAttribute = "test";

testClass

Type
Class, Number
Description
This is a test class to test classes.

Class example:

class ComboScrollBar
{
	color[] = {1,1,1,1};
	colorActive[] = {1,1,1,1};
	colorDisabled[] = {1,1,1,0.3};
	thumb = "\A3\ui_f\data\gui\cfg\scrollbar\thumb_ca.paa";
	arrowEmpty = "\A3\ui_f\data\gui\cfg\scrollbar\arrowEmpty_ca.paa";
	arrowFull = "\A3\ui_f\data\gui\cfg\scrollbar\arrowFull_ca.paa";
	border = "\A3\ui_f\data\gui\cfg\scrollbar\border_ca.paa";
	shadow = 0;
	scrollSpeed = 0.06;
	width = 0;
	height = 0;
	autoScrollEnabled = 0;
	autoScrollSpeed = -1;
	autoScrollDelay = 5;
	autoScrollRewind = 0;
};

Number example:

testClass = 9876;

Default Classes

Arma 3
AddOns: Classes need to be initialised first with class SomeClass;
Missions: Since Arma 3 v2.02 one can use import SomeClass; to initialise a class. In older versions, use "Default" call BIS_fnc_exportGUIBaseClasses; and paste the result into the description.ext.

RscExample

class RscExample
{
	deletable = 0;
	fade = 0;
	access = 0;
	type = CT_TYPEMACRO;
	style = SL_HORZ;
	color[] = {1,1,1,0.8};
	colorActive[] = {1,1,1,1};
	shadow = 0;
	x = 0;
	y = 0;
	w = 0.3;
	h = 0.025;
};