mirror of
https://github.com/osukey/osukey.git
synced 2025-06-07 20:37:57 +09:00
Define local current bindable to bind value change instead
This commit is contained in:
parent
f013a1e37f
commit
51e7b9950e
@ -26,6 +26,8 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
|
|
||||||
public static LocalisableString ListingString => LayoutStrings.HeaderChangelogIndex;
|
public static LocalisableString ListingString => LayoutStrings.HeaderChangelogIndex;
|
||||||
|
|
||||||
|
private readonly Bindable<APIUpdateStream> currentStream = new Bindable<APIUpdateStream>();
|
||||||
|
|
||||||
private Box streamsBackground;
|
private Box streamsBackground;
|
||||||
|
|
||||||
public ChangelogHeader()
|
public ChangelogHeader()
|
||||||
@ -38,6 +40,12 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
};
|
};
|
||||||
|
|
||||||
Build.ValueChanged += showBuild;
|
Build.ValueChanged += showBuild;
|
||||||
|
|
||||||
|
currentStream.ValueChanged += e =>
|
||||||
|
{
|
||||||
|
if (e.NewValue?.LatestBuild != null && !e.NewValue.Equals(Build.Value?.UpdateStream))
|
||||||
|
Build.Value = e.NewValue.LatestBuild;
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
[BackgroundDependencyLoader]
|
[BackgroundDependencyLoader]
|
||||||
@ -61,7 +69,7 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
Current.Value = ListingString;
|
Current.Value = ListingString;
|
||||||
Streams.Current.Value = null;
|
currentStream.Value = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -88,17 +96,11 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
Horizontal = 65,
|
Horizontal = 65,
|
||||||
Vertical = 20
|
Vertical = 20
|
||||||
},
|
},
|
||||||
Child = Streams = new ChangelogUpdateStreamControl()
|
Child = Streams = new ChangelogUpdateStreamControl { Current = currentStream },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
Streams.Current.ValueChanged += e =>
|
|
||||||
{
|
|
||||||
if (e.NewValue?.LatestBuild != null && !e.NewValue.Equals(Build.Value?.UpdateStream))
|
|
||||||
Build.Value = e.NewValue.LatestBuild;
|
|
||||||
};
|
|
||||||
|
|
||||||
return content;
|
return content;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -115,7 +117,7 @@ namespace osu.Game.Overlays.Changelog
|
|||||||
if (Build.Value == null)
|
if (Build.Value == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Streams.Current.Value = Streams.Items.FirstOrDefault(s => s.Name == Build.Value.UpdateStream.Name);
|
currentStream.Value = Streams.Items.FirstOrDefault(s => s.Name == Build.Value.UpdateStream.Name);
|
||||||
}
|
}
|
||||||
|
|
||||||
private class ChangelogHeaderTitle : OverlayTitle
|
private class ChangelogHeaderTitle : OverlayTitle
|
||||||
|
Loading…
x
Reference in New Issue
Block a user