Add config style validation

This commit is contained in:
Glowbal 2016-04-07 19:51:12 +02:00
parent a8c0840cd1
commit f409ce8248
8 changed files with 571 additions and 413 deletions

View File

@ -12,6 +12,7 @@ before_script:
fi fi
script: script:
- python3 tools/sqf_validator.py - python3 tools/sqf_validator.py
- python3 tools/config_style_checker.py
- if [ -n "${GH_TOKEN}" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then - if [ -n "${GH_TOKEN}" ] && [ "${TRAVIS_BRANCH}" == "master" ] && [ "${TRAVIS_PULL_REQUEST}" == "false" ]; then
python3 tools/deploy.py; python3 tools/deploy.py;
fi fi

View File

@ -76,349 +76,349 @@
class RscText; class RscText;
class DAGR_Button { class DAGR_Button {
idc = -1; idc = -1;
type = CT_BUTTON; type = CT_BUTTON;
style = ST_LEFT; style = ST_LEFT;
font = "RobotoCondensed"; font = "RobotoCondensed";
sizeEx = 0.02; sizeEx = 0.02;
colorText[] = { 0, 1, 0, 1 }; colorText[] = { 0, 1, 0, 1 };
colorFocused[] = { 0, 0, 0, 0 }; // border color for focused state colorFocused[] = { 0, 0, 0, 0 }; // border color for focused state
colorDisabled[] = { 0, 0, 0, 0 }; // text color for disabled state colorDisabled[] = { 0, 0, 0, 0 }; // text color for disabled state
colorBackground[] = { 0, 0, 0, 0 }; colorBackground[] = { 0, 0, 0, 0 };
colorBackgroundDisabled[] = { 0, 0, 0, 0 }; // background color for disabled state colorBackgroundDisabled[] = { 0, 0, 0, 0 }; // background color for disabled state
colorBackgroundActive[] = { 0, 0, 0, 0 }; // background color for active state colorBackgroundActive[] = { 0, 0, 0, 0 }; // background color for active state
offsetX = 0; offsetX = 0;
offsetY = 0; offsetY = 0;
offsetPressedX = 0; offsetPressedX = 0;
offsetPressedY = 0; offsetPressedY = 0;
colorShadow[] = { 0, 0, 0, 0 }; colorShadow[] = { 0, 0, 0, 0 };
colorBorder[] = { 0, 0, 0, 0 }; colorBorder[] = { 0, 0, 0, 0 };
borderSize = 0; borderSize = 0;
soundEnter[] = { "", 0, 1 }; // no sound soundEnter[] = { "", 0, 1 }; // no sound
soundPush[] = { "", 0, 1 }; soundPush[] = { "", 0, 1 };
soundClick[] = { "", 0, 1 }; // no sound soundClick[] = { "", 0, 1 }; // no sound
soundEscape[] = { "", 0, 1 }; // no sound soundEscape[] = { "", 0, 1 }; // no sound
x = 0.5; x = 0.5;
y = 0.5; y = 0.5;
w = 0.07; w = 0.07;
h = 0.05; h = 0.05;
text = ""; text = "";
action = ""; action = "";
}; };
class DAGR_Menu_Pic { class DAGR_Menu_Pic {
type = 0; type = 0;
idc = -1; idc = -1;
style = 48; style = 48;
x = 0; x = 0;
y = 0; y = 0;
w = 0.7; w = 0.7;
h = 1.4; h = 1.4;
text = ""; text = "";
colorBackground[] = {}; colorBackground[] = {};
colorText[] = {}; colorText[] = {};
font = "RobotoCondensed"; font = "RobotoCondensed";
sizeEx = 0.04; sizeEx = 0.04;
waitForLoad = 0; waitForLoad = 0;
}; };
class DAGR_Menu_Text { class DAGR_Menu_Text {
type = 0; type = 0;
idc = -1; idc = -1;
style = 0x00; style = 0x00;
x = 0.5; x = 0.5;
y = 0.5; y = 0.5;
w = 0.15; w = 0.15;
h = 0.15; h = 0.15;
colorBackground[] = { 0, 0, 0, 0 }; colorBackground[] = { 0, 0, 0, 0 };
colorText[] = { 0.239, 0.216, 0.153, 1 }; colorText[] = { 0.239, 0.216, 0.153, 1 };
font = "RobotoCondensed"; font = "RobotoCondensed";
sizeEx = 0.03; sizeEx = 0.03;
waitForLoad = 0; waitForLoad = 0;
text = ""; text = "";
}; };
class DAGR_Menu { class DAGR_Menu {
idd = 266860; idd = 266860;
movingEnable = false; movingEnable = false;
duration = 100000; duration = 100000;
fadein = 0; fadein = 0;
fadeout = 0; fadeout = 0;
name = "Dagr_Menu"; name = "Dagr_Menu";
onLoad = "uiNamespace setVariable ['DAGR_Menu', _this select 0]"; onLoad = "uiNamespace setVariable ['DAGR_Menu', _this select 0]";
onUnload = QUOTE(GVAR(PWR) = true); // Simulate pressing the power button onUnload = QUOTE(GVAR(PWR) = true); // Simulate pressing the power button
controls[] = {"DAGR_MENU_UI", "DAGR_PWR_Button", "DAGR_UP_Button", "DAGR_DOWN_Button", "DAGR_LEFT_Button", "DAGR_RIGHT_Button", "DAGR_NEXT_Button", controls[] = {"DAGR_MENU_UI", "DAGR_PWR_Button", "DAGR_UP_Button", "DAGR_DOWN_Button", "DAGR_LEFT_Button", "DAGR_RIGHT_Button", "DAGR_NEXT_Button",
"DAGR_SEL_Button", "DAGR_MENU_Button", "DAGR_F1_Button", "DAGR_F2_Button", "DAGR_F3_Button", "DAGR_F1_Text", "DAGR_F2_Text", "DAGR_F3_Text", "DAGR_MENU_OPTION0", "DAGR_SEL_Button", "DAGR_MENU_Button", "DAGR_F1_Button", "DAGR_F2_Button", "DAGR_F3_Button", "DAGR_F1_Text", "DAGR_F2_Text", "DAGR_F3_Text", "DAGR_MENU_OPTION0",
"DAGR_MENU_OPTION1", "DAGR_MENU_OPTION2", "DAGR_MENU_OPTION3", "DAGR_MENU_OPTION4", "DAGR_MENU_SELECTION0", "DAGR_MENU_SELECTION1", "DAGR_MENU_SELECTION2", "DAGR_MENU_OPTION1", "DAGR_MENU_OPTION2", "DAGR_MENU_OPTION3", "DAGR_MENU_OPTION4", "DAGR_MENU_SELECTION0", "DAGR_MENU_SELECTION1", "DAGR_MENU_SELECTION2",
"DAGR_MENU_SELECTION3", "DAGR_MENU_SELECTION4", "DAGR_MENU_Main_Text", "DAGR_MENU_PSELECTION1", "DAGR_MENU_PSELECTION2", "DAGR_MENU_PSELECTION3", "DAGR_MENU_SELECTION3", "DAGR_MENU_SELECTION4", "DAGR_MENU_Main_Text", "DAGR_MENU_PSELECTION1", "DAGR_MENU_PSELECTION2", "DAGR_MENU_PSELECTION3",
"DAGR_MENU_PSELECTION4", "DAGR_MENU_PSELECTION5", "DAGR_MENU_PSELECTION6","DAGR_MENU_PSELECTION7", "DAGR_MENU_PSELECTION8"}; "DAGR_MENU_PSELECTION4", "DAGR_MENU_PSELECTION5", "DAGR_MENU_PSELECTION6","DAGR_MENU_PSELECTION7", "DAGR_MENU_PSELECTION8"};
class DAGR_MENU_UI : DAGR_Menu_Pic { class DAGR_MENU_UI : DAGR_Menu_Pic {
idc = 266861; idc = 266861;
x = 0.175; x = 0.175;
y = -0.173; y = -0.173;
text = QUOTE(PATHTOF(UI\dagr_menu.paa)); text = QUOTE(PATHTOF(UI\dagr_menu.paa));
sizeEx = 0.1; sizeEx = 0.1;
}; };
class DAGR_PWR_Button : DAGR_Button { class DAGR_PWR_Button : DAGR_Button {
idc = 266863; idc = 266863;
action = QUOTE(GVAR(PWR) = true); action = QUOTE(GVAR(PWR) = true);
x = 0.40; x = 0.40;
y = 0.65; y = 0.65;
}; };
class DAGR_UP_Button : DAGR_Button { class DAGR_UP_Button : DAGR_Button {
idc = 266864; idc = 266864;
action = QUOTE(GVAR(UP) = true); action = QUOTE(GVAR(UP) = true);
x = 0.50; x = 0.50;
y = 0.675; y = 0.675;
}; };
class DAGR_DOWN_Button : DAGR_Button { class DAGR_DOWN_Button : DAGR_Button {
idc = 266865; idc = 266865;
action = QUOTE(GVAR(DOWN) = true); action = QUOTE(GVAR(DOWN) = true);
x = 0.50; x = 0.50;
y = 0.81; y = 0.81;
}; };
class DAGR_LEFT_Button : DAGR_Button { class DAGR_LEFT_Button : DAGR_Button {
idc = 266866; idc = 266866;
action = QUOTE(GVAR(LEFT) = true); action = QUOTE(GVAR(LEFT) = true);
x = 0.40; x = 0.40;
y = 0.735; y = 0.735;
w = 0.05; w = 0.05;
h = 0.07; h = 0.07;
}; };
class DAGR_RIGHT_Button : DAGR_Button { class DAGR_RIGHT_Button : DAGR_Button {
idc = 266867; idc = 266867;
action = QUOTE(GVAR(RIGHT) = true); action = QUOTE(GVAR(RIGHT) = true);
x = 0.62; x = 0.62;
y = 0.735; y = 0.735;
w = 0.05; w = 0.05;
h = 0.07; h = 0.07;
}; };
class DAGR_NEXT_Button : DAGR_Button { class DAGR_NEXT_Button : DAGR_Button {
idc = 266868; idc = 266868;
action = QUOTE(DAGR_NEXT = true); action = QUOTE(DAGR_NEXT = true);
x = 0.60; x = 0.60;
y = 0.65; y = 0.65;
}; };
class DAGR_SEL_Button : DAGR_Button { class DAGR_SEL_Button : DAGR_Button {
idc = 266869; idc = 266869;
action = QUOTE(GVAR(SEL) = true); action = QUOTE(GVAR(SEL) = true);
x = 0.54; x = 0.54;
y = 0.735; y = 0.735;
w = 0.06; w = 0.06;
h = 0.06; h = 0.06;
}; };
class DAGR_MENU_Button : DAGR_Button { class DAGR_MENU_Button : DAGR_Button {
idc = 266870; idc = 266870;
action = QUOTE(GVAR(MENU_B) = true); action = QUOTE(GVAR(MENU_B) = true);
x = 0.46; x = 0.46;
y = 0.735; y = 0.735;
w = 0.06; w = 0.06;
h = 0.06; h = 0.06;
}; };
class DAGR_F1_Button : DAGR_Button { class DAGR_F1_Button : DAGR_Button {
idc = 266871; idc = 266871;
action = QUOTE(GVAR(F1) = true); action = QUOTE(GVAR(F1) = true);
x = 0.40; x = 0.40;
y = 0.575; y = 0.575;
}; };
class DAGR_F2_Button : DAGR_Button { class DAGR_F2_Button : DAGR_Button {
idc = 266872; idc = 266872;
action = QUOTE(GVAR(F2) = true); action = QUOTE(GVAR(F2) = true);
x = 0.495; x = 0.495;
y = 0.575; y = 0.575;
}; };
class DAGR_F3_Button : DAGR_Button { class DAGR_F3_Button : DAGR_Button {
idc = 266873; idc = 266873;
action = QUOTE(GVAR(F3) = true); action = QUOTE(GVAR(F3) = true);
x = 0.59; x = 0.59;
y = 0.575; y = 0.575;
}; };
class DAGR_F1_Text : DAGR_Menu_Text { class DAGR_F1_Text : DAGR_Menu_Text {
idc = 266874; idc = 266874;
x = 0.388; x = 0.388;
y = 0.38; y = 0.38;
text = ""; text = "";
}; };
class DAGR_F2_Text : DAGR_Menu_Text { class DAGR_F2_Text : DAGR_Menu_Text {
idc = 266875; idc = 266875;
x = 0.506; x = 0.506;
y = 0.38; y = 0.38;
}; };
class DAGR_F3_Text : DAGR_Menu_Text { class DAGR_F3_Text : DAGR_Menu_Text {
idc = 266876; idc = 266876;
x = 0.612; x = 0.612;
y = 0.38; y = 0.38;
}; };
class DAGR_MENU_OPTION0 : DAGR_Menu_Text { class DAGR_MENU_OPTION0 : DAGR_Menu_Text {
idc = 2668777; idc = 2668777;
style = 0x02; style = 0x02;
sizeEx = 0.035; sizeEx = 0.035;
x = 0.43; x = 0.43;
y = 0.19; y = 0.19;
}; };
class DAGR_MENU_OPTION1 : DAGR_Menu_Text { class DAGR_MENU_OPTION1 : DAGR_Menu_Text {
idc = 2668778; idc = 2668778;
style = 0x02; style = 0x02;
sizeEx = 0.035; sizeEx = 0.035;
x = 0.43; x = 0.43;
y = 0.225; y = 0.225;
}; };
class DAGR_MENU_OPTION2 : DAGR_Menu_Text { class DAGR_MENU_OPTION2 : DAGR_Menu_Text {
idc = 2668779; idc = 2668779;
style = 0x02; style = 0x02;
sizeEx = 0.035; sizeEx = 0.035;
x = 0.43; x = 0.43;
y = 0.26; y = 0.26;
}; };
class DAGR_MENU_OPTION3 : DAGR_Menu_Text { class DAGR_MENU_OPTION3 : DAGR_Menu_Text {
idc = 2668780; idc = 2668780;
style = 0x02; style = 0x02;
sizeEx = 0.035; sizeEx = 0.035;
x = 0.43; x = 0.43;
y = 0.295; y = 0.295;
}; };
class DAGR_MENU_OPTION4 : DAGR_Menu_Text { class DAGR_MENU_OPTION4 : DAGR_Menu_Text {
idc = 2668781; idc = 2668781;
style = 0x02; style = 0x02;
sizeEx = 0.035; sizeEx = 0.035;
x = 0.43; x = 0.43;
y = 0.33; y = 0.33;
}; };
class DAGR_MENU_SELECTION0 : DAGR_Menu_Pic { class DAGR_MENU_SELECTION0 : DAGR_Menu_Pic {
idc = 2668783; idc = 2668783;
x = 0.42; x = 0.42;
y = 0.246; y = 0.246;
w = 0.17; w = 0.17;
h = 0.035; h = 0.035;
sizeEx = 0.05; sizeEx = 0.05;
}; };
class DAGR_MENU_SELECTION1 : DAGR_Menu_Pic { class DAGR_MENU_SELECTION1 : DAGR_Menu_Pic {
idc = 2668784; idc = 2668784;
x = 0.42; x = 0.42;
y = 0.281; y = 0.281;
w = 0.17; w = 0.17;
h = 0.035; h = 0.035;
sizeEx = 0.05; sizeEx = 0.05;
}; };
class DAGR_MENU_SELECTION2 : DAGR_Menu_Pic { class DAGR_MENU_SELECTION2 : DAGR_Menu_Pic {
idc = 2668785; idc = 2668785;
x = 0.42; x = 0.42;
y = 0.316; y = 0.316;
w = 0.17; w = 0.17;
h = 0.035; h = 0.035;
sizeEx = 0.05; sizeEx = 0.05;
}; };
class DAGR_MENU_SELECTION3 : DAGR_Menu_Pic { class DAGR_MENU_SELECTION3 : DAGR_Menu_Pic {
idc = 2668786; idc = 2668786;
x = 0.42; x = 0.42;
y = 0.351; y = 0.351;
w = 0.17; w = 0.17;
h = 0.035; h = 0.035;
sizeEx = 0.05; sizeEx = 0.05;
}; };
class DAGR_MENU_SELECTION4 : DAGR_Menu_Pic { class DAGR_MENU_SELECTION4 : DAGR_Menu_Pic {
idc = 2668787; idc = 2668787;
x = 0.42; x = 0.42;
y = 0.386; y = 0.386;
w = 0.17; w = 0.17;
h = 0.035; h = 0.035;
sizeEx = 0.05; sizeEx = 0.05;
}; };
class DAGR_MENU_Main_Text : DAGR_Menu_Text { class DAGR_MENU_Main_Text : DAGR_Menu_Text {
idc = 2668782; idc = 2668782;
style = ST_CENTER; style = ST_CENTER;
x = 0.38; x = 0.38;
y = 0.32; y = 0.32;
w = 0.25; w = 0.25;
h = 0.035; h = 0.035;
sizeEx = 0.04; sizeEx = 0.04;
}; };
class DAGR_MENU_PSELECTION1 : DAGR_Menu_Pic { class DAGR_MENU_PSELECTION1 : DAGR_Menu_Pic {
idc = 2668788; idc = 2668788;
x = 0.451; x = 0.451;
y = 0.352; y = 0.352;
w = 0.01; w = 0.01;
h = 0.003; h = 0.003;
}; };
class DAGR_MENU_PSELECTION2 : DAGR_Menu_Pic { class DAGR_MENU_PSELECTION2 : DAGR_Menu_Pic {
idc = 2668789; idc = 2668789;
x = 0.465; x = 0.465;
y = 0.352; y = 0.352;
w = 0.01; w = 0.01;
h = 0.003; h = 0.003;
}; };
class DAGR_MENU_PSELECTION3 : DAGR_Menu_Pic { class DAGR_MENU_PSELECTION3 : DAGR_Menu_Pic {
idc = 2668790; idc = 2668790;
x = 0.479; x = 0.479;
y = 0.352; y = 0.352;
w = 0.01; w = 0.01;
h = 0.003; h = 0.003;
}; };
class DAGR_MENU_PSELECTION4 : DAGR_Menu_Pic { class DAGR_MENU_PSELECTION4 : DAGR_Menu_Pic {
idc = 2668791; idc = 2668791;
x = 0.493; x = 0.493;
y = 0.352; y = 0.352;
w = 0.01; w = 0.01;
h = 0.003; h = 0.003;
}; };
class DAGR_MENU_PSELECTION5 : DAGR_Menu_Pic { class DAGR_MENU_PSELECTION5 : DAGR_Menu_Pic {
idc = 2668792; idc = 2668792;
x = 0.507; x = 0.507;
y = 0.352; y = 0.352;
w = 0.01; w = 0.01;
h = 0.003; h = 0.003;
}; };
class DAGR_MENU_PSELECTION6 : DAGR_Menu_Pic { class DAGR_MENU_PSELECTION6 : DAGR_Menu_Pic {
idc = 2668793; idc = 2668793;
x = 0.521; x = 0.521;
y = 0.352; y = 0.352;
w = 0.01; w = 0.01;
h = 0.003; h = 0.003;
}; };
class DAGR_MENU_PSELECTION7 : DAGR_Menu_Pic { class DAGR_MENU_PSELECTION7 : DAGR_Menu_Pic {
idc = 2668794; idc = 2668794;
x = 0.535; x = 0.535;
y = 0.352; y = 0.352;
w = 0.01; w = 0.01;
h = 0.003; h = 0.003;
}; };
class DAGR_MENU_PSELECTION8 : DAGR_Menu_Pic { class DAGR_MENU_PSELECTION8 : DAGR_Menu_Pic {
idc = 2668795; idc = 2668795;
x = 0.549; x = 0.549;
y = 0.352; y = 0.352;
w = 0.01; w = 0.01;
h = 0.003; h = 0.003;
}; };
}; };

View File

@ -1,95 +1,95 @@
class RscTitles { class RscTitles {
class DAGR_Text { class DAGR_Text {
type = 0; type = 0;
idc = -1; idc = -1;
style = 0x01; style = 0x01;
x = 0; x = 0;
y = 0; y = 0;
w = 0.15; w = 0.15;
h = 0.050; h = 0.050;
text = ""; text = "";
colorBackground[] = { 0, 0, 0, 0 }; colorBackground[] = { 0, 0, 0, 0 };
colorText[] = { 0.239, 0.216, 0.153, 1 }; colorText[] = { 0.239, 0.216, 0.153, 1 };
font = "RobotoCondensed"; font = "RobotoCondensed";
sizeEx = 0.04; sizeEx = 0.04;
waitForLoad = 0; waitForLoad = 0;
}; };
class DAGR_Pic { class DAGR_Pic {
type = 0; type = 0;
idc = -1; idc = -1;
style = 48; style = 48;
x = 0; x = 0;
y = 0; y = 0;
w = 0.50; w = 0.50;
h = 0.50; h = 0.50;
text = ""; text = "";
colorBackground[] = {}; colorBackground[] = {};
colorText[] = {}; colorText[] = {};
font = "RobotoCondensed"; font = "RobotoCondensed";
sizeEx = 0.02; sizeEx = 0.02;
waitForLoad = 0; waitForLoad = 0;
}; };
class DAGR_Display { class DAGR_Display {
idd = 266850; idd = 266850;
movingEnable = false; movingEnable = false;
duration = 100000; duration = 100000;
fadein = 0; fadein = 0;
fadeout = 0; fadeout = 0;
name = "Dagr_Display"; name = "Dagr_Display";
onLoad="uiNamespace setVariable ['DAGR_Display', _this select 0]"; onLoad="uiNamespace setVariable ['DAGR_Display', _this select 0]";
controls[] = {"DAGR_UI", "DAGR_Grid", "DAGR_Speed", "DAGR_Elevation", "DAGR_Heading", "DAGR_Time", "DAGR_WP", "DAGR_Bearing", "DAGR_DIST"}; controls[] = {"DAGR_UI", "DAGR_Grid", "DAGR_Speed", "DAGR_Elevation", "DAGR_Heading", "DAGR_Time", "DAGR_WP", "DAGR_Bearing", "DAGR_DIST"};
class DAGR_UI : DAGR_Pic { class DAGR_UI : DAGR_Pic {
idc = 266856; idc = 266856;
x = "(SafeZoneW + SafeZoneX) - 0.45"; x = "(SafeZoneW + SafeZoneX) - 0.45";
y = "(SafeZoneH + SafeZoneY) - 0.47"; y = "(SafeZoneH + SafeZoneY) - 0.47";
}; };
class DAGR_Grid : DAGR_Text { class DAGR_Grid : DAGR_Text {
idc = 266851; idc = 266851;
x = "(SafeZoneW + SafeZoneX) - 0.370";// 0.830 x = "(SafeZoneW + SafeZoneX) - 0.370";// 0.830
y = "(SafeZoneH + SafeZoneY)- 0.250";// 0.845 y = "(SafeZoneH + SafeZoneY)- 0.250";// 0.845
w = 0.25; w = 0.25;
h = 0.06; h = 0.06;
sizeEx = 0.07; sizeEx = 0.07;
}; };
class DAGR_Speed : DAGR_Text { class DAGR_Speed : DAGR_Text {
idc = 266852; idc = 266852;
x = "(SafeZoneW + SafeZoneX) - 0.388"; //0.812 x = "(SafeZoneW + SafeZoneX) - 0.388"; //0.812
y = "(SafeZoneH + SafeZoneY) - 0.181"; //0.914 y = "(SafeZoneH + SafeZoneY) - 0.181"; //0.914
}; };
class DAGR_Elevation : DAGR_Text { class DAGR_Elevation : DAGR_Text {
idc = 266853; idc = 266853;
x = "(SafeZoneW + SafeZoneX) - 0.270"; //0.930 x = "(SafeZoneW + SafeZoneX) - 0.270"; //0.930
y = "(SafeZoneH + SafeZoneY) - 0.181"; //0.914 y = "(SafeZoneH + SafeZoneY) - 0.181"; //0.914
}; };
class DAGR_Heading : DAGR_Text { class DAGR_Heading : DAGR_Text {
idc = 266854; idc = 266854;
x = "(SafeZoneW + SafeZoneX) - 0.413"; //0.787 x = "(SafeZoneW + SafeZoneX) - 0.413"; //0.787
y = "(SafeZoneH + SafeZoneY) - 0.1294"; //0.9656 y = "(SafeZoneH + SafeZoneY) - 0.1294"; //0.9656
}; };
class DAGR_Time : DAGR_Text { class DAGR_Time : DAGR_Text {
idc = 266855; idc = 266855;
x = "(SafeZoneW + SafeZoneX) - 0.275"; //0.925 x = "(SafeZoneW + SafeZoneX) - 0.275"; //0.925
y = "(SafeZoneH + SafeZoneY) - 0.129"; //0.965 y = "(SafeZoneH + SafeZoneY) - 0.129"; //0.965
}; };
class DAGR_WP : DAGR_Text { class DAGR_WP : DAGR_Text {
idc = 266857; idc = 266857;
x = "(SafeZoneW + SafeZoneX) - 0.235"; //0.965 x = "(SafeZoneW + SafeZoneX) - 0.235"; //0.965
y = "(SafeZoneH + SafeZoneY) - 0.181"; //0.914 y = "(SafeZoneH + SafeZoneY) - 0.181"; //0.914
}; };
class DAGR_Bearing : DAGR_Text { class DAGR_Bearing : DAGR_Text {
idc = 266858; idc = 266858;
x = "(SafeZoneW + SafeZoneX) - 0.413"; //0.787 x = "(SafeZoneW + SafeZoneX) - 0.413"; //0.787
y = "(SafeZoneH + SafeZoneY) - 0.181"; //0.914 y = "(SafeZoneH + SafeZoneY) - 0.181"; //0.914
}; };
class DAGR_DIST : DAGR_Text { class DAGR_DIST : DAGR_Text {
idc = 266859; idc = 266859;
x = "(SafeZoneW + SafeZoneX) - 0.265"; //0.935 x = "(SafeZoneW + SafeZoneX) - 0.265"; //0.935
y = "(SafeZoneH + SafeZoneY) - 0.129"; //0.965 y = "(SafeZoneH + SafeZoneY) - 0.129"; //0.965
}; };
}; };
}; };

View File

@ -27,8 +27,8 @@ class CfgSounds {
sound[] = {QUOTE(PATHTOF(sounds\deafness_noring.ogg)),3,1}; sound[] = {QUOTE(PATHTOF(sounds\deafness_noring.ogg)),3,1};
titles[] = {}; titles[] = {};
}; };
class ACE_Ring_Backblast { class ACE_Ring_Backblast {
sound[] = {QUOTE(PATHTOF(sounds\backblast_ring.ogg)),1,1}; sound[] = {QUOTE(PATHTOF(sounds\backblast_ring.ogg)),1,1};
titles[] = {}; titles[] = {};
}; };
}; };

