initial files
This commit is contained in:
50
kp_liberation.brf_sumava/KP/KPPLM/KPPLM_functions.hpp
Normal file
50
kp_liberation.brf_sumava/KP/KPPLM/KPPLM_functions.hpp
Normal file
@@ -0,0 +1,50 @@
|
||||
/*
|
||||
KP PLAYER MENU FUNCTIONS
|
||||
|
||||
File: KPPLM_functions.hpp
|
||||
Author: Wyqer - https://github.com/KillahPotatoes
|
||||
Date: 2018-06-02
|
||||
Last Update: 2020-04-08
|
||||
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
Description:
|
||||
Defines for all functions for the KP Player Menu.
|
||||
*/
|
||||
|
||||
class KPPLM {
|
||||
class main {
|
||||
file = "KP\KPPLM\fnc";
|
||||
|
||||
// Apply and save settings
|
||||
class apply {};
|
||||
|
||||
// Creates a new group
|
||||
class create {};
|
||||
|
||||
// Apply view distance and sound volume
|
||||
class getInOut {};
|
||||
|
||||
// Joins selected group
|
||||
class join {};
|
||||
|
||||
// Open the dialog
|
||||
class openDialog {};
|
||||
|
||||
// Module post initialization
|
||||
class postInit {};
|
||||
|
||||
// Module pre initialization
|
||||
class preInit {
|
||||
preInit = 1;
|
||||
};
|
||||
|
||||
// Applies new name to group
|
||||
class rename {};
|
||||
|
||||
// Save dialog settings
|
||||
class save {};
|
||||
|
||||
// Get and display KP Ranks data
|
||||
class showRankData {};
|
||||
};
|
||||
};
|
||||
40
kp_liberation.brf_sumava/KP/KPPLM/fnc/fn_apply.sqf
Normal file
40
kp_liberation.brf_sumava/KP/KPPLM/fnc/fn_apply.sqf
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
KPPLM_fnc_apply
|
||||
|
||||
File: fn_apply.sqf
|
||||
Author: Wyqer - https://github.com/KillahPotatoes
|
||||
Date: 2018-08-04
|
||||
Last Update: 2018-11-10
|
||||
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
Description:
|
||||
Applies and saves the selected settings from the player menu dialog.
|
||||
|
||||
Parameter(s):
|
||||
NONE
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
|
||||
// Apply current view distance and sound volume
|
||||
[] call KPPLM_fnc_getInOut;
|
||||
|
||||
// Apply terrain detail setting
|
||||
switch (KPPLM_terrain) do {
|
||||
case 0: {setTerrainGrid 50;};
|
||||
case 1: {setTerrainGrid 25;};
|
||||
case 2: {setTerrainGrid 12.5;};
|
||||
case 3: {setTerrainGrid 6.25;};
|
||||
case 4: {setTerrainGrid 3.125;};
|
||||
default {setTerrainGrid 10;};
|
||||
};
|
||||
|
||||
// Apply radio chatter setting
|
||||
switch (KPPLM_radio) do {
|
||||
case 1: {enableRadio true; 1 fadeRadio 0;};
|
||||
case 2: {enableRadio false; 1 fadeRadio 0;};
|
||||
default {enableRadio true; 1 fadeRadio 1;};
|
||||
};
|
||||
|
||||
true
|
||||
27
kp_liberation.brf_sumava/KP/KPPLM/fnc/fn_create.sqf
Normal file
27
kp_liberation.brf_sumava/KP/KPPLM/fnc/fn_create.sqf
Normal file
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
KPPLM_fnc_create
|
||||
|
||||
File: fn_create.sqf
|
||||
Author: Wyqer - https://github.com/KillahPotatoes
|
||||
Date: 2018-08-05
|
||||
Last Update: 2018-11-10
|
||||
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
Description:
|
||||
Creates a new group for the player.
|
||||
|
||||
Parameter(s):
|
||||
NONE
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
|
||||
private _grp = createGroup [(side player), true];
|
||||
[player] join _grp;
|
||||
|
||||
// Refresh Dialog
|
||||
closeDialog 0;
|
||||
[{!dialog}, {call KPPLM_fnc_openDialog;}] call CBA_fnc_waitUntilAndExecute;
|
||||
|
||||
true
|
||||
48
kp_liberation.brf_sumava/KP/KPPLM/fnc/fn_getInOut.sqf
Normal file
48
kp_liberation.brf_sumava/KP/KPPLM/fnc/fn_getInOut.sqf
Normal file
@@ -0,0 +1,48 @@
|
||||
/*
|
||||
KPPLM_fnc_getInOut
|
||||
|
||||
File: fn_getInOut.sqf
|
||||
Author: Wyqer - https://github.com/KillahPotatoes
|
||||
Date: 2018-08-05
|
||||
Last Update: 2018-11-10
|
||||
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
Description:
|
||||
Sets the view distance and the sound volume of the player depending on the current vehicle.
|
||||
Also changes the camera view, if functionality is enabled by the player.
|
||||
|
||||
Parameter(s):
|
||||
NONE
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
|
||||
// Player on foot
|
||||
if (isNull objectParent player) then {
|
||||
setViewDistance KPPLM_viewFoot;
|
||||
setObjectViewDistance KPPLM_viewFoot;
|
||||
1 fadeSound 1;
|
||||
};
|
||||
|
||||
// Player in boat or land vehicle
|
||||
if (vehicle player isKindOf "LandVehicle" || vehicle player isKindOf "Ship") then {
|
||||
setViewDistance KPPLM_viewVeh;
|
||||
setObjectViewDistance KPPLM_viewVeh;
|
||||
1 fadeSound KPPLM_soundVeh;
|
||||
if (difficultyOption "thirdPersonView" == 1) then {
|
||||
if (KPPLM_tpv > 1) then {player switchCamera "EXTERNAL";};
|
||||
};
|
||||
};
|
||||
|
||||
// Player in air vehicle
|
||||
if (vehicle player isKindOf "Air") then {
|
||||
setViewDistance KPPLM_viewAir;
|
||||
setObjectViewDistance KPPLM_viewAir;
|
||||
1 fadeSound KPPLM_soundVeh;
|
||||
if (difficultyOption "thirdPersonView" == 1) then {
|
||||
if (KPPLM_tpv == 1 || KPPLM_tpv == 3) then {player switchCamera "EXTERNAL";};
|
||||
};
|
||||
};
|
||||
|
||||
true
|
||||
31
kp_liberation.brf_sumava/KP/KPPLM/fnc/fn_join.sqf
Normal file
31
kp_liberation.brf_sumava/KP/KPPLM/fnc/fn_join.sqf
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
KPPLM_fnc_join
|
||||
|
||||
File: fn_join.sqf
|
||||
Author: Wyqer - https://github.com/KillahPotatoes
|
||||
Date: 2018-08-05
|
||||
Last Update: 2018-11-10
|
||||
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
Description:
|
||||
Joins the group which is currently selected in the group list.
|
||||
|
||||
Parameter(s):
|
||||
NONE
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
|
||||
// Dialog controls
|
||||
private _dialog = findDisplay 75803;
|
||||
private _ctrlGroupList = _dialog displayCtrl 758038;
|
||||
|
||||
private _grp = KPPLM_groups select (lbCurSel _ctrlGroupList);
|
||||
[player] join _grp;
|
||||
|
||||
// Refresh Dialog with a small delay
|
||||
[{player in units (_this select 0)}, {closeDialog 0;}, [_grp]] call CBA_fnc_waitUntilAndExecute;
|
||||
[{!dialog}, {call KPPLM_fnc_openDialog;}] call CBA_fnc_waitUntilAndExecute;
|
||||
|
||||
true
|
||||
94
kp_liberation.brf_sumava/KP/KPPLM/fnc/fn_openDialog.sqf
Normal file
94
kp_liberation.brf_sumava/KP/KPPLM/fnc/fn_openDialog.sqf
Normal file
@@ -0,0 +1,94 @@
|
||||
/*
|
||||
KPPLM_fnc_openDialog
|
||||
|
||||
File: fn_openDialog.sqf
|
||||
Author: Wyqer - https://github.com/KillahPotatoes
|
||||
Date: 2018-08-03
|
||||
Last Update: 2018-11-10
|
||||
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
Description:
|
||||
Opens the player menu dialog.
|
||||
|
||||
Parameter(s):
|
||||
NONE
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
|
||||
// Create player options dialog
|
||||
createDialog "KPPLM_dialog";
|
||||
disableSerialization;
|
||||
|
||||
// Dialog controls
|
||||
private _dialog = findDisplay 75803;
|
||||
private _ctrlLabelRank = _dialog displayCtrl 758031;
|
||||
private _ctrlRank = _dialog displayCtrl 758032;
|
||||
private _ctrlLabelScore = _dialog displayCtrl 758033;
|
||||
private _ctrlScore = _dialog displayCtrl 758034;
|
||||
private _ctrlLabelPlaytime = _dialog displayCtrl 758035;
|
||||
private _ctrlPlaytime = _dialog displayCtrl 758036;
|
||||
private _ctrlNoRanks = _dialog displayCtrl 758037;
|
||||
private _ctrlGroupList = _dialog displayCtrl 758038;
|
||||
private _ctrlViewFoot = _dialog displayCtrl 7580310;
|
||||
private _ctrlViewVeh = _dialog displayCtrl 7580311;
|
||||
private _ctrlViewAir = _dialog displayCtrl 7580312;
|
||||
private _ctrlTerrain = _dialog displayCtrl 7580313;
|
||||
private _ctrlTpv = _dialog displayCtrl 7580314;
|
||||
private _ctrlRadio = _dialog displayCtrl 7580315;
|
||||
private _ctrlValueSound = _dialog displayCtrl 7580316;
|
||||
private _ctrlSliderSound = _dialog displayCtrl 7580317;
|
||||
|
||||
// Display KP Ranks data or hide the player menu entries for the data
|
||||
if (KPPLM_KPR) then {
|
||||
[] call KPPLM_fnc_showRankData;
|
||||
} else {
|
||||
{
|
||||
_x ctrlShow false;
|
||||
} forEach [_ctrlLabelRank, _ctrlRank, _ctrlLabelScore, _ctrlScore, _ctrlLabelPlaytime, _ctrlPlaytime];
|
||||
};
|
||||
|
||||
// Fill group list with all groups leaded by players
|
||||
{
|
||||
if (player in units _x) then {
|
||||
_ctrlGroupList lbSetCurSel (_ctrlGroupList lbAdd format [">> %1 - %2 (%3)", groupId _x, name leader _x, count units _x]);
|
||||
} else {
|
||||
_ctrlGroupList lbAdd format ["%1 - %2 (%3)", groupId _x, name leader _x, count units _x];
|
||||
};
|
||||
|
||||
} forEach KPPLM_groups;
|
||||
|
||||
// Set initial values for view distances
|
||||
_ctrlViewFoot ctrlSetText str KPPLM_viewFoot;
|
||||
_ctrlViewVeh ctrlSetText str KPPLM_viewVeh;
|
||||
_ctrlViewAir ctrlSetText str KPPLM_viewAir;
|
||||
|
||||
// Fill density, auto tpv and radio dropdowns. Also preselect the saved values
|
||||
_ctrlTerrain lbAdd localize "STR_KPPLM_TERRAINLOW"; // 50
|
||||
_ctrlTerrain lbAdd localize "STR_KPPLM_TERRAINSTANDARD"; // 25
|
||||
_ctrlTerrain lbAdd localize "STR_KPPLM_TERRAINHIGH"; // 12.5
|
||||
_ctrlTerrain lbAdd localize "STR_KPPLM_TERRAINVHIGH"; // 6.25
|
||||
_ctrlTerrain lbAdd localize "STR_KPPLM_TERRAINULTRA"; // 3.125
|
||||
_ctrlTerrain lbSetCurSel KPPLM_terrain;
|
||||
|
||||
_ctrlTpv lbAdd localize "STR_KPPLM_TPDISABLED";
|
||||
_ctrlTpv lbAdd localize "STR_KPPLM_TPVAIR";
|
||||
_ctrlTpv lbAdd localize "STR_KPPLM_TPVLAND";
|
||||
_ctrlTpv lbAdd localize "STR_KPPLM_TPVALL";
|
||||
_ctrlTpv lbSetCurSel KPPLM_tpv;
|
||||
|
||||
_ctrlRadio lbAdd localize "STR_KPPLM_RADIONO";
|
||||
_ctrlRadio lbAdd localize "STR_KPPLM_RADIOVOICE";
|
||||
_ctrlRadio lbAdd localize "STR_KPPLM_RADIOALL";
|
||||
_ctrlRadio lbSetCurSel KPPLM_radio;
|
||||
|
||||
// Initialize sound slider range, position and speed
|
||||
_ctrlSliderSound sliderSetRange [0, 100];
|
||||
_ctrlSliderSound sliderSetPosition (KPPLM_soundVeh * 100);
|
||||
_ctrlSliderSound sliderSetSpeed [1, 1];
|
||||
|
||||
// Set sound value output to initial sound slider value
|
||||
_ctrlValueSound ctrlSetText format ["%1%2", round sliderPosition _ctrlSliderSound, "%"];
|
||||
|
||||
true
|
||||
58
kp_liberation.brf_sumava/KP/KPPLM/fnc/fn_postInit.sqf
Normal file
58
kp_liberation.brf_sumava/KP/KPPLM/fnc/fn_postInit.sqf
Normal file
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
KPPLM_fnc_postInit
|
||||
|
||||
File: fn_postInit.sqf
|
||||
Author: Wyqer - https://github.com/KillahPotatoes
|
||||
Date: 2017-08-31
|
||||
Last Update: 2020-04-17
|
||||
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
Description:
|
||||
The postInit function of a module takes care of starting/executing the modules functions or scripts.
|
||||
Basically it starts/initializes the module functionality to make all provided features usable.
|
||||
|
||||
Parameter(s):
|
||||
NONE
|
||||
|
||||
Returns:
|
||||
Module postInit finished [BOOL]
|
||||
*/
|
||||
|
||||
if (!KPPLM_CBA) exitWith {["CBA not loaded. Aborting initialization!"] call BIS_fnc_error; false};
|
||||
|
||||
// Player section
|
||||
if (hasInterface) then {
|
||||
// Load settings, if available
|
||||
private _settings = profileNamespace getVariable ["KPPLM_Settings", []];
|
||||
if !(_settings isEqualTo []) then {
|
||||
KPPLM_viewFoot = _settings select 0;
|
||||
KPPLM_viewVeh = _settings select 1;
|
||||
KPPLM_viewAir = _settings select 2;
|
||||
KPPLM_terrain = _settings select 3;
|
||||
KPPLM_tpv = _settings select 4;
|
||||
KPPLM_radio = _settings select 5;
|
||||
KPPLM_soundVeh = _settings select 6;
|
||||
};
|
||||
|
||||
// Add event handler
|
||||
player addEventHandler ["GetInMan", {[] call KPPLM_fnc_getInOut}];
|
||||
player addEventHandler ["GetOutMan", {[] call KPPLM_fnc_getInOut}];
|
||||
|
||||
// Action to open the dialog
|
||||
private _actionArray = [
|
||||
"<t color='#FF8000'>" + localize "STR_KPPLM_ACTIONOPEN" + "</t>",
|
||||
{[] call KPPLM_fnc_openDialog;},
|
||||
nil,
|
||||
-1000,
|
||||
false,
|
||||
true,
|
||||
"",
|
||||
'_target isEqualTo _originalTarget'
|
||||
];
|
||||
[_actionArray] call CBA_fnc_addPlayerAction;
|
||||
|
||||
// Apply default/loaded values
|
||||
[] call KPPLM_fnc_apply;
|
||||
};
|
||||
|
||||
true
|
||||
47
kp_liberation.brf_sumava/KP/KPPLM/fnc/fn_preInit.sqf
Normal file
47
kp_liberation.brf_sumava/KP/KPPLM/fnc/fn_preInit.sqf
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
KPPLM_fnc_preInit
|
||||
|
||||
File: fn_preInit.sqf
|
||||
Author: Wyqer - https://github.com/KillahPotatoes
|
||||
Date: 2018-10-18
|
||||
Last Update: 2020-04-17
|
||||
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
Description:
|
||||
The preInit function defines global variables, adds event handlers and set some vital settings which are used in this module.
|
||||
|
||||
Parameter(s):
|
||||
NONE
|
||||
|
||||
Returns:
|
||||
Module preInit finished [BOOL]
|
||||
*/
|
||||
|
||||
// Check if CBA is running
|
||||
KPPLM_CBA = isClass (configFile >> "CfgPatches" >> "cba_main");
|
||||
|
||||
// Check if KP Ranks is running
|
||||
KPPLM_KPR = isClass (configFile >> "CfgPatches" >> "KP_Ranks");
|
||||
|
||||
// View distance on foot
|
||||
KPPLM_viewFoot = viewDistance;
|
||||
|
||||
// View distance in land vehicle
|
||||
KPPLM_viewVeh = viewDistance;
|
||||
|
||||
// View distance in air vehicle
|
||||
KPPLM_viewAir = viewDistance;
|
||||
|
||||
// Terrain detail setting
|
||||
KPPLM_terrain = 2;
|
||||
|
||||
// Auto 3rd Person setting
|
||||
KPPLM_tpv = 0;
|
||||
|
||||
// Disable radio chatter setting
|
||||
KPPLM_radio = 0;
|
||||
|
||||
// Sound volume inside a vehicle
|
||||
KPPLM_soundVeh = soundVolume;
|
||||
|
||||
true
|
||||
38
kp_liberation.brf_sumava/KP/KPPLM/fnc/fn_rename.sqf
Normal file
38
kp_liberation.brf_sumava/KP/KPPLM/fnc/fn_rename.sqf
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
KPPLM_fnc_rename
|
||||
|
||||
File: fn_rename.sqf
|
||||
Author: Wyqer - https://github.com/KillahPotatoes
|
||||
Date: 2018-08-05
|
||||
Last Update: 2018-11-10
|
||||
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
Description:
|
||||
Set the new name for the group which is selected in the group list.
|
||||
|
||||
Parameter(s):
|
||||
NONE
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
|
||||
// Dialog controls
|
||||
private _dialog = findDisplay 75803;
|
||||
private _ctrlGroupList = _dialog displayCtrl 758038;
|
||||
private _ctrlEditName = _dialog displayCtrl 758039;
|
||||
private _grp = KPPLM_groups select (lbCurSel _ctrlGroupList);
|
||||
|
||||
// Only allow change, when player is leader
|
||||
if (leader _grp == player) then {
|
||||
_grp setGroupIdGlobal [ctrlText _ctrlEditName];
|
||||
|
||||
// Refresh Dialog
|
||||
closeDialog 0;
|
||||
[{!dialog}, {call KPPLM_fnc_openDialog;}] call CBA_fnc_waitUntilAndExecute;
|
||||
} else {
|
||||
hint localize "STR_KPPLM_NOTLEADER";
|
||||
[{hintSilent "";}, [], 3] call CBA_fnc_waitAndExecute;
|
||||
};
|
||||
|
||||
true
|
||||
52
kp_liberation.brf_sumava/KP/KPPLM/fnc/fn_save.sqf
Normal file
52
kp_liberation.brf_sumava/KP/KPPLM/fnc/fn_save.sqf
Normal file
@@ -0,0 +1,52 @@
|
||||
/*
|
||||
KPPLM_fnc_save
|
||||
|
||||
File: fn_save.sqf
|
||||
Author: Wyqer - https://github.com/KillahPotatoes
|
||||
Date: 2018-08-05
|
||||
Last Update: 2018-11-10
|
||||
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
Description:
|
||||
Saves the selected settings from the player menu dialog and calls the apply function.
|
||||
|
||||
Parameter(s):
|
||||
NONE
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
|
||||
// Dialog controls
|
||||
private _dialog = findDisplay 75803;
|
||||
private _ctrlViewFoot = _dialog displayCtrl 7580310;
|
||||
private _ctrlViewVeh = _dialog displayCtrl 7580311;
|
||||
private _ctrlViewAir = _dialog displayCtrl 7580312;
|
||||
private _ctrlTerrain = _dialog displayCtrl 7580313;
|
||||
private _ctrlTpv = _dialog displayCtrl 7580314;
|
||||
private _ctrlRadio = _dialog displayCtrl 7580315;
|
||||
private _ctrlSliderSound = _dialog displayCtrl 7580317;
|
||||
|
||||
// Fetch all selected values
|
||||
KPPLM_viewFoot = round (parseNumber (ctrlText _ctrlViewFoot));
|
||||
if (KPPLM_viewFoot == 0) then {KPPLM_viewFoot = 1600;};
|
||||
KPPLM_viewVeh = round (parseNumber (ctrlText _ctrlViewVeh));
|
||||
if (KPPLM_viewVeh == 0) then {KPPLM_viewVeh = 1600;};
|
||||
KPPLM_viewAir = round (parseNumber (ctrlText _ctrlViewAir));
|
||||
if (KPPLM_viewAir == 0) then {KPPLM_viewAir = 1600;};
|
||||
KPPLM_terrain = lbCurSel _ctrlTerrain;
|
||||
KPPLM_tpv = lbCurSel _ctrlTpv;
|
||||
KPPLM_radio = lbCurSel _ctrlRadio;
|
||||
KPPLM_soundVeh = (round sliderPosition _ctrlSliderSound) / 100;
|
||||
|
||||
// Save settings in user profile
|
||||
profileNamespace setVariable ["KPPLM_Settings", [KPPLM_viewFoot, KPPLM_viewVeh, KPPLM_viewAir, KPPLM_terrain, KPPLM_tpv, KPPLM_radio, KPPLM_soundVeh]];
|
||||
saveProfileNamespace;
|
||||
|
||||
// Apply settings
|
||||
[] call KPPLM_fnc_apply;
|
||||
|
||||
// Close the dialog
|
||||
closeDialog 0;
|
||||
|
||||
true
|
||||
39
kp_liberation.brf_sumava/KP/KPPLM/fnc/fn_showRankData.sqf
Normal file
39
kp_liberation.brf_sumava/KP/KPPLM/fnc/fn_showRankData.sqf
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
KPPLM_fnc_showRankData
|
||||
|
||||
File: fn_showRankData.sqf
|
||||
Author: Wyqer - https://github.com/KillahPotatoes
|
||||
Date: 2018-08-05
|
||||
Last Update: 2018-11-10
|
||||
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
Description:
|
||||
Reads the KP Ranks data of the current player and displays it in the player menu dialog.
|
||||
|
||||
Parameter(s):
|
||||
NONE
|
||||
|
||||
Returns:
|
||||
Function reached the end [BOOL]
|
||||
*/
|
||||
|
||||
// Dialog controls
|
||||
private _dialog = findDisplay 75803;
|
||||
private _ctrlRank = _dialog displayCtrl 758032;
|
||||
private _ctrlScore = _dialog displayCtrl 758034;
|
||||
private _ctrlPlaytime = _dialog displayCtrl 758036;
|
||||
private _ctrlNoRanks = _dialog displayCtrl 758037;
|
||||
|
||||
// Disable no ranks hint
|
||||
_ctrlNoRanks ctrlShow false;
|
||||
|
||||
// Show data in dialog
|
||||
_ctrlRank ctrlSetText ([] call KPR_fnc_getRankName);
|
||||
if (KPR_levelSystem) then {
|
||||
_ctrlScore ctrlSetText str ([] call KPR_fnc_getScore);
|
||||
} else {
|
||||
_ctrlScore ctrlSetText (localize "STR_KPPLM_NOLVLSYSTEM");
|
||||
};
|
||||
_ctrlPlaytime ctrlSetText ([] call KPR_fnc_getPlaytime);
|
||||
|
||||
true
|
||||
250
kp_liberation.brf_sumava/KP/KPPLM/ui/KPPLM_dialog.hpp
Normal file
250
kp_liberation.brf_sumava/KP/KPPLM/ui/KPPLM_dialog.hpp
Normal file
@@ -0,0 +1,250 @@
|
||||
/*
|
||||
KP player menu dialog
|
||||
|
||||
File: KPPLM_dialog.hpp
|
||||
Author: Wyqer - https://github.com/KillahPotatoes
|
||||
Date: 2018-08-03
|
||||
Last Update: 2018-11-10
|
||||
License: GNU General Public License v3.0 - https://www.gnu.org/licenses/gpl-3.0.html
|
||||
|
||||
Description:
|
||||
Provides various functionalities for the players like group management, view distances, etc.
|
||||
*/
|
||||
|
||||
class KPPLM_dialog {
|
||||
idd = 75803;
|
||||
movingEnable = 0;
|
||||
// Fetch all player groups when opened and free the variable when closed
|
||||
onLoad = "KPPLM_groups = allGroups select {isPlayer (leader _x)}";
|
||||
onUnload = "KPPLM_groups = nil";
|
||||
|
||||
class controlsBackground {
|
||||
|
||||
class KP_DialogTitle: KPGUI_PRE_DialogTitleC {
|
||||
text = "$STR_KPPLM_TITLE";
|
||||
};
|
||||
|
||||
class KP_DialogArea: KPGUI_PRE_DialogBackgroundC {};
|
||||
|
||||
class KP_LabelPlayer: KPGUI_PRE_InlineTitle {
|
||||
text = "$STR_KPPLM_LABELPLAYER";
|
||||
x = KP_GETCX(KP_X_VAL_C,KP_WIDTH_VAL_C,0,1);
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,0,16);
|
||||
w = KP_GETW(KP_WIDTH_VAL_C,1);
|
||||
h = KP_GETH(KP_HEIGHT_VAL_C,16);
|
||||
};
|
||||
|
||||
class KP_TextRank: KPGUI_PRE_Text {
|
||||
idc = 758031;
|
||||
text = "$STR_KPPLM_RANK";
|
||||
x = KP_GETCX(KP_X_VAL_C,KP_WIDTH_VAL_C,0,1);
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,1,16);
|
||||
w = KP_GETW(KP_WIDTH_VAL_C,2);
|
||||
h = KP_GETH(KP_HEIGHT_VAL_C,24);
|
||||
};
|
||||
|
||||
class KP_TextScore: KP_TextRank {
|
||||
idc = 758033;
|
||||
text = "$STR_KPPLM_SCORE";
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,5,48);
|
||||
};
|
||||
|
||||
class KP_TextPlaytime: KP_TextRank {
|
||||
idc = 758035;
|
||||
text = "$STR_KPPLM_PLAYTIME";
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,7,48);
|
||||
};
|
||||
|
||||
class KP_NoRanks: KP_LabelPlayer {
|
||||
idc = 758037;
|
||||
style = 2;
|
||||
colorText[] = {0.8, 0, 0, 0.75};
|
||||
text = "$STR_KPPLM_NORANKS";
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,3,32);
|
||||
sizeEx = KP_TEXT_L;
|
||||
};
|
||||
|
||||
class KP_LabelGroups: KP_LabelPlayer {
|
||||
text = "$STR_KPPLM_LABELGROUPS";
|
||||
x = KP_GETCX(KP_X_VAL_C,KP_WIDTH_VAL_C,0,1);
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,3,16);
|
||||
w = KP_GETW(KP_WIDTH_VAL_C,1);
|
||||
h = KP_GETH(KP_HEIGHT_VAL_C,16);
|
||||
};
|
||||
|
||||
class KP_LabelView: KP_LabelPlayer {
|
||||
text = "$STR_KPPLM_LABELVIEW";
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,1,2);
|
||||
};
|
||||
|
||||
class KP_TextViewFoot: KPGUI_PRE_Text {
|
||||
text = "$STR_KPPLM_VIEWFOOT";
|
||||
x = KP_GETCX(KP_X_VAL_C,KP_WIDTH_VAL_C,1,2);
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,9,16);
|
||||
w = KP_GETW(KP_WIDTH_VAL_C,2);
|
||||
h = KP_GETH(KP_HEIGHT_VAL_C,24);
|
||||
};
|
||||
|
||||
class KP_TextViewVehicle: KP_TextViewFoot {
|
||||
text = "$STR_KPPLM_VIEWVEHICLE";
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,29,48);
|
||||
};
|
||||
|
||||
class KP_TextViewAir: KP_TextViewFoot {
|
||||
text = "$STR_KPPLM_VIEWAIR";
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,31,48);
|
||||
};
|
||||
|
||||
class KP_LabelMisc: KP_LabelPlayer {
|
||||
text = "$STR_KPPLM_LABELMISC";
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,11,16);
|
||||
};
|
||||
|
||||
class KP_TextTerrain: KP_TextRank {
|
||||
text = "$STR_KPPLM_TEXTTERRAIN";
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,12,16);
|
||||
};
|
||||
|
||||
class KP_TextTPV: KP_TextRank {
|
||||
text = "$STR_KPPLM_TEXTTPV";
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,19,24);
|
||||
};
|
||||
|
||||
class KP_TextRadio: KP_TextRank {
|
||||
text = "$STR_KPPLM_TEXTRADIO";
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,10,12);
|
||||
};
|
||||
|
||||
class KP_TextSound: KP_TextRank {
|
||||
text = "$STR_KPPLM_TEXTSOUND";
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,22,24);
|
||||
};
|
||||
};
|
||||
|
||||
class controls {
|
||||
|
||||
class KPPLM_Version: KPGUI_PRE_DialogVersionIconC {
|
||||
tooltip = "$STR_KPPLM_VERSION";
|
||||
};
|
||||
|
||||
class KP_PlayerRank: KPGUI_PRE_Text {
|
||||
idc = 758032;
|
||||
style = 2;
|
||||
text = "";
|
||||
x = KP_GETCX(KP_X_VAL_C,KP_WIDTH_VAL_C,1,2);
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,1,16);
|
||||
w = KP_GETW(KP_WIDTH_VAL_C,2);
|
||||
h = KP_GETH(KP_HEIGHT_VAL_C,24);
|
||||
};
|
||||
|
||||
class KP_PlayerScore: KP_PlayerRank {
|
||||
idc = 758034;
|
||||
text = "";
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,5,48);
|
||||
};
|
||||
|
||||
class KP_PlayerTime: KP_PlayerRank {
|
||||
idc = 758036;
|
||||
text = "";
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,7,48);
|
||||
};
|
||||
|
||||
class KP_GroupList: KPGUI_PRE_ListBox {
|
||||
idc = 758038;
|
||||
x = KP_GETCX(KP_X_VAL_C,KP_WIDTH_VAL_C,0,1);
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,4,16);
|
||||
w = KP_GETW(KP_WIDTH_VAL_C,(4/3));
|
||||
h = KP_GETH(KP_HEIGHT_VAL_C,(24/5));
|
||||
onLBSelChanged = "ctrlSetText [758039, groupId (KPPLM_groups select (lbCurSel 758038))]";
|
||||
};
|
||||
|
||||
class KP_ButtonJoin: KPGUI_PRE_InlineButton {
|
||||
text = "$STR_KPPLM_JOIN";
|
||||
x = KP_GETCX(KP_X_VAL_C,KP_WIDTH_VAL_C,3,4);
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,4,16);
|
||||
w = KP_GETW(KP_WIDTH_VAL_C,4);
|
||||
h = KP_GETH(KP_HEIGHT_VAL_C,(48/5));
|
||||
onButtonClick = "[] call KPPLM_fnc_join";
|
||||
};
|
||||
|
||||
class KP_ButtonCreate: KP_ButtonJoin {
|
||||
text = "$STR_KPPLM_CREATE";
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,17,48);
|
||||
onButtonClick = "[] call KPPLM_fnc_create";
|
||||
};
|
||||
|
||||
class KP_RenameEdit: KPGUI_PRE_EditBox {
|
||||
idc = 758039;
|
||||
x = KP_GETCX(KP_X_VAL_C,KP_WIDTH_VAL_C,0,1);
|
||||
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_ButtonJoin {
|
||||
text = "$STR_KPPLM_RENAME";
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,11,24);
|
||||
h = KP_GETH(KP_HEIGHT_VAL_C,24);
|
||||
onButtonClick = "[] call KPPLM_fnc_rename";
|
||||
};
|
||||
|
||||
class KP_BoxViewFoot: KPGUI_PRE_EditBox {
|
||||
idc = 7580310;
|
||||
style = 65;
|
||||
x = KP_GETCX(KP_X_VAL_C,KP_WIDTH_VAL_C,1,4);
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,9,16);
|
||||
w = KP_GETW(KP_WIDTH_VAL_C,4);
|
||||
h = KP_GETH(KP_HEIGHT_VAL_C,24);
|
||||
};
|
||||
|
||||
class KP_BoxViewVehicle: KP_BoxViewFoot {
|
||||
idc = 7580311;
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,29,48);
|
||||
};
|
||||
|
||||
class KP_BoxViewAir: KP_BoxViewFoot {
|
||||
idc = 7580312;
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,31,48);
|
||||
};
|
||||
|
||||
class KP_ComboTerrain: KPGUI_PRE_Combo {
|
||||
idc = 7580313;
|
||||
x = KP_GETCX(KP_X_VAL_C,KP_WIDTH_VAL_C,1,2);
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,12,16);
|
||||
w = KP_GETW(KP_WIDTH_VAL_C,2);
|
||||
h = KP_GETH(KP_HEIGHT_VAL_C,24);
|
||||
};
|
||||
|
||||
class KP_ComboTPV: KP_ComboTerrain {
|
||||
idc = 7580314;
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,19,24);
|
||||
};
|
||||
|
||||
class KP_ComboRadio: KP_ComboTerrain {
|
||||
idc = 7580315;
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,10,12);
|
||||
};
|
||||
|
||||
class KP_TextSoundValue: KP_PlayerRank {
|
||||
idc = 7580316;
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,22,24);
|
||||
};
|
||||
|
||||
class KP_SliderSound: KPGUI_PRE_Slider {
|
||||
idc = 7580317;
|
||||
x = KP_GETCX(KP_X_VAL_C,KP_WIDTH_VAL_C,0,1);
|
||||
y = KP_GETCY(KP_Y_VAL_C,KP_HEIGHT_VAL_C,23,24);
|
||||
w = KP_GETW(KP_WIDTH_VAL_C,1);
|
||||
h = KP_GETH(KP_HEIGHT_VAL_C,24);
|
||||
tooltip = "$STR_KPPLM_TTSOUND";
|
||||
onSliderPosChanged = "ctrlSetText [7580316, format ['%1%2', round (_this select 1), '%']]";
|
||||
};
|
||||
|
||||
class KP_ApplyButton: KPGUI_PRE_DialogButtonC {
|
||||
text = "$STR_KPPLM_APPLY";
|
||||
onButtonClick = "[] call KPPLM_fnc_save";
|
||||
};
|
||||
|
||||
class KP_DialogCross: KPGUI_PRE_DialogCrossC {};
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user