Add "Reset all cleared" editor command to parkour goal

qteditor
Sven Eberhardt 2016-08-07 00:28:53 -04:00
parent e471a98fe3
commit 596d2a5e68
4 changed files with 22 additions and 0 deletions

View File

@ -240,6 +240,13 @@ public func IsActiveForTeam(int team)
return false;
}
// Reset all cleared status
public func ResetCleared()
{
cleared_by_plr = [];
return true;
}
/*-- Checkpoint activity --*/

View File

@ -209,6 +209,15 @@ public func AddTeamClearedCP(int team, object cp)
return;
}
private func ResetAllClearedCP()
{
plr_list = [];
team_list = [];
for (var cp in FindObjects(Find_ID(ParkourCheckpoint)))
cp->ResetCleared();
return true;
}
/*-- Goal interface --*/
@ -724,6 +733,8 @@ public func Definition(def)
def.EditorProps.on_checkpoint_cleared = new UserAction.Prop { Name="$OnCleared$", EditorHelp="$OnClearedHelp$", SaveAsCall="SetOnCheckpointCleared" };
def.EditorProps.on_checkpoint_first_cleared = new UserAction.Prop { Name="$OnFirstCleared$", EditorHelp="$OnFirstClearedHelp$", SaveAsCall="SetOnCheckpointFirstCleared" };
def.EditorProps.on_respawn = new UserAction.Prop { Name="$OnRespawn$", EditorHelp="$OnRespawnHelp$", SaveAsCall="SetOnRespawn" };
if (!def.EditorActions) def.EditorActions = {};
def.EditorActions.reset_all_cleared = { Name="$ResetAllCleared$", EditorHelp="$ResetAllClearedHelp$", Command="ResetAllClearedCP()" };
}

View File

@ -37,3 +37,5 @@ OnFirstCleared=Aktion: CP erstmals erreicht
OnFirstClearedHelp=Aktion, die ausgefuehrt wird, wenn der erste Spieler einen Checkpoint freischaltet.
OnRespawn=Aktion: Respawn
OnRespawnHelp=Aktion, die ausgefuehrt wird, wenn ein Spieler an einem Checkpoint neu startet.
ResetAllCleared=Checkpoint reset
ResetAllClearedHelp=Setzt die Checkpoints fuer alle Spieler auf 'nicht erreicht' zurueck.

View File

@ -37,3 +37,5 @@ OnFirstCleared=Action: CP reached first
OnFirstClearedHelp=Action to be executed when the first player clears a checkpoint.
OnRespawn=Aktion: Respawn
OnRespawnHelp=Action to be executed when a player respawns at a checkpoint.
ResetAllCleared=Checkpoint reset
ResetAllClearedHelp=Resets the clear status of all checkpoints for all players.