private void htmlView1_OnCommand(object sender, SokoSolve.UI.Controls.Web.UIBrowserEvent e) { if (e.Command == new Uri("app://Controller/Done")) { Close(); } }
private void htmlView_OnCommand(object sender, SokoSolve.UI.Controls.Web.UIBrowserEvent e) { if (e.Command == new Uri("app://Library")) { Form.InitLibrary(this.Current.Library); Form.Mode = FormMain.Modes.Library; return; } if (e.Command == new Uri("app://Controller/Home")) { InitHTML(); return; } if (e.Command == new Uri("app://Controller/Back")) { InitHTML(); return; } if (e.Command == new Uri("app://HTML/About.html")) { htmlView.Navigate(FileManager.getContent("$html\\About.html")); return; } if (e.Command == new Uri("app://HTML/ReleaseNotes.html")) { htmlView.Navigate(FileManager.getContent("$html\\ReleaseNotes.html")); return; } if (e.Command == new Uri("app://HTML/HowToPlay.html")) { htmlView.Navigate(FileManager.getContent("$html\\HowToPlay.html")); return; } if (e.Command.ToString().StartsWith("app://puzzle/")) { Form.StartGame(Current, Current.MasterMap, FormMain.Modes.Welcome); return; } if (e.Command == new Uri("app://Profile")) { FormProfileSettings settings = new FormProfileSettings(); settings.ShowDialog(); InitHTML(); return; } }
/// <summary> /// Initalise the library, this is essentially the set method for <see cref="CurrentLibrary"/> /// </summary> /// <param name="current"></param> public void InitLibrary(SokoSolve.Core.Model.Library current) { using (CodeTimer timer = new CodeTimer("Library.InitLibray(...)")) { explorer.Clear(); controller.Current = current; explorer.SyncDomain(new ItemLibrary(controller.Current)); explorer.SyncUI(); explorer.TreeView.ExpandAll(); } }
private void htmlView_OnCommand(object sender, SokoSolve.UI.Controls.Web.UIBrowserEvent e) { FormMain main = FindForm() as FormMain; if (main == null) return; if (e.Command.ToString().ToLower() == "app://controller/done") { main.Mode = FormMain.Modes.Library; e.Completed = true; return; } if (e.Command.ToString().ToLower() == "app://controller/home") { Navigate(firstURL); e.Completed = true; return; } }
private void htmlViewStats_OnCommand(object sender, SokoSolve.UI.Controls.Web.UIBrowserEvent e) { string NodeID = e.Command.ToString().Remove(0, "app://node/".Length); e.Completed = true; SelectNode(NodeID); }
/// <summary> /// Init the library, but do not navigate to it /// </summary> /// <param name="Current"></param> public void InitLibrary(SokoSolve.Core.Model.Library Current) { ProfileController.Current.LibraryLastPuzzle = Current.FileName; libControl.InitLibrary(Current); }
public void SyncPositions(SokoSolve.Core.Game.Game.MoveResult r, Direction push) { if (r == SokoSolve.Core.Game.Game.MoveResult.Undo) { Init(); return; } if (r == SokoSolve.Core.Game.Game.MoveResult.ValidPush || r == SokoSolve.Core.Game.Game.MoveResult.ValidPushGoal || r == SokoSolve.Core.Game.Game.MoveResult.ValidPushWin) { // Change the pushed crate location VectorInt oldCratePos = Logic.Current.Player; // Note: The crate is now in the wrong place Crate crate = crates.First(x => GetPosition(x.Element) == oldCratePos); SetPosition(crate.Element, oldCratePos.Offset(push)); } Grid.SetColumn(player, Logic.Current.Player.X); Grid.SetRow(player, Logic.Current.Player.Y); }
public void InitLibrary(SokoSolve.Core.Model.Library current) { controller.Current = current; explorer.SyncDomain(new ItemLibrary(controller.Current)); explorer.SyncUI(); }