CT_EXTENSION

From Bohemia Interactive Community
Revision as of 15:49, 20 August 2024 by Dedmen (talk | contribs)
Jump to navigation Jump to search

Introduction

Extension controls are controlled and rendered by Extensions. The constant type property for these controls usually is CT_EXTENSIONC.


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_EXTENSION 107



C

colorBackground

Type
Array
Description
Color of the background (The backing texture gets cleared to this color before the Extension's OnDraw). If the UI is not created (Extension not found, or doesn't offer the uiClass), this color fills the whole control.
colorBackground[] = {0,0,0,0};


E

extension

Type
String
Description
Name of the Extension that provides this UI Control.
extension = "RVExtensionTest";


T

tileH

Type
Number, String
Description
Height of one tile. Used with ST_TILE_PICTURE to create a repeating wall of pictures, such as the fullscreen backgrounds in the Eden Editor. Uses GUI Coordinates.

Number example:

tileH = 1;

String example:

tileH = "4 / (32 * pixelH)";


tileW

Type
Number, String
Description
Width of one tile. Used with ST_TILE_PICTURE to create a repeating wall of pictures, such as the fullscreen backgrounds in the Eden Editor. Uses GUI Coordinates.

Number example:

tileW = 1;

String example:

tileW = "8 / (32 * pixelW)";


U

uiClass

Type
String
Description
"Classname" of the UI, gets passed to the Extension, the Extension has to interpret it and choose what UI to display (If the Extension offers multiple UI Elements).
uiClass = "TestUI_123";



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 (see the import keyword).

In older versions, use "Default" call BIS_fnc_exportGUIBaseClasses; and paste the result into the description.ext.


RscExtension

Baseline RscExtension example

class RscExtension
{
	type = CT_EXTENSION; // 107
	idc = -1;
	deletable = 0;
	style = 0;
	colorBackground[] = {0,0,0,0};
	x = 0;
	y = 0;
	w = 0.3;
	h = 0.3;
	extension = "ExtensionNameHere";
	uiClass = "ClassNameHere";
};

RscWebBrowser

Web Browser sample, utilizing https://github.com/arma3/RVExtensionImGui/blob/main/dllmain.cpp#L76

class RscExtension
{
	type = CT_EXTENSION; // 107
	idc = -1;
	deletable = 0;
	style = 0;
	colorBackground[] = {0,0,0,0};
	x = 0;
	y = 0;
	w = 0.3;
	h = 0.3;
	extension = "RVExtensionTest";
	uiClass = "webbrowser_https://arma3.com/";
};