-
Notifications
You must be signed in to change notification settings - Fork 309
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
Marker update #642
Open
DomT602
wants to merge
9
commits into
AsYetUntitled:master
Choose a base branch
from
DomT602:markerUpdate
base: master
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
Marker update #642
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
398d639
Marker update
DomT602 55efd7d
Merge branch 'master' into markerUpdate
DomT602 6aa1d57
Update file description
DomT602 32f44d7
Merge branch 'master' into markerUpdate
DomT602 c21754c
Merge branch 'master' into markerUpdate
DomT602 fb6fd42
Merge branch 'master' into markerUpdate
DomT602 8f16136
Consistency across forEach's
DomT602 4a74ce6
Suggestions implemented
DomT602 ccafeec
Sleep
DomT602 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
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 |
---|---|---|
@@ -1,25 +1,25 @@ | ||
/* | ||
File: fn_checkMap.sqf | ||
Author: DomT602 | ||
Description: | ||
Checks if the map is being opened or closed, then puts markers according to side. | ||
*/ | ||
|
||
params [ | ||
["_mapOpen",false,[false]] | ||
]; | ||
|
||
if (_mapOpen) then { | ||
switch playerSide do { | ||
case west: {[] spawn life_fnc_copMarkers}; | ||
case independent: {[] spawn life_fnc_medicMarkers}; | ||
case civilian: {[] spawn life_fnc_civMarkers}; | ||
}; | ||
|
||
if (life_markers && {!(life_markers_active)}) then { | ||
[true] spawn life_fnc_adminMarkers; | ||
}; | ||
|
||
} else { | ||
life_markers_active = false; | ||
}; | ||
/* | ||
File: fn_checkMap.sqf | ||
Author: DomT602 | ||
Description: | ||
Checks if the map is being opened or closed, then puts markers according to side. | ||
*/ | ||
params [ | ||
["_mapOpen",false,[false]] | ||
]; | ||
if (_mapOpen) then { | ||
switch playerSide do { | ||
case west: {[] spawn life_fnc_copMarkers}; | ||
case independent: {[] spawn life_fnc_medicMarkers}; | ||
case civilian: {[] spawn life_fnc_civMarkers}; | ||
}; | ||
if (life_markers && {!life_markers_active}) then { | ||
[true] spawn life_fnc_adminMarkers; | ||
}; | ||
} else { | ||
life_markers_active = false; | ||
}; |
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 |
---|---|---|
@@ -1,61 +1,51 @@ | ||
/* | ||
File: fn_medicMarkers.sqf | ||
Author: Bryan "Tonic" Boardwine | ||
|
||
Description: | ||
Marks downed players on the map when it's open. | ||
*/ | ||
private ["_markers","_units","_medics"]; | ||
_markers = []; | ||
_markersMedecin = []; | ||
_units = []; | ||
_medics = []; | ||
|
||
sleep 0.25; | ||
if (visibleMap) then { | ||
{if (side _x isEqualTo independent) then {_medics pushBack _x;}} forEach playableUnits; //Fetch list of cops / blufor | ||
{ | ||
_name = _x getVariable "name"; | ||
_down = _x getVariable ["Revive",false]; | ||
if (!isNil "_name" && !_down) then { | ||
_units pushBack _x; | ||
}; | ||
} forEach allDeadMen; | ||
|
||
{ | ||
if !(_x isEqualTo player) then { | ||
_markerss = createMarkerLocal [format ["%1_marker",_x],visiblePosition _x]; | ||
_markerss setMarkerColorLocal "ColorIndependent"; | ||
_markerss setMarkerTypeLocal "Mil_dot"; | ||
_markerss setMarkerTextLocal format ["%1", _x getVariable ["realname",name _x]]; | ||
|
||
_markersMedecin pushBack [_markerss,_x]; | ||
}; | ||
} forEach _medics; | ||
|
||
//Loop through and create markers. | ||
{ | ||
_marker = createMarkerLocal [format ["%1_dead_marker",_x],visiblePosition _x]; | ||
_marker setMarkerColorLocal "ColorRed"; | ||
_marker setMarkerTypeLocal "loc_Hospital"; | ||
_marker setMarkerTextLocal format ["%1",(_x getVariable ["name","Unknown Player"])]; | ||
_markers pushBack _marker; | ||
} forEach _units; | ||
|
||
while {visibleMap} do { | ||
{ | ||
private ["_unit"]; | ||
_unit = _x select 1; | ||
if (!isNil "_unit" && !isNull _unit) then { | ||
(_x select 0) setMarkerPosLocal (visiblePosition _unit); | ||
}; | ||
} forEach _markersMedecin; | ||
if (!visibleMap) exitWith {}; | ||
sleep 0.02; | ||
}; | ||
{deleteMarkerLocal (_x select 0);} forEach _markersMedecin; | ||
_markersMedecin = []; | ||
_medics = []; | ||
waitUntil {!visibleMap}; | ||
{deleteMarkerLocal _x;} forEach _markers; | ||
}; | ||
/* | ||
File: fn_medicMarkers.sqf | ||
Author: Bryan "Tonic" Boardwine | ||
|
||
Description: | ||
Marks downed players on the map when it's open. | ||
*/ | ||
private _deadMarkers = []; | ||
private _medicMarkers = []; | ||
|
||
{ | ||
private _marker = createMarkerLocal [format ["%1_marker",netID _x],getPosATL _x]; | ||
_marker setMarkerColorLocal "ColorIndependent"; | ||
_marker setMarkerTypeLocal "Mil_dot"; | ||
_marker setMarkerTextLocal format ["%1", _x getVariable ["realname",name _x]]; | ||
_medicMarkers pushBack [_marker,_x]; | ||
} forEach ((units independent) - [player]); | ||
|
||
{ | ||
private _name = _x getVariable "name"; | ||
DomT602 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
private _down = _x getVariable ["Revive",false]; | ||
if (!isNil "_name" && !_down) then { | ||
private _marker = createMarkerLocal [format ["%1_dead_marker",_x],getPosATL _x]; | ||
DomT602 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
_marker setMarkerColorLocal "ColorRed"; | ||
_marker setMarkerTypeLocal "loc_Hospital"; | ||
_marker setMarkerTextLocal format ["%1",_name]; | ||
_deadMarkers pushBack _marker; | ||
DomT602 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
}; | ||
} forEach allDeadMen; | ||
|
||
while {visibleMap} do { | ||
{ | ||
_x params [ | ||
["_mark",""], | ||
["_unit",objNull] | ||
]; | ||
if !(isNull _unit) then { | ||
_mark setMarkerPosLocal (getPosATL _unit); | ||
}; | ||
} forEach _medicMarkers; | ||
DomT602 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
uiSleep 0.01; | ||
}; | ||
|
||
{ | ||
_x params [["_mark",""]]; | ||
deleteMarkerLocal _mark; | ||
} forEach _medicMarkers; | ||
|
||
{ | ||
deleteMarkerLocal _x; | ||
} forEach _deadMarkers; | ||
DomT602 marked this conversation as resolved.
Show resolved
Hide resolved
|
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.
but what if it is? what if someone dies/respawns? (same for previous file)
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.
Just avoids moving the marker to [0,0,0] until they've closed the map it seems.