Skip to content

Commit

Permalink
diag_log and public for example module
Browse files Browse the repository at this point in the history
  • Loading branch information
Wyqer committed Apr 23, 2019
1 parent e455d52 commit 7ce6524
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
File: fn_example_loadData.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2019-02-02
Last Update: 2019-02-18
Last Update: 2019-04-23
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 this module from the given save data or initializes needed data for a new campaign.
Expand All @@ -17,17 +18,17 @@
Function reached the end [BOOL]
*/

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

private _moduleData = ["example"] 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] Example module data empty, creating new data...";};
if (KPLIB_param_debug) then {["Example module data empty, creating new data...", "SAVE"] call KPLIB_fnc_common_log;};
// Nothing to do here
} else {
// Otherwise start applying the saved data
if (KPLIB_param_debug) then {diag_log "[KP LIBERATION] [SAVE] Example module data found, applying data...";};
if (KPLIB_param_debug) then {["Example module data found, applying data...", "SAVE"] call KPLIB_fnc_common_log;};
};

true
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
File: fn_example_postInit.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2019-02-02
Last Update: 2019-02-18
Last Update: 2019-04-23
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 @@ -18,7 +19,7 @@
Module postInit finished [BOOL]
*/

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

// Server section (dedicated and player hosted)
if (isServer) then {
Expand All @@ -35,6 +36,6 @@ if (hasInterface) then {

};

if (isServer) then {diag_log format ["[KP LIBERATION] [%1] [POST] [EXAMPLE] Module initialized", diag_tickTime];};
if (isServer) then {["Module initialized", "POST] [EXAMPLE", 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_example_preInit.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2019-02-02
Last Update: 2019-02-18
Last Update: 2019-04-23
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] [EXAMPLE] Module initializing...", diag_tickTime];};
if (isServer) then {["Module initializing...", "PRE] [EXAMPLE", true] call KPLIB_fnc_common_log;};

/*
----- Module Globals -----
Expand Down Expand Up @@ -50,6 +51,6 @@ if (hasInterface) then {

};

if (isServer) then {diag_log format ["[KP LIBERATION] [%1] [PRE] [EXAMPLE] Module initialized", diag_tickTime];};
if (isServer) then {["Module initialized", "PRE] [EXAMPLE", 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_example_saveData.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2019-02-02
Last Update: 2019-04-22
Last Update: 2019-04-23
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Public: No
Description:
Fetches data which is bound to this module and send it to the global save data array.
Expand All @@ -17,7 +18,7 @@
Function reached the end [BOOL]
*/

if (KPLIB_param_savedebug) then {diag_log "[KP LIBERATION] [SAVE] Example module saving...";};
if (KPLIB_param_savedebug) then {["Example module saving...", "SAVE"] call KPLIB_fnc_common_log;};

// Set module data to save and send it to the global save data array
["example",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
File: fn_example_settings.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2019-02-02
Last Update: 2019-02-18
Last Update: 2019-04-23
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Public: No
Description:
CBA Settings initialization for this module
Expand Down

0 comments on commit 7ce6524

Please sign in to comment.