Added cse_sys_gestures source

This commit is contained in:
Thomas Kooi 2015-01-12 23:26:46 +01:00
parent 70c0e3c5e6
commit 1a9b572850
8 changed files with 341 additions and 0 deletions

View File

@ -0,0 +1,7 @@
class CfgAddons {
class PreloadAddons {
class cse_sys_gestures {
list[] = {"cse_sys_gestures"};
};
};
};

View File

@ -0,0 +1,8 @@
class CfgFunctions {
class CSE {
class Gestures {
file = "cse\cse_sys_gestures\functions";
class playGesture { recompile = 1; };
};
};
};

View File

@ -0,0 +1,29 @@
class CfgVehicles {
class Logic;
class Module_F: Logic {
class ArgumentsBaseUnits {
};
};
class cse_sys_gestures: Module_F {
scope = 2;
displayName = "Gestures [CSE]";
icon = "\cse\cse_main\data\cse_groups_module.paa";
category = "cseMisc";
function = "cse_fnc_initalizeModule_F";
functionPriority = 1;
isGlobal = 1;
isTriggerActivated = 0;
class Arguments {
class allowAIControl {
displayName = "Allow AI Control";
description = "Allow Group leaders to issue basic orders through gestures";
typeName = "BOOL";
defaultValue = true;
};
};
class ModuleDescription {
description = "Enables the CSE Gesture actions.";
sync[] = {};
};
};
};

View File

@ -0,0 +1,61 @@
#define MENU_KEYBINDING 1
#define ACTION_KEYBINDING 2
#define CLIENT_SETTING 3
class Combat_Space_Enhancement {
class cfgModules {
class cse_sys_gestures {
init = "call compile preprocessFile 'cse\cse_sys_gestures\init_sys_gestures.sqf';";
name = "Gestures";
/*class Configurations {
class playGesture_Freeze {
type = ACTION_KEYBINDING;
title = $STR_CSE_GESTURE_FREEZE_TOOLTIP;
description = $STR_CSE_GESTURE_FREEZE_TOOLTIP;
value[] = {0,0,0,0};
onPressed = "[player, 'gestureFreeze'] call cse_fnc_playGesture";
};
class playGesture_Follow {
type = ACTION_KEYBINDING;
title = $STR_CSE_GESTURE_FOLLOW_TOOLTIP;
description = $STR_CSE_GESTURE_FOLLOW_TOOLTIP;
value[] = {0,0,0,0};
onPressed = "[player, 'gestureFollow'] call cse_fnc_playGesture";
};
class playGesture_CEASEFIRE {
type = ACTION_KEYBINDING;
title = $STR_CSE_GESTURE_CEASEFIRE_TOOLTIP;
description = $STR_CSE_GESTURE_CEASEFIRE_TOOLTIP;
value[] = {0,0,0,0};
onPressed = "[player, 'gestureCeaseFire'] call cse_fnc_playGesture";
};
class playGesture_COVER {
type = ACTION_KEYBINDING;
title = $STR_CSE_GESTURE_COVER_TOOLTIP;
description = $STR_CSE_GESTURE_COVER_TOOLTIP;
value[] = {0,0,0,0};
onPressed = "[player, 'gestureCover'] call cse_fnc_playGesture";
};
class playGesture_Go {
type = ACTION_KEYBINDING;
title = $STR_CSE_GESTURE_GO_TOOLTIP;
description = $STR_CSE_GESTURE_GO_TOOLTIP;
value[] = {0,0,0,0};
onPressed = "[player, 'gestureGo'] call cse_fnc_playGesture";
};
class playGesture_Point {
type = ACTION_KEYBINDING;
title = $STR_CSE_GESTURE_POINT_TOOLTIP;
description = $STR_CSE_GESTURE_POINT_TOOLTIP;
value[] = {0,0,0,0};
onPressed = "[player, 'gesturePoint'] call cse_fnc_playGesture";
};
};*/
};
};
};

View File

@ -0,0 +1,17 @@
#define _ARMA_
class CfgPatches {
class cse_sys_gestures {
units[] = {};
weapons[] = {};
requiredVersion = 0.1;
requiredAddons[] = {"cse_f_eh","cse_main", "cse_gui"};
version = "0.10.0_rc";
author[] = {"Combat Space Enhancement"};
authorUrl = "http://csemod.com";
};
};
#include "CfgAddOns.h"
#include "CfgFunctions.h"
#include "CfgVehicles.h"
#include "Combat_Space_Enhancement.h"

View File

