Merge pull request #5953 from acemod/arsenal-main-menu

add ace arsenal button to main menu
This commit is contained in:
commy2 2017-12-27 11:39:54 +01:00 committed by GitHub
commit 37e42debc0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
21 changed files with 628 additions and 5 deletions

View File

@ -0,0 +1,36 @@
class RscStandardDisplay;
class RscDisplayMain: RscStandardDisplay {
class controls {
class GroupSingleplayer: RscControlsGroupNoScrollbars {
class Controls;
};
class GroupTutorials: GroupSingleplayer {
h = "(6 * 1.5) * (pixelH * pixelGrid * 2)";
class Controls: Controls {
class Bootcamp;
class VRTraining;
class Arsenal;
class GVAR(mission): Arsenal {
idc = -1;
text = CSTRING(Mission);
tooltip = CSTRING(Mission_tooltip);
y = "(3 * 1.5) * (pixelH * pixelGrid * 2) + (pixelH)";
onbuttonclick = QUOTE(playMission [ARR_2('','PATHTOF(missions\Arsenal.VR)')]);
animTextureNormal = QPATHTOF(data\buttonMissionMainMenu_ca.paa)
animTextureDisabled = QPATHTOF(data\buttonMissionMainMenu_ca.paa)
animTextureOver = QPATHTOF(data\buttonMissionMainMenuHover_ca.paa)
animTextureFocused = QPATHTOF(data\buttonMissionMainMenuHover_ca.paa)
animTexturePressed = QPATHTOF(data\buttonMissionMainMenu_ca.paa)
animTextureDefault = QPATHTOF(data\buttonMissionMainMenu_ca.paa)
};
class FieldManual: Bootcamp {
y = "(4 * 1.5) * (pixelH * pixelGrid * 2) + (pixelH)";
};
class CommunityGuides: Bootcamp {
y = "(5 * 1.5) * (pixelH * pixelGrid * 2) + (pixelH)";
};
};
};
};
};

View File

@ -37,4 +37,5 @@ class Cfg3DEN {
};
#include "ui\RscAttributes.hpp"
#include "CfgEventHandlers.hpp"
#include "CfgEventHandlers.hpp"
#include "RscDisplayMain.hpp"

Binary file not shown.

Binary file not shown.

View File

@ -18,6 +18,7 @@
#define IDC_totalWeightText 801
#define IDC_message 9
#define IDC_menuBar 10
#define IDC_menuBarClose 1001
#define IDC_infoBox 11
#define IDC_infoBackground 1101
#define IDC_infoName 1102
@ -329,4 +330,4 @@ _buttonCurrentMag2Ctrl ctrlCommit FADE_DELAY;\
_contentPanelCtrl lnbSetPicture [[_newRow, 6], getText (configFile >> "cfgWeapons" >> ((_loadout select 4) select 0) >> "picture")];\
_contentPanelCtrl lnbSetPicture [[_newRow, 7], getText (configFile >> "cfgVehicles" >> ((_loadout select 5) select 0) >> "picture")];\
_contentPanelCtrl lnbSetPicture [[_newRow, 8], getText (configFile >> "cfgWeapons" >> (_loadout select 6) >> "picture")];\
_contentPanelCtrl lnbSetPicture [[_newRow, 9], getText (configFile >> "cfgGlasses" >> (_loadout select 7) >> "picture")];
_contentPanelCtrl lnbSetPicture [[_newRow, 9], getText (configFile >> "cfgGlasses" >> (_loadout select 7) >> "picture")];

View File

@ -0,0 +1,11 @@
class Extended_PreInit_EventHandlers {
class ADDON {
init = QUOTE(call compile preprocessFileLineNumbers 'XEH_preInit.sqf');
};
};
class Extended_PostInit_EventHandlers {
class ADDON {
init = QUOTE(call compile preprocessFileLineNumbers 'XEH_postInit.sqf');
};
};

View File

