Skip to content

Commit

Permalink
Merge pull request #593 from KillahPotatoes/v0.97S12-508
Browse files Browse the repository at this point in the history
Documentation pt1
  • Loading branch information
Wyqer authored May 4, 2019
2 parents 7f8bad9 + 7ce6524 commit b7ce1df
Show file tree
Hide file tree
Showing 257 changed files with 898 additions and 650 deletions.
1 change: 1 addition & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
"KPLIB_param_reviveRequiredItems",
"KPLIB_param_reviveRequiredTrait",
"KPLIB_param_reviveUnconsciousStateMode",
"KPLIB_param_savedebug",
"KPLIB_param_saveInterval",
"KPLIB_param_sectorActRange",
"KPLIB_param_sectorCap",
Expand Down
4 changes: 2 additions & 2 deletions Missionframework/KPGUI/KPGUI_classes.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
File: KPGUI_classes.hpp
Author: Wyqer - https://github.com/KillahPotatoes
Date: 2018-09-13
Last Update: 2019-04-15
Last Update: 2019-04-22
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
Expand Down Expand Up @@ -1125,7 +1125,7 @@ class KPGUI_PRE_DialogTitleS: KPGUI_PRE_Title {

// Cross symbol
class KPGUI_PRE_DialogCrossS: KPGUI_PRE_CloseCross {
x = safeZoneX + safeZoneW * (KP_X_VAL_S + KP_WIDTH_VAL_S - 0.02)
x = safeZoneX + safeZoneW * (KP_X_VAL_S + KP_WIDTH_VAL_S - 0.02);
y = KP_GETY_CROSS(KP_Y_VAL_S);
};

Expand Down
4 changes: 2 additions & 2 deletions Missionframework/KPLIB_functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
File: KPLIB_functions.hpp
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2017-10-16
Last Update: 2019-04-05
Last Update: 2019-04-22
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
Expand All @@ -18,7 +18,7 @@ class KPLIB {
#include "modules\02_core\functions.hpp"
#include "modules\03_persistence\functions.hpp"
#include "modules\04_respawn\functions.hpp"
#include "modules\05_adm\functions.hpp"
#include "modules\05_admin\functions.hpp"
#include "modules\10_resources\functions.hpp"
#include "modules\11_permission\functions.hpp"
#include "modules\12_arsenal\functions.hpp"
Expand Down
4 changes: 2 additions & 2 deletions Missionframework/KPLIB_ui.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
File: KPLIB_ui.hpp
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2017-10-16
Last Update: 2019-04-05
Last Update: 2019-04-22
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
Expand All @@ -16,7 +16,7 @@
#include "modules\00_init\ui.hpp"
#include "modules\02_core\ui.hpp"
#include "modules\04_respawn\ui.hpp"
#include "modules\05_adm\ui.hpp"
#include "modules\05_admin\ui.hpp"
#include "modules\11_permission\ui.hpp"
#include "modules\12_arsenal\ui.hpp"
#include "modules\13_plm\ui.hpp"
Expand Down
5 changes: 3 additions & 2 deletions Missionframework/modules/00_init/fnc/fn_init_checkClass.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
File: fn_init_checkClass.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2017-10-16
Last Update: 2018-12-08
Last Update: 2019-04-22
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Public: No
Description:
Returns if given classname is available in CfgVehicles.
Expand All @@ -24,6 +25,6 @@ params [
if (isClass (configFile >> "CfgVehicles" >> _toCheck)) then {
true
} else {
diag_log format ["[KP LIBERATION] [PRESET] %1 not available in current modset", _toCheck];
[format ["%1 not available in current modset", _toCheck], "PRESET"] call KPLIB_fnc_common_log;
false
};
35 changes: 18 additions & 17 deletions Missionframework/modules/00_init/fnc/fn_init_configGuard.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
File: fn_init_configGuard.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-06-19
Last Update: 2019-04-17
Last Update: 2019-04-22
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Public: No
Expand Down Expand Up @@ -43,38 +43,39 @@ KPLIB_validationNamespace setVariable ["KPLIB_preset_checkedSingles", true];
((count ([] call CBA_fnc_players)) > 0)
};

diag_log text format ["[KP LIBERATION] [%1] [CFG GUARD] Validating configuration files...", diag_tickTime];
["Validating configuration files...", "CFG GUARD", true] call KPLIB_fnc_common_log;

// Get array of variables to check
private _toValidate = allVariables KPLIB_validationNamespace;
// If there is any "false" variable this means one of the guarded config files is invalid
private _invalidConfig = (_toValidate findIf {!(KPLIB_validationNamespace getVariable _x)}) != -1;

// End mission on invalid config
if(_invalidConfig) exitWith {
diag_log format ["[KP LIBERATION] [%1] [CFG GUARD] Invalid configuration files present. Ending mission for everyone", diag_tickTime];

["Invalid configuration files present. Ending mission for everyone", "CFG GUARD", true] call KPLIB_fnc_common_log;
"KPLIB_configError" call BIS_fnc_endMissionServer;
};

diag_log text format ["[KP LIBERATION] [%1] [CFG GUARD] Configuration files are valid", diag_tickTime];
["Configuration files are valid", "CFG GUARD", true] call KPLIB_fnc_common_log;

diag_log text "[KP LIBERATION] [MISSIONSTART] --- MISSION INFORMATION ---";
diag_log text format ["[KP LIBERATION] [MISSIONSTART] Name: %1", (localize "STR_KPLIB_TITLE")];
diag_log text format ["[KP LIBERATION] [MISSIONSTART] World: %1", worldName];
diag_log text format ["[KP LIBERATION] [MISSIONSTART] Version: %1", (localize "STR_KPLIB_VERSION")];
diag_log text format ["[KP LIBERATION] [MISSIONSTART] Author: %1", [missionConfigFile] call BIS_fnc_overviewAuthor];
diag_log text format ["[KP LIBERATION] [MISSIONSTART] Blufor: %1", KPLIB_preset_nameF];
diag_log text format ["[KP LIBERATION] [MISSIONSTART] Opfor: %1", KPLIB_preset_nameE];
diag_log text format ["[KP LIBERATION] [MISSIONSTART] Resistance: %1", KPLIB_preset_nameR];
diag_log text format ["[KP LIBERATION] [MISSIONSTART] Civilians: %1", KPLIB_preset_nameC];
diag_log text format ["[KP LIBERATION] [MISSIONSTART] Arsenal: %1",
// Display mission information
["--- MISSION INFORMATION ---", "MISSIONSTART"] call KPLIB_fnc_common_log;
[format ["Name: %1", (localize "STR_KPLIB_TITLE")], "MISSIONSTART"] call KPLIB_fnc_common_log;
[format ["World: %1", worldName], "MISSIONSTART"] call KPLIB_fnc_common_log;
[format ["Version: %1", (localize "STR_KPLIB_VERSION")], "MISSIONSTART"] call KPLIB_fnc_common_log;
[format ["Author: %1", [missionConfigFile] call BIS_fnc_overviewAuthor], "MISSIONSTART"] call KPLIB_fnc_common_log;
[format ["Blufor: %1", KPLIB_preset_nameF], "MISSIONSTART"] call KPLIB_fnc_common_log;
[format ["Opfor: %1", KPLIB_preset_nameE], "MISSIONSTART"] call KPLIB_fnc_common_log;
[format ["Resistance: %1", KPLIB_preset_nameR], "MISSIONSTART"] call KPLIB_fnc_common_log;
[format ["Civilians: %1", KPLIB_preset_nameC], "MISSIONSTART"] call KPLIB_fnc_common_log;
[format ["Arsenal: %1",
[
localize "STR_KPLIB_SETTINGS_ARSENAL_ARSENAL_0",
localize "STR_KPLIB_SETTINGS_ARSENAL_ARSENAL_1",
localize "STR_KPLIB_SETTINGS_ARSENAL_ARSENAL_2"
] select KPLIB_param_presetArsenal
];
diag_log text format ["[KP LIBERATION] [MISSIONSTART] ACE: %1", KPLIB_ace_enabled];
], "MISSIONSTART"] call KPLIB_fnc_common_log;
[format ["ACE: %1", KPLIB_ace_enabled], "MISSIONSTART"] call KPLIB_fnc_common_log;
};

true
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
File: fn_init_createLockedVehMarkers.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-05-08
Last Update: 2018-12-08
Last Update: 2019-04-22
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Public: No
Description:
Creates the locked vehicle markers accordingly to the vehicle <> base links.
Expand Down
3 changes: 2 additions & 1 deletion Missionframework/modules/00_init/fnc/fn_init_filterMods.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
File: fn_init_filterMods.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2017-10-16
Last Update: 2018-11-09
Last Update: 2019-04-22
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Public: No
Description:
Filters not available classnames out of a given array of vehicle classnames or buildlist array and returns the resulting array.
Expand Down
9 changes: 5 additions & 4 deletions Missionframework/modules/00_init/fnc/fn_init_load.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
File: fn_init_load.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-03-29
Last Update: 2018-11-27
Last Update: 2019-04-22
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Public: No
Description:
Loads save data from the profile namespace and fires the doLoad event.
Expand All @@ -17,19 +18,19 @@
Function reached the end [BOOL]
*/

if (KPLIB_param_debug) then {diag_log format ["[KP LIBERATION] [%1] [SAVE] ----- Load function started -----", diag_tickTime];};
if (KPLIB_param_debug) then {["----- Load function started -----", "SAVE", true] call KPLIB_fnc_common_log;};

// Load whole save data
KPLIB_save_data = profileNamespace getVariable [KPLIB_save_key, nil];

// Fire load event
if (KPLIB_param_debug) then {diag_log "[KP LIBERATION] [SAVE] Firing load event...";};
if (KPLIB_param_debug) then {["Firing load event...", "SAVE"] call KPLIB_fnc_common_log;};
["KPLIB_doLoad"] call CBA_fnc_localEvent;

// Publish save loaded state
KPLIB_save_loaded = true;
publicVariable "KPLIB_save_loaded";

if (KPLIB_param_debug) then {diag_log format ["[KP LIBERATION] [%1] [SAVE] ----- Load function finished -----", diag_tickTime];};
if (KPLIB_param_debug) then {["----- Load function finished -----", "SAVE", true] call KPLIB_fnc_common_log;};

true
11 changes: 6 additions & 5 deletions Missionframework/modules/00_init/fnc/fn_init_loadData.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
File: fn_init_loadData.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2017-10-16
Last Update: 2018-12-09
Last Update: 2019-04-22
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Public: No
Description:
Loads data which is bound to the init module from the given save data or initializes needed data for a new campaign.
Expand All @@ -17,13 +18,13 @@
Function reached the end [BOOL]
*/

if (KPLIB_param_debug) then {diag_log "[KP LIBERATION] [SAVE] Init module loading...";};
if (KPLIB_param_debug) then {["Init module loading...", "SAVE"] call KPLIB_fnc_common_log;};

private _moduleData = ["init"] call KPLIB_fnc_init_getSaveData;

// Check if there is a new campaign
if (_moduleData isEqualTo []) then {
if (KPLIB_param_debug) then {diag_log "[KP LIBERATION] [SAVE] Init module data empty, creating new data...";};
if (KPLIB_param_debug) then {["Init module data empty, creating new data...", "SAVE"] call KPLIB_fnc_common_log;};

// Set random start date
setDate [2018, ceil (random 12), ceil (random 28), 8, 0];
Expand All @@ -43,7 +44,7 @@ if (_moduleData isEqualTo []) then {
publicVariable "KPLIB_sectors_lockedVeh";
} else {
// Otherwise start applying the saved data
if (KPLIB_param_debug) then {diag_log "[KP LIBERATION] [SAVE] Init module data found, applying data...";};
if (KPLIB_param_debug) then {["Init module data found, applying data...", "SAVE"] call KPLIB_fnc_common_log;};

// Set saved date and time
setDate [
Expand All @@ -62,7 +63,7 @@ if (_moduleData isEqualTo []) then {
// Check for additions in the locked vehicles array
private _lockedVehCount = count KPLIB_sectors_lockedVeh;
if ((_lockedVehCount < (count KPLIB_sectors_military)) && (_lockedVehCount < (count KPLIB_preset_lockedVehPlF))) then {
diag_log "[KP LIBERATION] [IMPORTANT] Additional military sectors or unlock vehicles detected and assigned.";
["Additional military sectors or unlockable vehicles detected and assigned", "IMPORTANT"] call KPLIB_fnc_common_log;
private _assignedVehicles = [];
private _assignedBases = [];
private _nextVehicle = "";
Expand Down
3 changes: 2 additions & 1 deletion Missionframework/modules/00_init/fnc/fn_init_loadPresets.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
File: fn_init_loadPresets.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2017-10-16
Last Update: 2019-04-15
Last Update: 2019-04-22
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Public: No
Description:
Loads the configured preset files, checks if classnames are available with current modset and initialize global arrays which are dependent on the presets.
Expand Down
3 changes: 2 additions & 1 deletion Missionframework/modules/00_init/fnc/fn_init_placeTowers.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
File: fn_init_placeTowers.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-12-11
Last Update: 2018-12-11
Last Update: 2019-04-22
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Public: No
Description:
Places Antennas at Radio Tower markers.
Expand Down
9 changes: 5 additions & 4 deletions Missionframework/modules/00_init/fnc/fn_init_postInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
File: fn_init_postInit.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2017-08-31
Last Update: 2018-12-15
Last Update: 2019-04-22
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Public: No
Description:
The postInit function of a module takes care of starting/executing the modules functions or scripts.
Expand All @@ -22,7 +23,7 @@ if (!isServer) then {
// Called in the scheduled postInit environment allows the small wait in the function
[] call KPLIB_fnc_init_receiveInit;
} else {
diag_log format ["[KP LIBERATION] [%1] [POST] [INIT] Module initializing...", diag_tickTime];
["Module initializing...", "POST] [INIT", true] call KPLIB_fnc_common_log;

// Sort the sector markers to category arrays
[] call KPLIB_fnc_init_sortSectors;
Expand All @@ -39,7 +40,7 @@ if (!isServer) then {
[] call KPLIB_fnc_init_save;
} else {
_handle call CBA_fnc_removePerFrameHandler;
diag_log "[KP LIBERATION] [IMPORTANT] Save timer deactivated due to KPLIB_campaignRunning false.";
["Save timer deactivated due to KPLIB_campaignRunning false", "IMPORTANT"] call KPLIB_fnc_common_log;
};
};
}, KPLIB_param_saveInterval] call CBA_fnc_addPerFrameHandler;
Expand All @@ -50,7 +51,7 @@ if (!isServer) then {
// Place down Antennas at Radio Tower sectors
[] call KPLIB_fnc_init_placeTowers;

diag_log format ["[KP LIBERATION] [%1] [POST] [INIT] Module initialized", diag_tickTime];
["Module initialized", "POST] [INIT", true] call KPLIB_fnc_common_log;
};

// Player section
Expand Down
7 changes: 4 additions & 3 deletions Missionframework/modules/00_init/fnc/fn_init_preInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
File: fn_init_preInit.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2017-08-31
Last Update: 2018-12-16
Last Update: 2019-04-22
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Public: No
Description:
The preInit function defines global variables, adds event handlers and set some vital settings which are used in this module.
Expand All @@ -17,7 +18,7 @@
Module preInit finished [BOOL]
*/

if (isServer) then {diag_log format ["[KP LIBERATION] [%1] [PRE] [INIT] Module initializing...", diag_tickTime];};
if (isServer) then {["Module initializing...", "PRE] [INIT", true] call KPLIB_fnc_common_log;};

/*
----- Module Globals -----
Expand Down Expand Up @@ -123,6 +124,6 @@ if (isServer) then {
[] call KPLIB_fnc_init_loadPresets;
};

if (isServer) then {diag_log format ["[KP LIBERATION] [%1] [PRE] [INIT] Module initialized", diag_tickTime];};
if (isServer) then {["Module initialized", "PRE] [INIT", true] call KPLIB_fnc_common_log;};

true
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
File: fn_init_processPresetVar.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-12-08
Last Update: 2019-04-15
Last Update: 2019-04-22
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Public: No
Description:
Processes a given preset variable by filtering for missing mods and adding the variable to the specific package.
Expand Down
7 changes: 4 additions & 3 deletions Missionframework/modules/00_init/fnc/fn_init_receiveInit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
File: fn_init_receiveInit.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2017-10-25
Last Update: 2018-12-15
Last Update: 2019-04-22
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Public: No
Description:
Receive data from the server initialization and split the packages accordingly.
Expand All @@ -17,7 +18,7 @@
Function reached the end [BOOL]
*/

diag_log format ["[KP LIBERATION] [%1] [CLIENT INIT] Preset data initializing...", diag_tickTime];
["Preset data initializing...", "CLIENT] [INIT", true] call KPLIB_fnc_common_log;

// Wait until the server has send the preset data
waitUntil {!isNil "KPLIB_preset_allData"};
Expand All @@ -28,6 +29,6 @@ waitUntil {!isNil "KPLIB_preset_allData"};
} forEach _x;
} forEach KPLIB_preset_allData;

diag_log format ["[KP LIBERATION] [%1] [CLIENT INIT] Preset data initialized", diag_tickTime];
["Preset data initialized", "CLIENT] [INIT", true] call KPLIB_fnc_common_log;

true
Loading

0 comments on commit b7ce1df

Please sign in to comment.