@ -0,0 +1,47 @@
/**
* fn_playGesture.sqf
* @Descr: Plays a gesture and executes orders for group AI, if setting has been enabled.
* @Author: Glowbal
*
* @Arguments: [unit OBJECT (The unit that plays the gesture), gesture STRING (Classname of the gesture animation being played)]
* @Return: void
* @PublicAPI: true
*/
private ["_unit", "_gesture", "_groupUnits"];
_unit = [_this, 0, objNull, [objNull]] call BIS_fnc_Param;
_gesture = [_this, 1, "", [""]] call BIS_fnc_Param;
_unit playactionnow _gesture;
_groupUnits = units group _unit;
if (leader (group _unit) == _unit && CSE_SYS_GESTURES_ALLOW_AI_CONTROL) then {
switch (_gesture) do {
case ("gestureCeaseFire"): {
};
case ("gestureCover"): {
};
case ("gestureFreeze"): {
{_x stop true;} count _groupUnits;
};
case ("gestureFollow"): {
{_x dofollow _unit;} count _groupUnits;
};
case ("gestureGo"): {
{_x stop false;} count _groupUnits;
};
case ("gesturePoint"): {
};
};
};
/*
_unit setvariable ["cse_playGesture_GRP", _gesture, true];
_handle = _this spawn {
uisleep 3;
if (((_this select 0) getvariable ["cse_playGesture_GRP", ""]) == (_this select 1)) then {
(_this select 0) setvariable ["cse_playGesture_GRP", nil, true];
};
};
*/

View File

@ -0,0 +1,66 @@
private ["_args", "_entries"];
_args = _this;
CSE_SYS_GESTURES_ALLOW_AI_CONTROL = false;
{
if (_x select 0 == "allowAIControl") then {
CSE_SYS_GESTURES_ALLOW_AI_CONTROL = (_x select 1);
};
}foreach _args;
waituntil {!isnil "cse_gui"};
cse_displayGestureActions_GroupMenu_GESTURES = {
[ _this select 3,
[
[localize "STR_CSE_GESTURE_FREEZE_SHORT", "cse\cse_sys_gestures\data\icons\icon_hand.paa", {closeDialog 0; [player, "gestureFreeze"] call cse_fnc_playGesture}, true, localize "STR_CSE_GESTURE_FREEZE_TOOLTIP"],
[localize "STR_CSE_GESTURE_FOLLOW_SHORT", "cse\cse_sys_gestures\data\icons\icon_hand.paa", {closeDialog 0; [player, "gestureFollow"] call cse_fnc_playGesture}, true, localize "STR_CSE_GESTURE_FOLLOW_TOOLTIP"],
[localize "STR_CSE_GESTURE_CEASEFIRE_SHORT", "cse\cse_sys_gestures\data\icons\icon_hand.paa", {closeDialog 0; [player, "gestureCeaseFire"] call cse_fnc_playGesture}, true, localize "STR_CSE_GESTURE_CEASEFIRE_TOOLTIP"],
[localize "STR_CSE_GESTURE_COVER_SHORT", "cse\cse_sys_gestures\data\icons\icon_hand.paa", {closeDialog 0; [player, "gestureCover"] call cse_fnc_playGesture}, true, localize "STR_CSE_GESTURE_COVER_TOOLTIP"],
[localize "STR_CSE_GESTURE_GO_SHORT", "cse\cse_sys_gestures\data\icons\icon_hand.paa", {closeDialog 0; [player, "gestureGo"] call cse_fnc_playGesture}, true, localize "STR_CSE_GESTURE_GO_TOOLTIP"],
[localize "STR_CSE_GESTURE_POINT_SHORT", "cse\cse_sys_gestures\data\icons\icon_hand.paa", {closeDialog 0; [player, "gesturePoint"] call cse_fnc_playGesture}, true, localize "STR_CSE_GESTURE_POINT_TOOLTIP"]
],
_this select 1, CSE_SELECTED_RADIAL_OPTION_N_GUI, true
] call cse_fnc_openRadialSecondRing_GUI;
};
_entries = [
[localize "STR_CSE_GESTURE_GESTUREACTION_SHORT", {([player] call cse_fnc_canInteract)}, "cse\cse_sys_gestures\data\icons\icon_hand.paa", cse_displayGestureActions_GroupMenu_GESTURES, localize "STR_CSE_GESTURE_GESTUREACTION_TOOLTIP"]
];
["ActionMenu","group_actions", _entries ] call cse_fnc_addMultipleEntriesToRadialCategory_F;
_playCondition = {
(((_this select 0) getvariable ["cse_playGesture_GRP", ""]) != "");
};
_playOnDraw = {
_var = (_this select 0) getvariable ["cse_playGesture_GRP", ""];
switch (_gesture) do {
case ("gestureCeaseFire"): {
};
case ("gestureCover"): {
};
case ("gestureFreeze"): {
};
case ("gestureFollow"): {
};
case ("gestureGo"): {
};
case ("gesturePoint"): {
};
};
["cse\cse_sys_gestures\data\icons\icon_hand.paa", [1,1,1,1]];
};
if (["cse_sys_tags"] call cse_fnc_isModLoaded_f) then {
[_playCondition, _playOnDraw, 1] call cse_fnc_registerIconSet_TAGS;
};