@ -0,0 +1,113 @@
#include "script_component.hpp"
#include "\z\ace\addons\arsenal\defines.hpp"
#include "\a3\ui_f\hpp\defineDIKCodes.inc"
enableSaving [false, false];
cba_diagnostic_projectileMaxLines = 10;
[QGVAR(displayOpened), {
private _player = player;
// player pose
[{
switch (true) do {
case (primaryWeapon _this != ""): {
_this switchMove "amovpercmstpslowwrfldnon";
};
case (handgunWeapon _this != ""): {
_this switchMove "amovpercmstpslowwpstdnon";
};
default {
_this switchMove "amovpercmstpsnonwnondnon";
};
};
}, _player] call CBA_fnc_execNextFrame;
// hide everything except the player
{
_x enableSimulation false;
_x hideObject true;
} forEach (allMissionObjects "" - [_player]);
_player call CBA_fnc_removeUnitTrackProjectiles;
_player setFatigue 0;
// Esc to close mission
{
private _display = findDisplay IDD_ace_arsenal;
_display displayAddEventHandler ["KeyDown", {
params ["_display", "_key", "_shift"];
if (_key isEqualTo DIK_ESCAPE && {!_shift}) then {
[_display] spawn {
disableSerialization;
params ["_display"];
private _return = [
localize "str_sure",
localize "str_a3_rscdisplaymain_buttonexit",
true, false,
_display, false, true
] call BIS_fnc_GUImessage;
if (_return) then {
profileNamespace setVariable [QGVAR(missionLastLoadout), getUnitLoadout player];
_display closeDisplay 2;
findDisplay 46 closeDisplay 0;
};
};
true
};
}];
private _buttonClose = _display displayCtrl IDC_menuBarClose;
_buttonClose ctrlSetText localize "str_a3_rscdisplayarsenal_buttonok";
} call CBA_fnc_execNextFrame;
}] call CBA_fnc_addEventHandler;
[QGVAR(displayClosed), {
private _player = player;
// unhide everthing
{
_x enableSimulation true;
_x hideObject false;
} forEach allMissionObjects "";
// update VR unit gear
{
private _unit = _x;
removeVest _unit;
_unit addVest vest _player;
removeBackpack _unit;
_unit addBackpack backpack _player;
removeHeadgear _unit;
_unit addHeadgear headgear _player;
removeGoggles _unit;
_unit addGoggles goggles _player;
removeAllWeapons _unit;
_unit addWeapon primaryWeapon _player;
{
_unit addPrimaryWeaponItem _x;
} forEach primaryWeaponItems _player;
_unit addWeapon secondaryWeapon _player;
{
_unit addSecondaryWeaponItem _x;
} forEach secondaryWeaponItems _player;
_unit addWeapon handgunWeapon _player;
{
_unit addHandgunItem _x;
} forEach handgunItems _player;
} forEach (entities [["B_Soldier_VR_F", "O_Soldier_VR_F", "I_Soldier_VR_F"], [], true]);
_player call CBA_fnc_addUnitTrackProjectiles;
}] call CBA_fnc_addEventHandler;

View File

@ -0,0 +1,4 @@
#include "script_component.hpp"
PREP(onPause);
PREP(createTarget);

View File

@ -0,0 +1,17 @@
#include "script_component.hpp"
dev = "commy2";
author = ECSTRING(common,ACETeam);
onLoadName = CSTRING(Mission);
overviewText = CSTRING(Mission_overview);
overviewPicture = "logo_ca.paa";
briefing = 0;
debriefing = 0;
enableDebugConsoleSP = 1;
doneKeys[] = {"BIS_Arsenal.Map_VR_done"};
onPauseScript[] = {QFUNC(onPause)};
#include "CfgEventHandlers.hpp"

View File

@ -0,0 +1,66 @@
#include "script_component.hpp"
params ["_type", "_position", ["_group", grpNull], "_varName"];
private _player = player;
if (isNull _group) then {
_group = creategroup east;
};
private _target = _group createUnit [_type, [10,10,0], [], 0, "NONE"];
if (isNil "_varName") then {
_varName = _target call BIS_fnc_netId;
};
_target setPos _position;
_target setDir (_position getDir _player);
_target doWatch position _player;
_target addRating -10e10;
_target setUnitPos "UP";
_target setBehaviour "CARELESS";
_target setCombatMode "BLUE";
_target setSpeedMode "LIMITED";
_target disableAI "TARGET";
_target disableAI "AUTOTARGET";
_target allowFleeing 0;
_target setSpeaker "BASE";
[{
params ["_target", "_time"];
if (speaker _target == "BASE") exitWith {time > _time};
_target setSpeaker "BASE";
false
}, {}, [_target, time + 1]] call CBA_fnc_waitUntilAndExecute;
_player reveal [_target, 4];
_target addVest vest _player;
_target addBackpack backpack _player;
_target addHeadgear headgear _player;
_target addGoggles goggles _player;
_target addWeapon primaryWeapon _player;
_target addWeapon secondaryWeapon _player;
_target addWeapon handgunWeapon _player;
_target setVehicleVarName _varName;
missionNamespace setvariable [_varName, _target];
_target switchMove "amovpercmstpslowwrfldnon";
_target setVariable ["origin", _position];
_target addEventHandler ["killed", {
params ["_target"];
private _position = _target getVariable ["origin", position _target];
private _varName = vehicleVarName _target;
[_target, true] spawn BIS_fnc_VREffectKilled;
[{isNull (_this select 0)}, {
(_this select 1) call FUNC(createTarget);
}, [_target, [typeOf _target, _position, group _target, _varName]]] call CBA_fnc_waitUntilAndExecute;
}];
_target call BIS_fnc_VRHitpart;
_target

