forked from Mirrors/openclonk
Goal controller: Get short description only once.
parent
0732b7dc87
commit
0d22f58b52
|
@ -115,13 +115,14 @@ public func OnGoalUpdate(object goal)
|
|||
|
||||
var goal_picture_def = goal->~GetPictureDefinition() ?? goal->GetID();
|
||||
var goal_picture = goal->~GetPictureName() ?? goal->GetGraphics();
|
||||
var goal_short_description = goal->~GetShortDescription(GetOwner());
|
||||
|
||||
var update_req = goal_gui_menu.Symbol != goal_picture_def;
|
||||
|
||||
// Only update if something has changed.
|
||||
if (update_req || goal_gui_menu.GraphicsName != goal_picture || goal_gui_menu.text.Text != goal->~GetShortDescription(GetOwner()))
|
||||
if (update_req || goal_gui_menu.GraphicsName != goal_picture || goal_gui_menu.text.Text != goal_short_description)
|
||||
{
|
||||
goal_gui_menu.text.Text = goal->~GetShortDescription(GetOwner());
|
||||
goal_gui_menu.text.Text = goal_short_description;
|
||||
goal_gui_menu.Symbol = goal_picture_def;
|
||||
goal_gui_menu.GraphicsName = goal_picture;
|
||||
|
||||
|
|
Loading…
Reference in New Issue