View File

@ -0,0 +1,106 @@
<?xml version="1.0" encoding="utf-8" ?>
<Project name="Combat Space Enhancement">
<Package name="cse_sys_gestures">
<Container ID="GestureActions">
<Key ID="STR_CSE_GESTURE_FREEZE_SHORT">
<Original>Freeze!</Original>
<English>Freeze!</English>
<German>Halt!</German>
<Polish>Stój!</Polish>
<Spanish>Alto¡</Spanish>
</Key>
<Key ID="STR_CSE_GESTURE_FOLLOW_SHORT">
<Original>Follow!</Original>
<English>Follow!</English>
<German>Mitkommen!</German>
<Polish>Za mną!</Polish>
<Spanish>Seguidme¡</Spanish>
</Key>
<Key ID="STR_CSE_GESTURE_CEASEFIRE_SHORT">
<Original>Cease Fire!</Original>
<English>Cease Fire!</English>
<German>Feuer einstellen!</German>
<Polish>Wstrzymać ogień!</Polish>
<Spanish>Alto el fuego¡</Spanish>
</Key>
<Key ID="STR_CSE_GESTURE_COVER_SHORT">
<Original>Cover!</Original>
<English>Cover!</English>
<German>In Deckung!</German>
<Polish>Do osłon!</Polish>
<Spanish>A cobertura¡</Spanish>
</Key>
<Key ID="STR_CSE_GESTURE_GO_SHORT">
<Original>Go!</Original>
<English>Go!</English>
<German>Los, Los, Los!</German>
<Polish>Naprzód!</Polish>
<Spanish>Vamos¡</Spanish>
</Key>
<Key ID="STR_CSE_GESTURE_POINT_SHORT">
<Original>Point!</Original>
<English>Point!</English>
<German>Fingerzeig.</German>
<Polish>Wskaż palcem!</Polish>
<Spanish>Señalar</Spanish>
</Key>
<Key ID="STR_CSE_GESTURE_FREEZE_TOOLTIP">
<Original>Play Gesture Freeze</Original>
<English>Play Gesture Freeze</English>
<German>Halt! Geste ausführen</German>
<Polish>Pokazuje gest Stój!</Polish>
<Spanish>Ejecutar gesto Alto¡</Spanish>
</Key>
<Key ID="STR_CSE_GESTURE_FOLLOW_TOOLTIP">
<Original>Play Gesture Follow</Original>
<English>Play Gesture Follow</English>
<German>Mitkommen! Geste ausführen</German>
<Polish>Pokazuje gest Za mną!</Polish>
<Spanish>Ejecutar gesto Seguidme¡</Spanish>
</Key>
<Key ID="STR_CSE_GESTURE_CEASEFIRE_TOOLTIP">
<Original>Play Gesture Cease Fire</Original>
<English>Play Gesture Cease Fire</English>
<German>Feuer einstellen! Geste ausführen</German>
<Polish>Pokazuje gest Wstrzymać ogień!</Polish>
<Spanish>Ejecutar gesto Alto el fuego¡</Spanish>
</Key>
<Key ID="STR_CSE_GESTURE_COVER_TOOLTIP">
<Original>Play Gesture Cover</Original>
<English>Play Gesture Cover</English>
<German>In Deckung! Geste ausführen</German>
<Polish>Pokazuje gest Do osłon!</Polish>
<Spanish>Ejecutar gesto A cobertura¡¡</Spanish>
</Key>
<Key ID="STR_CSE_GESTURE_GO_TOOLTIP">
<Original>Play Gesture Go</Original>
<English>Play Gesture Go</English>
<German>Los, Los, Los! Geste ausführen</German>
<Polish>Pokazuje gest Naprzód!</Polish>
<Spanish>Ejecutar gesto Vamos¡</Spanish>
</Key>
<Key ID="STR_CSE_GESTURE_POINT_TOOLTIP">
<Original>Play Gesture Point</Original>
<English>Play Gesture Point</English>
<German>Zeigt nach Vorne.</German>
<Polish>Pokazuje gest Wskaż palcem!</Polish>
<Spanish>Ejecutar gesto Señalar¡</Spanish>
</Key>
<Key ID="STR_CSE_GESTURE_GESTUREACTION_SHORT">
<Original>Gestures</Original>
<English>Gestures</English>
<German>Gesten</German>
<Polish>Gesty</Polish>
<Spanish>Gestos</Spanish>
</Key>
<Key ID="STR_CSE_GESTURE_GESTUREACTION_TOOLTIP">
<Original>Use Gesture</Original>
<English>Use Gesture</English>
<German>Gesten ausführen</German>
<Polish>Pokaż gest</Polish>
<Spanish>Usar Gestos</Spanish>
</Key>
</Container>
</Package>
</Project>