Skip to content

Commit

Permalink
Merge pull request #590 from KillahPotatoes/v0.97S12-585-Wyqer
Browse files Browse the repository at this point in the history
Sprint 11 Bugs/Tweaks (Wyqers part)
  • Loading branch information
Wyqer authored Apr 17, 2019
2 parents 1a2844c + 405c10b commit 7f8bad9
Show file tree
Hide file tree
Showing 21 changed files with 198 additions and 108 deletions.
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,10 @@
"KPLIB_preset_logisticPlF",
"KPLIB_preset_mortarE",
"KPLIB_preset_mortarF",
"KPLIB_preset_nameC",
"KPLIB_preset_nameE",
"KPLIB_preset_nameF",
"KPLIB_preset_nameR",
"KPLIB_preset_planeTransE",
"KPLIB_preset_planeTransF",
"KPLIB_preset_planeTransPlC",
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-05
Last Update: 2019-04-15
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
Expand Down Expand Up @@ -118,7 +118,7 @@ class KPGUI_PRE_VersionIcon: KPGUI_PRE_CloseCross {
text = "\A3\Ui_f\data\Map\Markers\Military\unknown_CA.paa";
tooltip = "";
action = "";
}
};

// General background for the dialog area
class KPGUI_PRE_Background {
Expand Down
40 changes: 25 additions & 15 deletions Missionframework/modules/00_init/fnc/fn_init_configGuard.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,9 @@
File: fn_init_configGuard.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-06-19
Last Update: 2018-12-08
Last Update: 2019-04-17
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Public: No
Description:
Initializes validationNamespace for config verification.
Expand Down Expand Up @@ -37,8 +38,12 @@ KPLIB_validationNamespace setVariable ["KPLIB_preset_checkedSingles", true];

// Delay all checks until all initializations are done
[] spawn {
waitUntil{time > 0 && count call CBA_fnc_players > 0};
diag_log format ["[KP LIBERATION] [%1] [CFG GUARD] Validating configuration files...", diag_tickTime];
waitUntil {
(time > 0) &&
((count ([] call CBA_fnc_players)) > 0)
};

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

// Get array of variables to check
private _toValidate = allVariables KPLIB_validationNamespace;
Expand All @@ -51,20 +56,25 @@ KPLIB_validationNamespace setVariable ["KPLIB_preset_checkedSingles", true];
"KPLIB_configError" call BIS_fnc_endMissionServer;
};

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

diag_log format [
"[KP LIBERATION] [MISSIONSTART] Missionfile: %1 - World Name: %2 - Version: %3 - Blufor: %4 - Opfor: %5 - Resistance: %6 - Civilians: %7 - Arsenal: %8 - ACE: %9",
(localize "STR_KPLIB_TITLE"),
worldName,
(localize "STR_KPLIB_VERSION"),
KPLIB_param_presetF,
KPLIB_param_presetE,
KPLIB_param_presetR,
KPLIB_param_presetC,
KPLIB_param_presetArsenal,
KPLIB_ace_enabled
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",
[
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];
};

true
10 changes: 7 additions & 3 deletions Missionframework/modules/00_init/fnc/fn_init_loadPresets.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
File: fn_init_loadPresets.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2017-10-16
Last Update: 2018-12-09
Last Update: 2019-04-15
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
Expand Down Expand Up @@ -65,8 +65,12 @@ KPLIB_preset_packageE = [
["KPLIB_preset_nameE", KPLIB_preset_nameE],
["KPLIB_preset_alphabetE", KPLIB_preset_alphabetE]
];
KPLIB_preset_packageR = [];
KPLIB_preset_packageC = [];
KPLIB_preset_packageR = [
["KPLIB_preset_nameR", KPLIB_preset_nameR]
];
KPLIB_preset_packageC = [
["KPLIB_preset_nameC", KPLIB_preset_nameC]
];

// Process all preset variables
private _suffix = "";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
File: fn_init_processPresetVar.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-12-08
Last Update: 2018-12-08
Last Update: 2019-04-15
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
Expand All @@ -29,7 +29,13 @@ if (!isServer) exitWith {false};
private _prstVar = missionNamespace getVariable (["KPLIB_preset_", _variable, _suffix] joinString "");

// Skip if the basic variable is not used or if it's name or alphabet
if !(isNil "_prstVar" || _variable isEqualTo "name" || _variable isEqualTo "alphabet") then {
if !(
isNil "_prstVar" ||
_variable isEqualTo "name" ||
_variable isEqualTo "nameC" ||
_variable isEqualTo "nameR" ||
_variable isEqualTo "alphabet"
) then {
// Filter mods from arrays or check single classname for availability
if (_prstVar isEqualType []) then {
_prstVar = [_prstVar] call KPLIB_fnc_init_filterMods;
Expand Down
15 changes: 13 additions & 2 deletions Missionframework/modules/01_common/fnc/fn_common_createUnit.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
File: fn_common_createUnit.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-10-24
Last Update: 2019-03-31
Last Update: 2019-04-16
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Public: Yes
Expand All @@ -30,7 +30,18 @@ params [

if (_grp isEqualTo grpNull || _classname isEqualTo "") exitWith {objNull};

private _unit = _grp createUnit [_classname, _spawnPos, [], 10, _addition];
// Create temp group, as we need to let the unit join the "correct side group".
// If we use the "correct side group" for the createUnit, the group would switch to the side of the unit written in the config.
private _grpTemp = createGroup [civilian, true];

// Create unit in temp group
private _unit = _grpTemp createUnit [_classname, _spawnPos, [], 10, _addition];

// Let unit join the "correct side group"
[_unit] joinSilent _grp;

// Remove temp group
deleteGroup _grpTemp;

["KPLIB_unit_created", [_unit]] call CBA_fnc_globalEvent;

Expand Down
42 changes: 42 additions & 0 deletions Missionframework/modules/01_common/fnc/fn_common_log.sqf
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
KPLIB_fnc_common_log
File: fn_common_log.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2019-04-15
Last Update: 2019-04-17
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Public: Yes
Description:
A replacement for the diag_log function. This should be used instead of the vanilla function.
It'll add automatically the [KP LIBERATION] tag and allows to specify a module tag and if the diag_tickTime should be shown.
It also gets rid of the quotation marks in the rpt for the log messages.
Parameter(s):
_text - Text of the log entry [STRING, defaults to ""]
_module - Tag which should be written before the log entry text in square brackets [STRING, defaults to ""]
_tickTime - Should a diag_tickTime shown in the log entry [BOOL, defaults to false]
Returns:
Function reached the end [BOOL]
*/

params [
["_text", "", [""]],
["_module", "", [""]],
["_tickTime", false, [false]]
];

// Compose log entry
private _entry = [
"[KP LIBERATION] ",
(["", format ["[%1] ", diag_tickTime]] select _tickTime),
(["", format ["[%1] ", _module]] select !(_module isEqualTo "")),
_text
] joinString "";

// Write log entry
diag_log text _entry;

true
5 changes: 4 additions & 1 deletion Missionframework/modules/01_common/functions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
File: functions.hpp
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-09-15
Last Update: 2019-03-31
Last Update: 2019-04-15
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
Expand Down Expand Up @@ -62,6 +62,9 @@ class common {
// Checks if player occupies a slot
class common_isSlot {};

// Logs given text to server rpt
class common_log {};

// Initialize common module
class common_preInit {
preInit = 1;
Expand Down
4 changes: 2 additions & 2 deletions Missionframework/modules/13_plm/ui/KP_playerMenu.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
File: KP_playerMenu.hpp
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-08-03
Last Update: 2018-11-10
Last Update: 2019-04-15
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
Expand Down Expand Up @@ -175,7 +175,7 @@ class KP_playerMenu {
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,11,24);
w = KP_GETW(KP_WIDTH_VAL_C,(4/3));
h = KP_GETH(KP_HEIGHT_VAL_C,24);
}
};

class KP_ButtonRename: KP_ButtonCreate {
text = "$STR_KPLIB_DIALOG_BUTTON_RENAME";
Expand Down
4 changes: 2 additions & 2 deletions Missionframework/modules/15_build/ui/KPLIB_buildDisplay.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
File: KPLIB_defines.hpp
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-07-01
Last Update: 2019-02-23
Last Update: 2019-04-15
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
Expand Down Expand Up @@ -79,7 +79,7 @@ class KPLIB_build {
h = KP_GETH(KP_HEIGHT_VAL_LP,40);

text = "\a3\Ui_f\data\GUI\RscCommon\RscButtonSearch\search_start_ca.paa";
}
};

class KPLIB_BuildList: KPGUI_PRE_ListNBox {
idc = KPLIB_IDC_BUILD_ITEM_LIST;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
File: fn_garrison_spawnSectorInfantry.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-10-20
Last Update: 2019-03-31
Last Update: 2019-04-15
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Public: No
Expand Down Expand Up @@ -45,8 +45,8 @@ while {surfaceIsWater _spawnPos} do {

// Set array to select soldier classnames from
switch (_ownerNumber) do {
case 2: {_soldierArray = [KPLIB_preset_sideF] call KPLIB_fnc_common_getSoldierArray;};
default {_soldierArray = [] call KPLIB_fnc_common_getSoldierArray;};
case 2: {_soldierArray = [KPLIB_preset_sideF] call KPLIB_fnc_common_getSoldierArray; _side = KPLIB_preset_sideF;};
default {_soldierArray = [] call KPLIB_fnc_common_getSoldierArray; _side = KPLIB_preset_sideE;};
};

// Fetch unit classnames
Expand Down
4 changes: 2 additions & 2 deletions Missionframework/modules/23_logistic/ui/KPLIB_recycle.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
File: KPLIB_recycle.hpp
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2019-01-22
Last Update: 2019-04-05
Last Update: 2019-04-15
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
Expand Down Expand Up @@ -158,7 +158,7 @@ class KPLIB_recycle {
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,31,48);
w = KP_GETW(KP_WIDTH_VAL_C,1);
h = KP_GETH(KP_HEIGHT_VAL_C,3);
}
};

class KPLIB_ButtonRecycle: KPGUI_PRE_DialogButtonC {
idc = 68747;
Expand Down
4 changes: 2 additions & 2 deletions Missionframework/modules/23_logistic/ui/KPLIB_resupply.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
File: KPLIB_resupply.hpp
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2019-02-21
Last Update: 2019-04-05
Last Update: 2019-04-15
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
Expand Down Expand Up @@ -92,7 +92,7 @@ class KPLIB_resupply {
w = KP_GETW(KP_WIDTH_VAL_C,1);
h = KP_GETH(KP_HEIGHT_VAL_C,24);
onSliderPosChanged = "[] call KPLIB_fnc_logistic_calcCosts"
}
};

class KPLIB_TextSlider: KPLIB_TextCargoState {
text = "$STR_KPLIB_DIALOG_RESUPPLY_SLIDERVALUE";
Expand Down
38 changes: 20 additions & 18 deletions Missionframework/presets/armies/csat.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
File: csat.sqf
Author: KP Liberation Dev Team - https://github.com/KillahPotatoes
Date: 2018-11-17
Last Update: 2018-12-09
Last Update: 2019-04-17
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
Description:
Expand Down Expand Up @@ -86,7 +86,7 @@ KPLIB_PRST_SETVAR("fobTruck", "O_Truck_03_device_F");
// The building defined to unlock FOB logistic functionalities.
KPLIB_PRST_SETVAR("logiBuilding", "Land_RepairDepot_01_tan_F");
// This is Potato 01, a multipurpose mobile respawn as a helicopter.
KPLIB_PRST_SETVAR("potato", "O_Heli_Transport_04_covered_F");
KPLIB_PRST_SETVAR("potato", "O_Heli_Transport_04_F");
// This is the mobile respawn (and medical) truck.
KPLIB_PRST_SETVAR("respawnTruck", "O_Truck_03_medical_F");
// The helipad used to increase the GLOBAL rotary-wing cap.
Expand Down Expand Up @@ -210,21 +210,21 @@ KPLIB_PRST_SETVAR("sfTeamLeader", "O_V_Soldier_TL_hex_F");

// Infantry units
KPLIB_PRST_CAT_BEGIN("units");
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsRifleman"), 20, 0, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsLightAt"), 30, 0, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsGrenadier"), 25, 0, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsAutorifleMan"), 25, 0, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsHeavyGunner"), 35, 0, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsMarksman"), 30, 0, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsAntiTank"), 50, 10, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsAntiAir"), 50, 10, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsMedic"), 30, 0, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsEngineer"), 30, 0, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsParatrooper"), 20, 0, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsCrewmanVeh"), 10, 0, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsCrewmanHeli"), 10, 0, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsPilotHeli"), 10, 0, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsPilotJet"), 10, 0, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsRifleman"), 20, 0, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsLightAt"), 30, 0, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsGrenadier"), 25, 0, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsAutorifleMan"), 25, 0, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsHeavyGunner"), 35, 0, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsMarksman"), 30, 0, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsAntiTank"), 50, 10, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsAntiAir"), 50, 10, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsMedic"), 30, 0, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsEngineer"), 30, 0, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsParatrooper"), 20, 0, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsCrewmanVeh"), 10, 0, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsCrewmanHeli"), 10, 0, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsPilotHeli"), 10, 0, 0);
KPLIB_PRST_CAT_ADD("units", KPLIB_PRST_GETVAR("rsPilotJet"), 10, 0, 0);
KPLIB_PRST_CAT_END("units");

