Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/gui/session/messages.js
Show First 20 Lines • Show All 208 Lines • ▼ Show 20 Lines | addChatMessage({ | ||||
"phaseState": notification.phaseState | "phaseState": notification.phaseState | ||||
}); | }); | ||||
}, | }, | ||||
"dialog": function(notification, player) | "dialog": function(notification, player) | ||||
{ | { | ||||
if (player == Engine.GetPlayerID()) | if (player == Engine.GetPlayerID()) | ||||
openDialog(notification.dialogName, notification.data, player); | openDialog(notification.dialogName, notification.data, player); | ||||
}, | }, | ||||
"resetselectionpannel": function(notification, player) | |||||
{ | |||||
if (player != Engine.GetPlayerID()) | |||||
return; | |||||
g_Selection.rebuildSelection({}); | |||||
}, | |||||
"playercommand": function(notification, player) | "playercommand": function(notification, player) | ||||
elexis: dont name this according to what it should do, consider this to be an event that describes what… | |||||
Done Inline ActionsGood point, though I've simply removed this event and resetselectionpannel below in the latest diff. wraitii: Good point, though I've simply removed this event and `resetselectionpannel` below in the… | |||||
{ | { | ||||
// For observers, focus the camera on units commanded by the selected player | // For observers, focus the camera on units commanded by the selected player | ||||
Done Inline ActionsCould invert it and remove a line ? Stan: Could invert it and remove a line ? | |||||
if (!g_FollowPlayer || player != g_ViewedPlayer) | if (!g_FollowPlayer || player != g_ViewedPlayer) | ||||
return; | return; | ||||
let cmd = notification.cmd; | let cmd = notification.cmd; | ||||
// Ignore rallypoint commands of trained animals | // Ignore rallypoint commands of trained animals | ||||
let entState = cmd.entities && cmd.entities[0] && GetEntityState(cmd.entities[0]); | let entState = cmd.entities && cmd.entities[0] && GetEntityState(cmd.entities[0]); | ||||
if (g_ViewedPlayer != 0 && | if (g_ViewedPlayer != 0 && | ||||
▲ Show 20 Lines • Show All 329 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
dont name this according to what it should do, consider this to be an event that describes what happened.
then the GUI can decide what to do on that event, which may be more than updating the selection.
So it should be something like "entitytokenschanged" or so.
Also one only needs to rebuild the selection if an enity was affected.