diff --git a/CHANGELOG.md b/CHANGELOG.md index 6849c67..bcb27f6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,14 @@ #ExAd # Changelog: +## 160720 01:15 . v0.7.9 +### Fixed +* Some design flaws in the Apps functions. (XM8) +* Added ExAd_Journal class to config.cpp (XM8) + +### Added +* New App, which is a tutorial app on YouTube (XM8) + ## 160703 20:15 . v0.7.7 ###Fixed * Made the ExAd system compatible with Exile 0.9.8 (All) diff --git a/docs/XM8/changelog.md b/docs/XM8/changelog.md index de9a58b..28dca88 100644 --- a/docs/XM8/changelog.md +++ b/docs/XM8/changelog.md @@ -1,6 +1,14 @@ #VirtualGarage ## Changelog: +## 160720 01:15 . v0.7.9 +### Fixed +* Some design flaws in the Apps functions. +* Added ExAd_Journal class to config.cpp + +### Added +* New App, which is a tutorial app on YouTube + ### v0.7.7 #### Added * Introduced **XM8** to the ExAd package diff --git a/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/Info/onOpen.sqf b/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/Info/onOpen.sqf index b7ff8c1..6507030 100644 --- a/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/Info/onOpen.sqf +++ b/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/Info/onOpen.sqf @@ -11,7 +11,7 @@ try _display = uiNameSpace getVariable ["RscExileXM8", displayNull]; if(isNull _display)exitWith{ - throw "No server info provided!"; + throw "XM8 not loaded!"; }; _strTxt = [_display,"ExAd_Info","strTxt"] call ExAd_fnc_getAppCtrl; @@ -20,7 +20,6 @@ try _pos = ctrlPosition _strTxt; _strTxt ctrlSetPosition [_pos select 0, _pos select 1, _pos select 2, ctrlTextHeight _strTxt]; _strTxt ctrlcommit 0; - ([_display,"ExAd_Info","ctrlGrp"] call ExAd_fnc_getAppCtrl) ctrlEnable true; } catch { diff --git a/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/Journal/ExAd_Scroll.paa b/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/Journal/ExAd_Scroll.paa new file mode 100644 index 0000000..b92d9d8 Binary files /dev/null and b/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/Journal/ExAd_Scroll.paa differ diff --git a/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/Journal/Icon_Journal.paa b/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/Journal/Icon_Journal.paa new file mode 100644 index 0000000..8a928b4 Binary files /dev/null and b/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/Journal/Icon_Journal.paa differ diff --git a/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/Journal/config.sqf b/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/Journal/config.sqf new file mode 100644 index 0000000..7d10f6f --- /dev/null +++ b/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/Journal/config.sqf @@ -0,0 +1,41 @@ +ExAd_journal_fnc_addNote = { + params["_listCtrl","_editCtrl", "_text"]; + + _text = ctrlText _editCtrl; + + if(count _text == 0)exitWith{ + ["ErrorTitleAndText", ["ExAd - Journal", "Nothing to save, write something first!!"]] call ExileClient_gui_toaster_addTemplateToast; + }; + + _index = lbAdd [_listCtrl, _text]; + lbSetTooltip [_listCtrl, _index, _text]; + + ctrlSetText [_editCtrl, ""]; + + [_listCtrl] call ExAd_journal_fnc_updateDB; +}; + +ExAd_journal_fnc_removeNote = { + params["_listCtrl"]; + + _index = lbCurSel _listCtrl; + + if(_index == -1)exitWith{ + ["ErrorTitleAndText", ["ExAd - Journal", "Select a note to remove!!"]] call ExileClient_gui_toaster_addTemplateToast; + }; + + lbDelete [_listCtrl, _index]; + + [_listCtrl] call ExAd_journal_fnc_updateDB; +}; + +ExAd_journal_fnc_updateDB = { + params["_listCtrl"]; + + _notes = []; + for "_i" from 0 to (lbSize _listCtrl) -1 do { + _notes pushBack (lbText [_listCtrl, _i]) + }; + + profileNamespace setVariable ["ExAd_Journal_Notes",_notes]; +}; \ No newline at end of file diff --git a/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/Journal/onClose.sqf b/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/Journal/onClose.sqf new file mode 100644 index 0000000..e69de29 diff --git a/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/Journal/onLoad.sqf b/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/Journal/onLoad.sqf new file mode 100644 index 0000000..fcf26d2 --- /dev/null +++ b/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/Journal/onLoad.sqf @@ -0,0 +1,46 @@ +/* + onLoad.sqf + + Copyright 2016 Jan Babor + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ +params["_display","_slide","_idc"]; + +_pW = 0.025; +_pH = 0.04; +_leftCol = 0; +_leftColW = 12.8; +_rightCol = _leftCol + _leftColW + 2; +_rightColW = _leftColW + 3; +_margin = 0.2; + +_slideClass = "ExAd_Journal"; + +[_display,_slide,([_slideClass,"picBg"] call ExAd_fnc_getNextIDC),[1 * _pW, -1 * _pH, (_leftColW + _rightCol + 5) * _pW, 21 * _pH],"ExAdClient\XM8\Apps\Journal\ExAd_Scroll.paa",[1,1,1,1],false,false,""] call ExAd_fnc_createPicture; + +[_display,_slide,([_slideClass,"btnBack"] call ExAd_fnc_getNextIDC),[27 * _pW, 17 * _pH, 6 * _pW, 1 * _pH],'["extraApps", 1] call ExileClient_gui_xm8_slide;',STR_ExAd_VG_APP_BTN_BACK] call ExAd_fnc_createButton; + +_newParent = [_display,_slide,([_slideClass,"ctrlGrp"] call ExAd_fnc_getNextIDC),[6.5 * _pW, 3 * _pH, 21 * _pW, 13 * _pH]] call ExAd_fnc_createCtrlGrp; +_listCtrl = [_display,_newParent,([_slideClass,"listNotes"] call ExAd_fnc_getNextIDC),[0 * _pW, 0 * _pH, 21 * _pW, 13 * _pH],""] call ExAd_fnc_createList; + +_editCtrl = [_display,_slide,([_slideClass,"editNote"] call ExAd_fnc_getNextIDC),[6.5 * _pW, 16.05 * _pH, 21 * _pW, 1 * _pH],""] call ExAd_fnc_createEdit; + + +[_display,_slide,([_slideClass,"btnSave"] call ExAd_fnc_getNextIDC),[11.5 * _pW, 17 * _pH, 4 * _pW, 1 * _pH],format["[%1, %2] call ExAd_journal_fnc_addNote", ctrlIDC _listCtrl, ctrlIDC _editCtrl],"Save"] call ExAd_fnc_createButton; + + +[_display,_slide,([_slideClass,"btnRemove"] call ExAd_fnc_getNextIDC),[18.5 * _pW, 17 * _pH, 4 * _pW, 1 * _pH],format["[%1] call ExAd_journal_fnc_removeNote", ctrlIDC _listCtrl],"Remove"] call ExAd_fnc_createButton; + + +true \ No newline at end of file diff --git a/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/Journal/onOpen.sqf b/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/Journal/onOpen.sqf new file mode 100644 index 0000000..e48ec82 --- /dev/null +++ b/mpmissions/Exile.Altis/ExAdClient/XM8/Apps/Journal/onOpen.sqf @@ -0,0 +1,14 @@ +private["_display"]; + +_display = uiNameSpace getVariable ["RscExileXM8", displayNull]; + +_notes = profileNamespace getVariable ["ExAd_Journal_Notes",[]]; + +_listCtrl = [_display,"ExAd_Journal","listNotes"] call ExAd_fnc_getAppCtrl; +lbClear _listCtrl; + +{ + _index = _listCtrl lbAdd _x; + _listCtrl lbSetTooltip [_index, _x]; + +}forEach _notes; \ No newline at end of file diff --git a/mpmissions/Exile.Altis/ExAdClient/XM8/Functions/fn_createEdit.sqf b/mpmissions/Exile.Altis/ExAdClient/XM8/Functions/fn_createEdit.sqf index b1335b5..a595774 100644 --- a/mpmissions/Exile.Altis/ExAdClient/XM8/Functions/fn_createEdit.sqf +++ b/mpmissions/Exile.Altis/ExAdClient/XM8/Functions/fn_createEdit.sqf @@ -1,6 +1,6 @@ params ["_display","_parent","_idc","_position","_text"]; -_ctrl = _display ctrlCreate ["RscEdit", _idc, _parent]; +_ctrl = _display ctrlCreate ["RscExileXM8Edit", _idc, _parent]; _ctrl ctrlSetPosition _position; _ctrl ctrlSetText _text; _ctrl ctrlCommit 0; diff --git a/mpmissions/Exile.Altis/ExAdClient/XM8/Functions/fn_createList.sqf b/mpmissions/Exile.Altis/ExAdClient/XM8/Functions/fn_createList.sqf index 46de465..1989867 100644 --- a/mpmissions/Exile.Altis/ExAdClient/XM8/Functions/fn_createList.sqf +++ b/mpmissions/Exile.Altis/ExAdClient/XM8/Functions/fn_createList.sqf @@ -1,6 +1,6 @@ params ["_display","_parent","_idc","_position","_actionOnSelChanged","_tooltip","_ctrl"]; -_ctrl = _display ctrlCreate ["RscListBox",_idc,_parent]; +_ctrl = _display ctrlCreate ["RscExileXM8ListBox",_idc,_parent]; _ctrl ctrlSetPosition _position; _ctrl ctrlSetEventHandler ["LBSelChanged",_actionOnSelChanged]; _ctrl ctrlSetTooltip _tooltip; diff --git a/mpmissions/Exile.Altis/config.cpp b/mpmissions/Exile.Altis/config.cpp index eb48df0..c65e69e 100644 --- a/mpmissions/Exile.Altis/config.cpp +++ b/mpmissions/Exile.Altis/config.cpp @@ -1,6 +1,6 @@ class CfgXM8 { - extraApps[] = {"ExAd_VG","ExAd_Info","ExAd_CHVD"}; + extraApps[] = {"ExAd_VG","ExAd_Info","ExAd_CHVD","ExAd_Journal"}; class ExAd_VG { @@ -30,6 +30,16 @@ class CfgXM8 onOpen = "ExAdClient\XM8\Apps\CHVD\onOpen.sqf"; onClose = "ExAdClient\XM8\Apps\CHVD\onClose.sqf"; }; + class ExAd_Journal + { + title = "Journal"; + controlID = 50300; //IDC:50300 -> 50305 || These need to be unique and out of range from each other + config = "ExadClient\XM8\Apps\Journal\config.sqf"; + logo = "ExadClient\XM8\Apps\Journal\Icon_Journal.paa"; + onLoad = "ExAdClient\XM8\Apps\Journal\onLoad.sqf"; + onOpen = "ExAdClient\XM8\Apps\Journal\onOpen.sqf"; + onClose = "ExAdClient\XM8\Apps\Journal\onClose.sqf"; + }; }; class CfgExileCustomCode