View File

@ -33,13 +33,13 @@ class CfgAmmo {
soundFakeFall2[] = {"",3.16228,1,1000}; soundFakeFall2[] = {"",3.16228,1,1000};
soundFakeFall3[] = {"",3.16228,1,1000}; soundFakeFall3[] = {"",3.16228,1,1000};
soundFakeFall[] = {}; soundFakeFall[] = {};
hit = 0; hit = 0;
indirectHit = 0; indirectHit = 0;
indirectHitRange = 0; indirectHitRange = 0;
explosive = 1; explosive = 1;
model = "\A3\weapons_f\empty"; model = "\A3\weapons_f\empty";
airFriction = 0; airFriction = 0;
timeToLive = 1; timeToLive = 1;
explosionTime = 0.001; explosionTime = 0.001;
}; };
}; };

View File

@ -642,6 +642,6 @@ class CfgVehicles {
class Item_Base_F; class Item_Base_F;
class Item_acc_flashlight: Item_Base_F { class Item_acc_flashlight: Item_Base_F {
displayName="UTG Defender 126"; displayName="UTG Defender 126";
}; };
}; };

View File

@ -2,16 +2,16 @@ class CfgWeapons {
class ACE_ItemCore; class ACE_ItemCore;
class InventoryItem_Base_F; class InventoryItem_Base_F;
class ACE_Tripod: ACE_ItemCore { class ACE_Tripod: ACE_ItemCore {
author[] = {"Rocko", "Scubaman3D"}; author[] = {"Rocko", "Scubaman3D"};
scope = 2; scope = 2;
displayName = CSTRING(DisplayName); displayName = CSTRING(DisplayName);
descriptionShort = ""; descriptionShort = "";
model = PATHTOF(data\w_sniper_tripod.p3d); model = PATHTOF(data\w_sniper_tripod.p3d);
picture = PATHTOF(UI\w_sniper_tripod_ca.paa); picture = PATHTOF(UI\w_sniper_tripod_ca.paa);
class ItemInfo: InventoryItem_Base_F { class ItemInfo: InventoryItem_Base_F {
mass = 40; mass = 40;
}; };
}; };
}; };

