Refactor checkbox
This commit is contained in:
@@ -70,7 +70,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
|
||||
var checkbox = widget.Get<CheckboxWidget>("OBJECTIVE_STATUS");
|
||||
checkbox.IsChecked = () => objective.State != ObjectiveState.Incomplete;
|
||||
checkbox.GetCheckType = () => objective.State == ObjectiveState.Completed ? "checked" : "crossed";
|
||||
checkbox.GetCheckmark = () => objective.State == ObjectiveState.Completed ? "tick" : "cross";
|
||||
checkbox.GetText = () => objective.Description;
|
||||
|
||||
parent.AddChild(widget);
|
||||
|
||||
@@ -34,8 +34,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
||||
var statusLabel = widget.Get<LabelWidget>("STATS_STATUS");
|
||||
|
||||
checkbox.IsChecked = () => player.WinState != WinState.Undefined;
|
||||
checkbox.GetCheckType = () => player.WinState == WinState.Won ?
|
||||
"checked" : "crossed";
|
||||
checkbox.GetCheckmark = () => player.WinState == WinState.Won ? "tick" : "cross";
|
||||
|
||||
if (player.HasObjectives)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user