Merge pull request #61 from Bjanski/Dev

fixed issue with infistar
This commit is contained in:
Jan Babor 2016-08-05 21:59:31 +02:00 committed by GitHub
commit 8d5007f2b2
3 changed files with 52 additions and 26 deletions

View File

@ -51,7 +51,7 @@ if (ExileClientXM8CurrentSlide isEqualTo "party") then
//Add configured controls and add them to "More"
call ExAd_fnc_createExtraApps;
call ExAd_fnc_addApps;
{
_slideControlID = getNumber (_x >> "controlID");
_slideName = configName _x;

View File

@ -18,7 +18,7 @@ if !(ExileClientXM8CurrentSlide isEqualTo _toSlideName) then
{
_display = uiNameSpace getVariable ["RscExileXM8", displayNull];
//Manipulate the source of config data
//ExAd Manipulate the source of config data
_src = if(isClass(configFile >> "CfgXM8" >> _toSlideName))then{configFile}else{missionConfigFile};
_toSlideControlID = getNumber (_src >> "CfgXM8" >> _toSlideName >> "controlID");
_toSlideControl = _display displayCtrl _toSlideControlID;
@ -33,7 +33,11 @@ if !(ExileClientXM8CurrentSlide isEqualTo _toSlideName) then
call _toSlideOpenFunction;
};
//Manipulating the source of config data
//ExAd Load Apps
if(toLower _toSlideName == 'extraapps')then{
call ExAd_fnc_addApps;
};
//ExAd Manipulating the source of config data
_src2 = if(isClass(configFile >> "CfgXM8" >> ExileClientXM8CurrentSlide))then{configFile}else{missionConfigFile};
_fromSlideControlID = getNumber(_src2 >> "CfgXM8" >> ExileClientXM8CurrentSlide >> "controlID");

View File

@ -15,50 +15,72 @@
See the License for the specific language governing permissions and
limitations under the License.
*/
private["_apps","_count","_title","_display"];
private["_apps","_idc","_title","_display"];
_apps = getArray(missionConfigFile >> "CfgXM8" >> "extraApps");
if(count _apps == 0)exitWith{false};
_count = 10;
_count2 = 5000;
_title = "ExAd";
_display = uiNameSpace getVariable ["RscExileXM8", displayNull];
while {_title != ""} do
{
_count = _count + 1;
_count2 = _count2 + 1;
_count = if(_count > 15)then{
if(_count > 25)then{
if(_count < 31)then{31}else{_count}
if(isNil "ExAd_XM8_FIRST_IDC") then {
private ["_continue","_idc"];
_continue = true;
_idc = 5001;
while{ _continue } do {
_ctrl = _display displayCtrl _idc;
if(ctrlText _ctrl == "")then{
_continue = false;
ExAd_XM8_FIRST_IDC = _idc;
}else{
if(_count < 21)then{21}else{_count}
_idc = _idc + 1;
}
}else{
_count
};
_title = getText(configFile >> "RscExileXM8" >> "Controls" >> "Slides" >> "Controls" >>"SlideExtraApps" >> "Controls" >> format["App%1", _count] >> "text");
};
_display = uiNameSpace getVariable ["RscExileXM8", displayNull];
_pW = 0.025; _pH = 0.04;
_slide = ctrlParentControlsGroup (_display displayCtrl _count2);
_idc = ExAd_XM8_FIRST_IDC;
_pW = 0.025; _pH = 0.04;
_slide = ctrlParentControlsGroup (_display displayCtrl _idc);
_lastPos = [];
{
private["_ctrl","_pos","_logo","_function"];
_ctrl = _display displayCtrl _count2;
_pos = ctrlPosition _ctrl;
_ctrl = _display displayCtrl _idc;
diag_log format["Test - idc = %1, isNull = %2", _idc , isNull _ctrl];
if(isNull _ctrl)then{
_ctrl = _display ctrlCreate ["RscExileXM8AppButton1x1",_idc,_slide];
_xPos = if( (_lastPos select 0) == (30 - 3) * (0.025) ) then { (4 - 3) * (0.025) } else { (_lastPos select 0) + ( 6.5 * 0.025 ) };
_yPos = if( (_lastPos select 0) == (30 - 3) * (0.025) ) then {
//Move Go Back button
/*
_goBackIdc = -1;
_goBackCtrl = _display displayCtrl _goBackIdc;
_goBackPos = ctrlPosition _goBackCtrl;
_goBackPos set [2, (_goBackPos select 1) + ( 5.5 * 0.04)];
_goBackCtrl ctrlSetPosition _pos;
_goBackCtrl ctrlCommit 0;
*/
(_lastPos select 1) + ( 5.5 * 0.04 )
} else { (_lastPos select 1) };
_pos = [ _xPos , _yPos, _lastPos select 2, _lastPos select 3];
_ctrl ctrlSetPosition _pos;
_ctrl ctrlCommit 0;
} else {
_pos = ctrlPosition _ctrl;
};
_logo = if(isText(missionConfigFile >> "CfgXM8" >> _x >> "logo"))then{getText(missionConfigFile >> "CfgXM8" >> _x >> "logo")}else{"ExAdClient\Core\Img\logo.paa"};
[_display,_slide,([_x,format["AppIcon%1",_count2]] call ExAd_fnc_getNextIDC),[(_pos select 0) + 1.5 * _pW, (_pos select 1) + 0.625 * _pH, 3 * _pW, 3 * _pH],_logo,[1,1,1,1],false,true,""] call ExAd_fnc_createPicture;
[_display,_slide,([_x,format["AppIcon%1",_idc]] call ExAd_fnc_getNextIDC),[(_pos select 0) + 1.5 * _pW, (_pos select 1) + 0.625 * _pH, 3 * _pW, 3 * _pH],_logo,[1,1,1,1],false,true,""] call ExAd_fnc_createPicture;
_ctrl ctrlSetText getText(missionConfigFile >> "CfgXM8" >> _x >> "title");
_function = if(isText(missionConfigFile >> "CfgXM8" >> _x >> "quickFunction"))then{
getText(missionConfigFile >> "CfgXM8" >> _x >> "quickFunction")
} else {format["['%1', 0] call ExileClient_gui_xm8_slide",_x]};
_ctrl ctrlSetEventHandler ["ButtonClick", _function];
_count2 = _count2 + 1;
_lastPos = _pos;
_idc = _idc + 1;
}forEach _apps;
true