View File

@ -0,0 +1,16 @@
#include "script_component.hpp"
params ["_display"];
private _ctrlButtonAbort = _display displayCtrl 104;
_ctrlButtonAbort ctrlSetText localize LSTRING(Mission);
_ctrlButtonAbort ctrlSetTooltip localize LSTRING(ReturnToArsenal);
_ctrlButtonAbort ctrlSetEventHandler ["ButtonClick", {
params ["_control"];
ctrlParent _control closeDisplay 2;
{[player, player, true] call FUNC(openBox)} call CBA_fnc_execNextFrame;
true
} call EFUNC(common,codeToString)];
true

View File

@ -0,0 +1,175 @@
#include "script_component.hpp"
params ["_unit"];
private _loadout = profileNamespace getVariable QGVAR(missionLastLoadout);
if (!isNil "_loadout") then {
_unit setUnitLoadout _loadout;
};
_unit allowDamage false;
//--- Static targets in various distance
{
private _position = _unit getRelPos [_x, _forEachIndex];
["O_Soldier_VR_F", _position] call FUNC(createTarget);
} forEach [10, 20, 30, 40, 50, 100, 500, 1000, 2000];
//--- Target line
private _position = _unit getRelPos [20, -90];
for "_i" from 0 to 5 do {
private _position = _position vectorAdd [0, -3 + _i, 0];
["O_Soldier_VR_F", _position] call FUNC(createTarget);
};
//--- Target cluster
_position = _unit getRelPos [20, 90];
for "_i" from 0 to 8 do {
private _index = floor (_i / 3);
private _position = _position vectorAdd [_index * 1.5, 1.5 + (_i % 3), 0];
private _target = ["O_Soldier_VR_F", _position] call FUNC(createTarget);
_target switchMove (["aidlpercmstpslowwrfldnon", "aidlpknlmstpslowwrfldnon_ai", "aidlppnemstpsraswrfldnon_ai"] select _index);
_target setUnitPos (["UP", "MIDDLE", "DOWN"] select _index);
};
//--- Target patrol
private _group = createGroup east;
{
private _position = _unit getRelPos [10, _x];
private _waypoint = _group addWaypoint [_position, 0];
if (_forEachIndex == 4) then {
_waypoint setWaypointType "CYCLE";
};
} forEach [0, 90, 180, 270, 0];
_position = _unit getRelPos [10, 180];
for "_i" from 0 to 1 do {
private _target = ["O_Soldier_VR_F", _position] call FUNC(createTarget);
[_target] join _group;
_target stop false;
_target enableAI "MOVE";
_target setSpeedMode "LIMITED";
};
//--- Armored vehicles
private _vehicles = [];
private _step = 15;
_position = [position _unit select 0,(position _unit select 1) + 30,0];
{
private _row = _forEachIndex;
private _rowCount = (count _x - 1) * 0.5;
{
private _position = _position vectorAdd [(-_rowCount + _forEachIndex) * _step, _row * _step, 0];
private _vehicle = createVehicle [_x, _position, [], 0, "NONE"];
_vehicle setPos _position;
_vehicle setDir 180;
_vehicle setVelocity [0,0,-1];
_vehicle call BIS_fnc_VRHitpart;
private _marker = _vehicle call BIS_fnc_boundingBoxMarker;
_marker setMarkerColor "ColorOrange";
_vehicles pushBack _vehicle;
} forEach _x;
} forEach [[
"Land_VR_Target_MRAP_01_F",
"Land_VR_Target_APC_Wheeled_01_F",
"Land_VR_Target_MBT_01_cannon_F"
], [
"Land_VR_Target_MRAP_01_F",
"Land_VR_Target_APC_Wheeled_01_F",
"Land_VR_Target_MBT_01_cannon_F"
]];
_vehicles spawn {
waituntil {
private _allDisabled = true;
{
_hitAlive = _x getVariable ["bis_fnc_VRHitParts_hitalive", []];
_allDisabled = _allDisabled && ({!_x} count _hitAlive >= 2);
sleep 0.1;
} forEach _this;
_allDisabled
};
setStatValue ["MarkMassVirtualDestruction", 1];
};
//--- Cover objects
private _coverObjects = [
"Land_VR_CoverObject_01_kneel_F",
"Land_VR_CoverObject_01_kneelHigh_F",
"Land_VR_CoverObject_01_kneelLow_F",
"Land_VR_CoverObject_01_stand_F",
"Land_VR_CoverObject_01_standHigh_F"
];
for "_i" from 5 to 11 do {
private _direction = 180 + _i * 45;
private _position = _unit getRelPos [(abs sin _direction + abs cos _direction) * 3, _direction];
private _block = createVehicle [_coverObjects select (_i % count _coverObjects), _position, [], 0, "NONE"];
_block setPos _position;
};
//--- Starting point
private _square = createVehicle ["VR_Area_01_square_1x1_grey_F", position _unit, [], 0, "NONE"];
_square setPosASL getPosASL _unit;
private _marker = createMarker [QGVAR(start), getPosWorld _unit];
_marker setMarkerType "mil_start";
//--- Open Arsenal
[_unit, true, false] call FUNC(initBox);
[{!isNull findDisplay 46}, {
[_this, _this, true] call FUNC(openBox);
}, _unit] call CBA_fnc_waitUntilAndExecute;
//--- Salute
_unit addEventHandler ["AnimChanged", {
params ["_unit", "_anim"];
_anim = _anim splitString "_";
if ("salute" in _anim) then {
{
_x playAction "salute";
} forEach ((_unit nearObjects ["CAManBase", 10]) - [_unit]);
};
}];
["#(argb,8,8,3)color(0,0,0,1)", false, nil, 0.1, [0,0.5]] spawn BIS_fnc_textTiles;
//--- Target markers
private _markers = [];
{
private _marker = createMarker [vehicleVarName _x, position _x];
_marker setMarkerType "mil_dot";
_marker setMarkerColor "ColorOrange";
_markers pushBack _marker;
} forEach (allMissionObjects "CAManBase" - [_unit]);
_markers spawn {
while {true} do {
{
private _target = missionNamespace getVariable _x;
_x setMarkerPos position _target;
} forEach _this;
sleep 0.1;
};
};

