void TextChanged(LauncherInputWidget widget) { bool changed = false; int index = Array.IndexOf <LauncherWidget>(widgets, widget); if (index < 3) { changed |= Parse(0, ref LauncherSkin.BackgroundCol); } else if (index < 6) { changed |= Parse(3, ref LauncherSkin.ButtonBorderCol); } else if (index < 9) { changed |= Parse(6, ref LauncherSkin.ButtonHighlightCol); } else if (index < 12) { changed |= Parse(9, ref LauncherSkin.ButtonForeCol); } else if (index < 15) { changed |= Parse(12, ref LauncherSkin.ButtonForeActiveCol); } if (!changed) { return; } game.MakeBackground(); Resize(); }
protected override void WidgetUnclicked(LauncherWidget widget) { LauncherInputWidget input = widget as LauncherInputWidget; if (input == null) { return; } input.Active = false; RedrawWidget(input); lastInput = null; game.Dirty = true; }
public override void Init() { base.Init(); view.Init(); widgets[view.defIndex].OnClick = (x, y) => ResetColours(); widgets[view.defIndex + 1].OnClick = (x, y) => game.SetScreen(new MainScreen(game)); SetupInputHandlers(); for (int i = 0; i < widgets.Length; i++) { LauncherInputWidget input = widgets[i] as LauncherInputWidget; if (input == null) { continue; } input.TextChanged = TextChanged; } Resize(); }
protected virtual void InputClick(int mouseX, int mouseY) { LauncherInputWidget input = (LauncherInputWidget)selectedWidget; using ( drawer ) { drawer.SetBitmap(game.Framebuffer); if (lastInput != null) { lastInput.Active = false; lastInput.Redraw(drawer); } input.Active = true; widgetOpenTime = DateTime.UtcNow; lastCaretFlash = false; input.SetCaretToCursor(mouseX, mouseY, drawer, inputFont); input.Redraw(drawer); } lastInput = input; game.Dirty = true; }