added exec_server button to code editor

This commit is contained in:
Raymix 2017-05-24 21:18:06 +01:00
parent 209999fc9d
commit 246ce8757e
5 changed files with 24 additions and 9 deletions

View File

@ -177,26 +177,26 @@ class dUI_editor {
idc = 7212;
x = 0.155;
y = 0.928;
w = 0.39;
w = 0.265;
h = 0.068;
onMouseButtonUp = "'slider' call rmx_fnc_codeEditorActions";
};
class ce_btn_Execute: RscButton
class ce_btn_Client: RscButton
{
idc = 7213;
text = "Execute"; //--- ToDo: Localize;
text = "Client"; //--- ToDo: Localize;
x = 0.825;
y = 0.92;
w = 0.1025;
h = 0.08;
colorText[] = {1,0.5,0,1};
action = "'execute' call rmx_fnc_codeEditorActions";
action = "'exec_client' call rmx_fnc_codeEditorActions";
};
class ce_btn_save: RscButton
{
idc = 7214;
text = "Save Tab"; //--- ToDo: Localize;
x = 0.7;
x = 0.5725;
y = 0.92;
w = 0.1025;
h = 0.08;
@ -207,12 +207,23 @@ class dUI_editor {
{
idc = 7215;
text = "Clear Tab"; //--- ToDo: Localize;
x = 0.575;
x = 0.4475;
y = 0.92;
w = 0.1025;
h = 0.08;
colorText[] = {1,0.5,0,1};
action = "'clear' call rmx_fnc_codeEditorActions";
};
class ce_btn_Server: RscButton
{
idc = 7216;
text = "Server"; //--- ToDo: Localize;
x = 0.6975;
y = 0.92;
w = 0.1025;
h = 0.08;
colorText[] = {1,0.5,0,1};
action = "'exec_server' call rmx_fnc_codeEditorActions";
};
};
};

View File

@ -24,7 +24,7 @@ _display displayAddEventHandler ["keyDown", "_this call rmx_fnc_keyDown;"];
rmx_var_ctrl_editorMain = [_display displayCtrl 7200, _display displayCtrl 7300];
rmx_var_ctrl_editorItems = [];
for "_i" from 7200 to 7215 do {
for "_i" from 7200 to 7216 do {
rmx_var_ctrl_editorItems set [count rmx_var_ctrl_editorItems,_display displayCtrl _i];
};

View File

@ -12,12 +12,16 @@ _tab = param [1, 0];
switch (_action) do
{
case "execute":
case "exec_client":
{
playSound "click";
_code = ctrlText (rmx_var_ctrl_editorItems select 1);
call compile _code; //add try catch
};
case "exec_server":
{
hintSilent (ctrlText (rmx_var_ctrl_editorItems select 1));
};
case "save":
{
playSound "click";
@ -66,7 +70,7 @@ switch (_action) do
(rmx_var_ctrl_editorItems select rmx_var_editorIndex + 2) ctrlSetTextColor (call rmx_fnc_getColorScheme);
(rmx_var_ctrl_editorMain select 1) ctrlSetBackgroundColor (call rmx_fnc_getColorScheme);
for "_c" from 13 to 15 do {
for "_c" from 13 to 16 do {
(rmx_var_ctrl_editorItems select _c) ctrlSetTextColor (call rmx_fnc_getColorScheme);
};
};