Binary file not shown.

View File

@ -0,0 +1,163 @@
version=12;
class Mission
{
addOns[]=
{
"A3_Map_VR",
"A3_Characters_F_BLUFOR",
"a3_characters_f_beta",
"a3_characters_f"
};
addOnsAuto[]=
{
"A3_Characters_F_BLUFOR",
"a3_characters_f",
"A3_Map_VR"
};
randomSeed=5486937;
class Intel
{
briefingName="@STR_A3_Arsenal";
startWeather=0;
startWind=0.099999994;
startWaves=0.099999994;
forecastWeather=0;
forecastWind=0.099999994;
forecastWaves=0.099999994;
forecastLightnings=0.099999994;
year=2035;
month=2;
day=24;
hour=12;
minute=0;
startFogDecay=0.0049999999;
forecastFogDecay=0.0049999999;
};
class Groups
{
items=1;
class Item0
{
side="CIV";
class Vehicles
{
items=1;
class Item0
{
position[]={4256,5,4192};
azimut=180;
id=0;
side="CIV";
vehicle="C_man_1";
player="PLAYER COMMANDER";
leader=1;
skill=0.60000002;
};
};
};
};
class Sensors
{
items=1;
class Item0
{
position[]={4271.2827,5,4170.251};
a=0;
b=0;
interruptable=1;
age="UNKNOWN";
expCond="cheat1";
expActiv="endmission ""end1""";
class Effects
{
};
};
};
};
class Intro
{
addOns[]=
{
"A3_Map_VR"
};
addOnsAuto[]=
{
"A3_Map_VR"
};
randomSeed=12455686;
class Intel
{
timeOfChanges=1800.0002;
startWeather=0;
startWind=0.1;
startWaves=0.1;
forecastWeather=0;
forecastWind=0.1;
forecastWaves=0.1;
forecastLightnings=0.1;
year=2035;
day=28;
hour=13;
minute=37;
startFogDecay=0.0049999999;
forecastFogDecay=0.0049999999;
};
};
class OutroWin
{
addOns[]=
{
"A3_Map_VR"
};
addOnsAuto[]=
{
"A3_Map_VR"
};
randomSeed=9312504;
class Intel
{
timeOfChanges=1800.0002;
startWeather=0;
startWind=0.1;
startWaves=0.1;
forecastWeather=0;
forecastWind=0.1;
forecastWaves=0.1;
forecastLightnings=0.1;
year=2035;
day=28;
hour=13;
minute=37;
startFogDecay=0.0049999999;
forecastFogDecay=0.0049999999;
};
};
class OutroLoose
{
addOns[]=
{
"A3_Map_VR"
};
addOnsAuto[]=
{
"A3_Map_VR"
};
randomSeed=15192082;
class Intel
{
timeOfChanges=1800.0002;
startWeather=0;
startWind=0.1;
startWaves=0.1;
forecastWeather=0;
forecastWind=0.1;
forecastWaves=0.1;
forecastLightnings=0.1;
year=2035;
day=28;
hour=13;
minute=37;
startFogDecay=0.0049999999;
forecastFogDecay=0.0049999999;
};
};

