private void load(GamebosuConfigManager config) { Rate.BindValueChanged(updateValue, true); lockClockRate = config?.GetBindable <bool>(GamebosuSetting.LockClockRate); lockClockRate?.BindValueChanged(e => State.Value = e.NewValue ? Visibility.Hidden : Visibility.Visible, true); }
protected override IReadOnlyDependencyContainer CreateChildDependencies(IReadOnlyDependencyContainer parent) { var container = new DependencyContainer(parent); container.Cache(ruleset); container.Cache(config = (GamebosuConfigManager)container.Get <IRulesetConfigCache>().GetConfigFor(ruleset)); container.Get <TextureStore>().AddStore(new TextureLoaderStore(ruleset.CreateResourceStore())); container.Cache(new RomStore(container.Get <Storage>())); return(container); }
private void load(GamebosuConfigManager config) { Children = new Drawable[] { container = new Container { Anchor = Anchor.Centre, Origin = Anchor.Centre, AutoSizeAxes = Axes.Both, Child = gameboy = new DrawableGameboy(cartridge) { Anchor = Anchor.Centre, Origin = Anchor.Centre, }, }, new ClockRateIndicatorControlReceptor { AdjustAction = (f) => indicator.AdjustRate(f), }, indicator = new ClockRateIndicator { Anchor = Anchor.BottomCentre, Origin = Anchor.BottomCentre, Margin = new MarginPadding { Bottom = 20 }, Alpha = 0, } }; gameboyScale = config.GetBindable <float>(GamebosuSetting.GameboyScale); gameboyScale.BindValueChanged(e => container.ScaleTo(e.NewValue, 400, Easing.OutQuint), true); config.BindWith(GamebosuSetting.ClockRate, indicator.Rate); gameboy.Start(); }