-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Addition of Gear_Selection Module #159
Open
ghost
wants to merge
6
commits into
dklollol:dev
Choose a base branch
from
unknown repository
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
4cf8acc
updated AI drivers module
BlackHawkPL 4ba611f
Update init.sqf
BlackHawkPL 049f8f7
Update init.sqf
BlackHawkPL 628872a
Added Gear_selection
b3912f9
Addition of spectator miltilingual skills
e6a71a6
Fix start_text at top of hour
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,9 +19,9 @@ if (!isDedicated) then { | |
}; | ||
}; | ||
}; | ||
|
||
eg_keyHandler_display_hidden = false; | ||
|
||
eg_keyHandler = { | ||
params ["_control", "_code", "_shift", "_control", "_alt"]; | ||
|
||
|
@@ -34,25 +34,25 @@ if (!isDedicated) then { | |
call _action; | ||
}; | ||
}; | ||
|
||
if (_code == 35 && !_shift && _control && !_alt) then { | ||
if (!eg_keyHandler_display_hidden) then { | ||
(findDisplay 60492) closedisplay 1; | ||
eg_keyHandler_display_hidden = true; | ||
}; | ||
}; | ||
}; | ||
|
||
eg_keyHandler2 = { | ||
params ["_control", "_code", "_shift", "_control", "_alt"]; | ||
|
||
if (_code == 35 && !_shift && _control && !_alt && | ||
!isNil "eg_keyHandler_display_hidden" && | ||
{eg_keyHandler_display_hidden} | ||
) then { | ||
([] call BIS_fnc_displayMission) createDisplay "RscDisplayEGSpectator"; | ||
eg_keyHandler_display_hidden = false; | ||
|
||
eg_keyHandle = (findDisplay 60492) displayAddEventHandler ["keyDown", {call eg_keyHandler;}]; | ||
if (killcam_active) then { | ||
killcam_keyHandle = (findDisplay 60492) displayAddEventHandler ["keyDown", {call killcam_toggleFnc;}]; | ||
|
@@ -82,10 +82,10 @@ if (!isDedicated) then { | |
params ["_unit", "_killer"]; | ||
//let's remove hit EH, it's not needed | ||
player removeEventHandler ["hit", killcam_hitHandle]; | ||
|
||
//we check if player didn't kill himself or died for unknown reasons | ||
if (vehicle _killer != vehicle _unit && _killer != objNull) then { | ||
|
||
//this is the standard case (killed EH got triggered by getting shot) | ||
DEBUG_MSG("using killed EH") | ||
killcam_unit_pos = ASLtoAGL eyePos _unit; | ||
|
@@ -98,7 +98,7 @@ if (!isDedicated) then { | |
if (!isNil "killcam_LastHit") then { | ||
_last_hit_info = killcam_LastHit; | ||
}; | ||
|
||
//hit info retrieved, now we check if it's not caused by fall damage etc. | ||
//also we won't use info that's over 10 seconds old | ||
private _damage = 0.5; | ||
|
@@ -141,9 +141,9 @@ if (!isDedicated) then { | |
sleep 1.01-_damage; | ||
0 fadeSound 0; | ||
sleep 0.89+_damage; | ||
|
||
["<t color='#FF0000'>YOU ARE DEAD</t>", 0, 0.4, 2, 0.5, 0, 1000] spawn BIS_fnc_dynamicText; | ||
|
||
sleep 3; | ||
cutText ["\n","BLACK IN", 5]; | ||
["FW_death", 0, false] call ace_common_fnc_setHearingCapability; | ||
|
@@ -164,7 +164,7 @@ if (!isDedicated) then { | |
call BIS_fnc_VRFadeIn; | ||
}; | ||
}; | ||
|
||
}]; | ||
//END OF KILLED EH/////////// | ||
|
||
|
@@ -197,14 +197,14 @@ if (!isDedicated) then { | |
|
||
cutText [format ['%1 %2', FW_RespawnTickets, _text], 'PLAIN DOWN']; | ||
player setVariable ["FW_Body", player, true]; | ||
} | ||
} | ||
else { | ||
|
||
player setVariable ["FW_Dead", true, true]; //Tells the framework the player is dead | ||
|
||
player remoteExecCall ["hideObject", 0]; | ||
player remoteExecCall ["hideObjectGlobal", 2]; | ||
|
||
player setCaptive true; | ||
player allowdamage false; | ||
[player, true] remoteExec ["setCaptive", 2]; | ||
|
@@ -221,10 +221,23 @@ if (!isDedicated) then { | |
player setVariable ["FW_Spectating", true, true]; | ||
[true] call acre_api_fnc_setSpectator; | ||
|
||
//If babel is enabled, allowed spectator to hear all languages present in mission. | ||
if (!isNil "FW_enable_babel" && FW_enable_babel) then { | ||
_missionLanguages = []; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. add |
||
{ | ||
{ | ||
if (!(_x in _missionLanguages)) then { | ||
_missionLanguages pushback _x; | ||
}; | ||
} foreach _x; | ||
} forEach FW_languages_babel; | ||
_missionLanguages call acre_api_fnc_babelSetSpokenLanguages; | ||
}; | ||
|
||
//we set default pos in case all methods fail and we end up with 0,0,0 | ||
_pos = [2000, 2000, 100]; | ||
_dir = 0; | ||
|
||
//our function is called from Respawned EH, so select 1 is player's body | ||
_body = (_this select 1); | ||
if (getMarkerColor eg_spectator_marker == "") then { | ||
|
@@ -236,12 +249,12 @@ if (!isDedicated) then { | |
} else { | ||
_pos = getmarkerpos eg_spectator_marker; | ||
}; | ||
|
||
if (abs(_pos select 0) < 2 && abs(_pos select 1) < 2) then { | ||
_pos = [2000, 2000, 100]; | ||
}; | ||
|
||
["Initialize", | ||
["Initialize", | ||
[ | ||
player, | ||
eg_Whitelisted_Sides, | ||
|
@@ -255,18 +268,18 @@ if (!isDedicated) then { | |
eg_Show_Entities_And_Locations_Lists | ||
] | ||
] call BIS_fnc_EGSpectator; | ||
|
||
_cam = missionNamespace getVariable ["BIS_EGSpectatorCamera_camera", objNull]; | ||
|
||
if (_cam != objNull) then { | ||
|
||
[{!isNull (findDisplay 60492)}, { | ||
DEBUG_MSG("Display loaded, attaching key EH") | ||
eg_keyHandle = (findDisplay 60492) displayAddEventHandler ["keyDown", {call eg_keyHandler;}]; | ||
eg_keyHandle = (findDisplay 46) displayAddEventHandler ["keyDown", {call eg_keyHandler2}]; | ||
}, []] call CBA_fnc_waitUntilAndExecute; | ||
|
||
|
||
if (!killcam_active) then { | ||
//we move 2 meters back so player's body is visible | ||
_pos = ([_pos, -2, _dir] call BIS_fnc_relPos); | ||
|
@@ -275,23 +288,23 @@ if (!isDedicated) then { | |
} | ||
else { | ||
missionNamespace setVariable ["killcam_toggle", false]; | ||
|
||
//this cool piece of code adds key handler to spectator display | ||
//it takes some time for display to create, so we have to delay it. | ||
[{!isNull (findDisplay 60492)}, { | ||
DEBUG_MSG("Display loaded, attaching key EH") | ||
killcam_keyHandle = (findDisplay 60492) displayAddEventHandler ["keyDown", {call killcam_toggleFnc;}]; | ||
}, []] call CBA_fnc_waitUntilAndExecute; | ||
|
||
if (!isNull killcam_killer) then { | ||
DEBUG_MSG("found valid killer") | ||
_pos = ([_pos, -1.8, ([(_this select 1), killcam_killer] call BIS_fnc_dirTo)] call BIS_fnc_relPos); | ||
_cam setposATL _pos; | ||
|
||
//vector magic | ||
_temp1 = ([getposASL _cam, getposASL killcam_killer] call BIS_fnc_vectorFromXToY); | ||
_temp = (_temp1 call CBA_fnc_vect2Polar); | ||
|
||
//we check if camera is not pointing up, just in case | ||
if (abs(_temp select 2) > 89) then {_temp set [2, 0]}; | ||
[_cam, [_temp select 1, _temp select 2]] call BIS_fnc_setObjectRotation; | ||
|
@@ -301,15 +314,15 @@ if (!isDedicated) then { | |
_cam setposATL _pos; | ||
_cam setDir _dir; | ||
}; | ||
|
||
killcam_texture = "a3\ui_f\data\gui\cfg\debriefing\enddeath_ca.paa"; | ||
|
||
killcam_drawHandle = addMissionEventHandler ["Draw3D", { | ||
//we don't draw hud unless we toggle it by keypress | ||
if (missionNamespace getVariable ["killcam_toggle", false]) then { | ||
|
||
if ((killcam_killer_pos select 0) != 0) then { | ||
|
||
_u = killcam_unit_pos; | ||
_k = killcam_killer_pos; | ||
if ((_u distance _k) < 2000) then { | ||
|
@@ -331,16 +344,16 @@ if (!isDedicated) then { | |
}];//draw EH | ||
};//killcam (not) active | ||
};//checking camera | ||
|
||
_killcam_msg = ""; | ||
if (killcam_active) then { | ||
_killcam_msg = "Press <t color='#FFA500'>K</t> to toggle indicator showing location where you were killed from.<br/>"; | ||
}; | ||
_text = format ["<t size='0.5' color='#ffffff'>%1 | ||
Close spectator HUD by pressing <t color='#FFA500'>CTRL+H</t>.<br/> | ||
Press <t color='#FFA500'>SHIFT</t>, <t color='#FFA500'>ALT</t> or <t color='#FFA500'>SHIFT+ALT</t> to modify camera speed. Open map by pressing <t color='#FFA500'>M</t> and click anywhere to move camera to that postion.<br/> | ||
Press <t color='#FFA500'>SHIFT</t>, <t color='#FFA500'>ALT</t> or <t color='#FFA500'>SHIFT+ALT</t> to modify camera speed. Open map by pressing <t color='#FFA500'>M</t> and click anywhere to move camera to that postion.<br/> | ||
Spectator controls can be customized in game <t color='#FFA500'>options->controls->'Camera'</t> tab.</t>", _killcam_msg]; | ||
|
||
[_text, 0.55, 0.8, 20, 1] spawn BIS_fnc_dynamicText; | ||
|
||
[] spawn { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#ifdef framework | ||
|
||
#include "scripts\init.sqf" | ||
|
||
#endif | ||
|
||
#ifdef description_functions | ||
|
||
#include "scripts\functions.hpp" | ||
|
||
#endif | ||
|
||
#ifdef description | ||
|
||
#include "scripts\defines.hpp" | ||
#include "scripts\gearSelection.hpp" | ||
|
||
#endif |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add lazy evaluation (wrap
FW_enable_babel
in {}) to avoid game trying to retrieve value even if it's nil.