mirror of
https://github.com/acemod/ACE3.git
synced 2024-08-30 18:23:18 +00:00
Add teleport player zeus module
This commit is contained in:
parent
4d028be876
commit
5b460205a9
@ -116,6 +116,14 @@ class CfgVehicles {
|
||||
sync[] = {};
|
||||
};
|
||||
};
|
||||
class GVAR(moduleGlobalSetSkill): GVAR(moduleBase) {
|
||||
displayName = "Global Set AI Skill";
|
||||
// icon = "\a3\Modules_F_Curator\Data\iconEndMission_ca.paa";
|
||||
// portrait = "\a3\Modules_F_Curator\Data\portraitEndMission_ca.paa";
|
||||
curatorInfoType = QGVAR(RscGlobalSetSkill);
|
||||
class Arguments {};
|
||||
class Attributes {};//todo, make it a threden as well
|
||||
};
|
||||
class GVAR(moduleSetMedic): GVAR(moduleBase) {
|
||||
curatorCanAttach = 1;
|
||||
displayName = CSTRING(ModuleSetMedic_DisplayName);
|
||||
@ -146,14 +154,6 @@ class CfgVehicles {
|
||||
sync[] = {};
|
||||
};
|
||||
};
|
||||
class GVAR(moduleGlobalSetSkill): GVAR(moduleBase) {
|
||||
displayName = "Global Set AI Skill";
|
||||
// icon = "\a3\Modules_F_Curator\Data\iconEndMission_ca.paa";
|
||||
// portrait = "\a3\Modules_F_Curator\Data\portraitEndMission_ca.paa";
|
||||
curatorInfoType = QGVAR(RscGlobalSetSkill);
|
||||
class Arguments {};
|
||||
class Attributes {};//todo, make it a threden as well
|
||||
};
|
||||
class GVAR(moduleSurrender): GVAR(moduleBase) {
|
||||
curatorCanAttach = 1;
|
||||
displayName = CSTRING(ModuleSurrender_DisplayName);
|
||||
@ -164,6 +164,11 @@ class CfgVehicles {
|
||||
sync[] = {};
|
||||
};
|
||||
};
|
||||
class GVAR(moduleTeleportPlayers): GVAR(moduleBase) {
|
||||
curatorCanAttach = 1;
|
||||
displayName = "Teleport Players";
|
||||
curatorInfoType = QGVAR(RscTeleportPlayers);
|
||||
};
|
||||
class GVAR(moduleUnconscious): GVAR(moduleBase) {
|
||||
curatorCanAttach = 1;
|
||||
displayName = CSTRING(ModuleUnconscious_DisplayName);
|
||||
|
@ -13,9 +13,11 @@ PREP(moduleSetMedic);
|
||||
PREP(moduleSetMedicalVehicle);
|
||||
PREP(moduleSetMedicalFacility);
|
||||
PREP(moduleSurrender);
|
||||
PREP(moduleTeleportPlayers);
|
||||
PREP(moduleUnconscious);
|
||||
PREP(moduleZeusSettings);
|
||||
PREP(setSkillsLocal);
|
||||
PREP(ui_globalSetSkill);
|
||||
PREP(ui_teleportPlayers);
|
||||
PREP(ui_vehCargo);
|
||||
PREP(zeusAttributes);
|
||||
|
@ -2,7 +2,10 @@
|
||||
|
||||
class CfgPatches {
|
||||
class ADDON {
|
||||
units[] = {QGVAR(moduleGlobalSetSkill)};
|
||||
units[] = {
|
||||
QGVAR(moduleGlobalSetSkill),
|
||||
QGVAR(moduleTeleportPlayers)
|
||||
};
|
||||
weapons[] = {};
|
||||
requiredVersion = REQUIRED_VERSION;
|
||||
requiredAddons[] = {"ace_common"};
|
||||
|
27
addons/zeus/functions/fnc_moduleTeleportPlayers.sqf
Normal file
27
addons/zeus/functions/fnc_moduleTeleportPlayers.sqf
Normal file
@ -0,0 +1,27 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
params ["_logic","_uid","_group"];
|
||||
|
||||
// Get the chosen unit
|
||||
private _player = [_uid] call BIS_fnc_getUnitByUID;
|
||||
|
||||
// Handle if group mode was selected
|
||||
if (_group) then {
|
||||
_player = units _player;
|
||||
} else {
|
||||
_player = [_player];
|
||||
};
|
||||
|
||||
// Handle teleportation
|
||||
{
|
||||
moveOut _x;
|
||||
|
||||
private _attached = attachedTo _logic;
|
||||
if (isNull _attached) then {
|
||||
[_x, _logic] call BIS_fnc_moveToRespawnPosition;
|
||||
} else {
|
||||
[_x, _attached] call BIS_fnc_moveToRespawnPosition;
|
||||
};
|
||||
} forEach _player;
|
||||
|
||||
deleteVehicle _logic;
|
53
addons/zeus/functions/fnc_ui_teleportPlayers.sqf
Normal file
53
addons/zeus/functions/fnc_ui_teleportPlayers.sqf
Normal file
@ -0,0 +1,53 @@
|
||||
#include "script_component.hpp"
|
||||
|
||||
disableSerialization;
|
||||
|
||||
params ["_control"];
|
||||
|
||||
//Generic Init:
|
||||
private _display = ctrlparent _control;
|
||||
private _ctrlButtonOK = _display displayctrl 1; //IDC_OK
|
||||
private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull);
|
||||
TRACE_1("logicObject",_logic);
|
||||
|
||||
_control ctrlRemoveAllEventHandlers "setFocus";
|
||||
|
||||
//Specific on-load stuff:
|
||||
private _listbox = _display displayCtrl 16189;
|
||||
{
|
||||
if (alive _x) then {
|
||||
_listbox lbSetData [_listbox lbAdd (name _x), getPlayerUID _x];
|
||||
};
|
||||
} forEach allPlayers;
|
||||
|
||||
_listbox lbSetCurSel 0;
|
||||
(_display displayCtrl 16188) cbSetChecked (_logic setVariable ["tpGroup",false]);
|
||||
|
||||
private _fnc_onUnload = {
|
||||
params ["_display"];
|
||||
|
||||
private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull);
|
||||
if (isNull _logic) exitWith {};
|
||||
|
||||
// Store checkbox value for reopening
|
||||
_logic setVariable ["tpGroup", cbChecked (_display displayCtrl 16188)];
|
||||
};
|
||||
|
||||
private _fnc_onConfirm = {
|
||||
params [["_ctrlButtonOK", controlNull, [controlNull]]];
|
||||
private _display = ctrlparent _ctrlButtonOK;
|
||||
if (isNull _display) exitWith {};
|
||||
|
||||
private _logic = GETMVAR(BIS_fnc_initCuratorAttributes_target,objnull);
|
||||
if (isNull _logic) exitWith {diag_log text format ["[POTATO] - ERROR Logic [%1] is null on confirm", _logic];};
|
||||
|
||||
private _lb = _display displayCtrl 16189;
|
||||
|
||||
private _uid = _lb lbData (lbCurSel _lb);
|
||||
private _group = cbChecked (_display displayCtrl 16188);
|
||||
|
||||
[_logic, _uid, _group] call FUNC(moduleTeleportPlayers);
|
||||
};
|
||||
|
||||
_display displayAddEventHandler ["unload", _fnc_onUnload];
|
||||
_ctrlButtonOK ctrlAddEventHandler ["buttonclick", _fnc_onConfirm];
|
@ -113,6 +113,64 @@ class GVAR(RscGlobalSetSkill): RscDisplayAttributes {
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
class GVAR(RscTeleportPlayers): RscDisplayAttributes {
|
||||
onLoad = QUOTE([ARR_3('onLoad', _this, QUOTE(QGVAR(RscTeleportPlayers)))] call FUNC(zeusAttributes));
|
||||
onUnload = QUOTE([ARR_3('onUnload', _this, QUOTE(QGVAR(RscTeleportPlayers)))] call FUNC(zeusAttributes));
|
||||
class Controls: Controls {
|
||||
class Background: Background {};
|
||||
class Title: Title {};
|
||||
class Content: Content {
|
||||
class Controls {
|
||||
class teleportPlayers: RscControlsGroupNoScrollbars {
|
||||
onSetFocus = QUOTE(_this call FUNC(ui_teleportPlayers));
|
||||
idc = 26422;
|
||||
x = 0;
|
||||
y = 0;
|
||||
w = W_PART(26);
|
||||
h = H_PART(8.5);
|
||||
class controls {
|
||||
class Title1: RscText {
|
||||
idc = -1;
|
||||
text = "Teleport Player";
|
||||
toolTip = "Teleport selected player to module position";
|
||||
x = 0;
|
||||
y = 0;
|
||||
w = W_PART(26);
|
||||
h = H_PART(1);
|
||||
colorBackground[] = {0,0,0,0.5};
|
||||
};
|
||||
class Value1: RscListbox {
|
||||
idc = 16189;
|
||||
x = 0;
|
||||
y = H_PART(1.1);
|
||||
w = W_PART(26);
|
||||
h = H_PART(5.9);
|
||||
};
|
||||
class Title2: Title1 {
|
||||
idc = -1;
|
||||
text = "Teleport Group";
|
||||
toolTip = "Teleports all units in group";
|
||||
y = H_PART(7.1);
|
||||
w = W_PART(10);
|
||||
};
|
||||
class Value2: RscCheckBox {
|
||||
idc = 16188;
|
||||
x = W_PART(10.1);
|
||||
y = H_PART(7.1);
|
||||
w = W_PART(1);
|
||||
h = H_PART(1);
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
class ButtonOK: ButtonOK {};
|
||||
class ButtonCancel: ButtonCancel {};
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
class GVAR(cargoAttribute): RscControlsGroupNoScrollbars {
|
||||
onSetFocus = QUOTE(_this call FUNC(ui_vehCargo));
|
||||
idc = 80085;
|
||||
|
Loading…
Reference in New Issue
Block a user