View File

@ -0,0 +1,3 @@
#include "\z\ace\addons\arsenal\script_component.hpp"
#define PREP(var) FUNC(var) = compileFinal preprocessFileLineNumbers format ["fnc_%1.sqf", QUOTE(var)]

View File

@ -394,6 +394,7 @@
<Key ID="STR_ACE_Arsenal_settingCategory">
<English>ACE Arsenal</English>
<French>ACE Arsenal</French>
<German>ACE-Arsenal</German>
<Polish>ACE Arsenał</Polish>
<Japanese>ACE 武器庫</Japanese>
<Italian>Arsenale ACE</Italian>
@ -429,7 +430,7 @@
<Key ID="STR_ACE_Arsenal_CantOpenDisplay">
<English>Unable to open ACE arsenal</English>
<French>Impossible d'ouvrir ACE arsenal</French>
<German>Kann ACE Arsenal nicht anzeigen</German>
<German>Kann ACE-Arsenal nicht anzeigen</German>
<Italian>Impossibile aprire l'arsenale ACE</Italian>
<Japanese>ACE 武器庫を開けません</Japanese>
</Key>
@ -445,5 +446,21 @@
<English>No loadouts to import.</English>
<French>Aucun loadout à importer.</French>
</Key>
<Key ID="STR_ACE_Arsenal_Mission">
<English>ACE Arsenal</English>
<German>ACE-Arsenal</German>
</Key>
<Key ID="STR_ACE_Arsenal_ReturnToArsenal">
<English>Return to ACE Arsenal.</English>
<German>Zurück zum ACE-Arsenal.</German>
</Key>
<Key ID="STR_ACE_Arsenal_Mission_tooltip">
<English>Use ACE Arsenal to try out different weapons and equipment.</English>
<German>Verwende ACE-Arsenal und sieh dir verschiedene Waffen und Ausrüstung an und probiere sie aus.</German>
</Key>
<Key ID="STR_ACE_Arsenal_Mission_overview">
<English>Try weapons and equipment and create your own loadouts.</English>
<German>Probiere verschiedene Waffen und Ausrüstung aus und stelle dir eigene Ausrüstungsprofile zusammen.</German>
</Key>
</Package>
</Project>

View File

@ -203,7 +203,7 @@ class GVAR(display) {
onButtonClick = QUOTE([ctrlparent (_this select 0)] call FUNC(buttonImport));
};
class buttonClose: ctrlButtonClose {
idc = -1;
idc = IDC_menuBarClose;
colorBackground[] = {0,0,0,0.8};
x = QUOTE(5 * WIDTH_GAP + 4 * WIDTH_SINGLE);
y = QUOTE(0);

View File

@ -269,7 +269,7 @@
</Key>
<Key ID="STR_ACE_Hearing_autoAddEarplugsToUnits_Description">
<English>Add the `ACE_EarPlugs` item to all units that have loud weapons. Can disable if using custom loadouts.</English>
<German>Fügt die "ACE_EarPlugs" zu allen Einheiten mit lauten Waffen hinzu. Wird deaktiviert wenn eine eigene Inventarkonfiguration vorgenommen wurde.</German>
<German>Fügt die "ACE_EarPlugs" zu allen Einheiten mit lauten Waffen hinzu. Wird deaktiviert wenn eigene Ausrüstungsprofile verwendet werden.</German>
<Polish>Dodaje `ACE_EarPlugs` - stopery - do wszystkich jednostek, które posiadają głośną broń. Można wyłaczyć w przypadku korzystania z niestandardowych loadoutów.</Polish>
<Russian>Добавляет предмет `ACE_EarPlugs` всем юнитам, которые имеют громкое оружие. Можно отключить при ручной настройке снаряжения.</Russian>
<Portuguese>Adicionar o item `ACE_EarPlugs` a todas as unidades que tenham armas barulhentas. Pode ser desabilitado com carregamentos customizados.</Portuguese>

Binary file not shown.