View File

@ -0,0 +1,157 @@
#!/usr/bin/env python3
import fnmatch
import os
import re
import ntpath
import sys
import argparse
def check_config_style(filepath):
bad_count_file = 0
def pushClosing(t):
closingStack.append(closing.expr)
closing << Literal( closingFor[t[0]] )
def popClosing():
closing << closingStack.pop()
with open(filepath, 'r', encoding='utf-8', errors='ignore') as file:
content = file.read()
# Store all brackets we find in this file, so we can validate everything on the end
brackets_list = []
# To check if we are in a comment block
isInCommentBlock = False
checkIfInComment = False
# Used in case we are in a line comment (//)
ignoreTillEndOfLine = False
# Used in case we are in a comment block (/* */). This is true if we detect a * inside a comment block.
# If the next character is a /, it means we end our comment block.
checkIfNextIsClosingBlock = False
# We ignore everything inside a string
isInString = False
# Used to store the starting type of a string, so we can match that to the end of a string
inStringType = '';
lastIsCurlyBrace = False
checkForSemiColumn = False
# Extra information so we know what line we find errors at
lineNumber = 0
indexOfCharacter = 0
# Parse all characters in the content of this file to search for potential errors
for c in content:
if (lastIsCurlyBrace):
lastIsCurlyBrace = False
if c == '\n': # Keeping track of our line numbers
lineNumber += 1 # so we can print accurate line number information when we detect a possible error
if (isInString): # while we are in a string, we can ignore everything else, except the end of the string
if (c == inStringType):
isInString = False
# if we are not in a comment block, we will check if we are at the start of one or count the () {} and []
elif (isInCommentBlock == False):
# This means we have encountered a /, so we are now checking if this is an inline comment or a comment block
if (checkIfInComment):
checkIfInComment = False
if c == '*': # if the next character after / is a *, we are at the start of a comment block
isInCommentBlock = True
elif (c == '/'): # Otherwise, will check if we are in an line comment
ignoreTillEndOfLine = True # and an line comment is a / followed by another / (//) We won't care about anything that comes after it
if (isInCommentBlock == False):
if (ignoreTillEndOfLine): # we are in a line comment, just continue going through the characters until we find an end of line
if (c == '\n'):
ignoreTillEndOfLine = False
else: # validate brackets
if (c == '"' or c == "'"):
isInString = True
inStringType = c
elif (c == '/'):
checkIfInComment = True
elif (c == '('):
brackets_list.append('(')
elif (c == ')'):
if (len(brackets_list) > 0 and brackets_list[-1] in ['{', '[']):
print("ERROR: Possible missing round bracket ')' detected at {0} Line number: {1}".format(filepath,lineNumber))
bad_count_file += 1
brackets_list.append(')')
elif (c == '['):
brackets_list.append('[')
elif (c == ']'):
if (len(brackets_list) > 0 and brackets_list[-1] in ['{', '(']):
print("ERROR: Possible missing square bracket ']' detected at {0} Line number: {1}".format(filepath,lineNumber))
bad_count_file += 1
brackets_list.append(']')
elif (c == '{'):
brackets_list.append('{')
elif (c == '}'):
lastIsCurlyBrace = True
if (len(brackets_list) > 0 and brackets_list[-1] in ['(', '[']):
print("ERROR: Possible missing curly brace '}}' detected at {0} Line number: {1}".format(filepath,lineNumber))
bad_count_file += 1
brackets_list.append('}')
elif (c== '\t'):
print("ERROR: Tab detected at {0} Line number: {1}".format(filepath,lineNumber))
bad_count_file += 1
else: # Look for the end of our comment block
if (c == '*'):
checkIfNextIsClosingBlock = True;
elif (checkIfNextIsClosingBlock):
if (c == '/'):
isInCommentBlock = False
elif (c != '*'):
checkIfNextIsClosingBlock = False
indexOfCharacter += 1
if brackets_list.count('[') != brackets_list.count(']'):
print("ERROR: A possible missing square bracket [ or ] in file {0} [ = {1} ] = {2}".format(filepath,brackets_list.count('['),brackets_list.count(']')))
bad_count_file += 1
if brackets_list.count('(') != brackets_list.count(')'):
print("ERROR: A possible missing round bracket ( or ) in file {0} ( = {1} ) = {2}".format(filepath,brackets_list.count('('),brackets_list.count(')')))
bad_count_file += 1
if brackets_list.count('{') != brackets_list.count('}'):
print("ERROR: A possible missing curly brace {{ or }} in file {0} {{ = {1} }} = {2}".format(filepath,brackets_list.count('{'),brackets_list.count('}')))
bad_count_file += 1
return bad_count_file
def main():
print("Validating Config Style")
sqf_list = []
bad_count = 0
parser = argparse.ArgumentParser()
parser.add_argument('-m','--module', help='only search specified module addon folder', required=False, default="")
args = parser.parse_args()
# Allow running from root directory as well as from inside the tools directory
rootDir = "../addons"
if (os.path.exists("addons")):
rootDir = "addons"
for root, dirnames, filenames in os.walk(rootDir + '/' + args.module):
for filename in fnmatch.filter(filenames, '*.cpp'):
sqf_list.append(os.path.join(root, filename))
for filename in fnmatch.filter(filenames, '*.hpp'):
sqf_list.append(os.path.join(root, filename))
for filename in sqf_list:
bad_count = bad_count + check_config_style(filename)
print("------\nChecked {0} files\nErrors detected: {1}".format(len(sqf_list), bad_count))
if (bad_count == 0):
print("Config validation PASSED")
else:
print("Config validation FAILED")
return bad_count
if __name__ == "__main__":
sys.exit(main())