// Special Forces units
Expand Down Expand Up @@ -295,7 +295,9 @@ KPLIB_PRST_CAT_END("vehArty");
KPLIB_PRST_CAT_BEGIN("heliTrans");
KPLIB_PRST_CAT_ADD("heliTrans", "B_Heli_Light_01_F", 200, 0, 100); // MH-9 Hummingbird
KPLIB_PRST_CAT_ADD("heliTrans", "O_Heli_Light_02_unarmed_F", 250, 0, 150); // PO-30 Orca (unarmed)
KPLIB_PRST_CAT_ADD("heliTrans", "O_Heli_Transport_04_bench_F", 300, 0, 175); // Mi-290 Taru (Bench)
KPLIB_PRST_CAT_ADD("heliTrans", "O_Heli_Transport_04_bench_F", 275, 0, 175); // Mi-290 Taru (Bench)
KPLIB_PRST_CAT_ADD("heliTrans", "O_Heli_Transport_04_covered_F", 300, 0, 175); // Mi-290 Taru (Covered)
KPLIB_PRST_CAT_ADD("heliTrans", "O_Heli_Transport_04_medevac_F", 320, 0, 175); // Mi-290 Taru (MedEvac)
KPLIB_PRST_CAT_END("heliTrans");

// Attack Helicopters
Expand Down
Loading

0 comments on commit 7f8bad9

Please sign in to comment.