void EventToMenu(GameMenu.MenuObject obj) { MakeMenuState(); }
void EventMenuQuit(MenuObject obj) { Events.QuitApplication (); }
void EventMenuStart(GameMenu.MenuObject obj) { MakeRunGameState(); }
void EventMenuEditor(GameMenu.MenuObject obj) { MakeEditorState(); }
void EventEditorFileSelected(GameMenu.MenuObject obj) { MakeActualEditorState(((MenuText)obj).text); }
void EventRunFileSelected(GameMenu.MenuObject obj) { MakeActualRunGameState(((MenuText)obj).text); }
void EventSelected(MenuObject obj) { fileSelectedHandler (obj); }
void EventSave(MenuObject obj) { List<MenuObject > objs = new List<MenuObject> (); MenuTextEntry nameMenuTextEntry = new MenuTextEntry (42, Color.Black, name); nameMenuTextEntry.escapeHandler += EventNameEscape; nameMenuTextEntry.selectedHandler += EventNameSave; objs.Add (nameMenuTextEntry); nameMenu = new Menu (objs, MenuLayout.Vertical, 10, Constants.Constants.HEIGHT / 2); //nameMenu.selectChangeTime = 0.5f; }
void EventNameSave(MenuObject obj) { MenuTextEntry tE = (MenuTextEntry)obj; name = tE.text; MenuText t = (MenuText)menu.objects [menu.objects.Count - 1]; t.text = name; t.colourSelected = Color.Green; t.colourNotSelected = Color.Green; t.RenderText (); menu.GenerateWidth (); GenerateMenuBackground (); menu.lastSelectChange = -0.2f; nameMenu = null; map.ToXML (name, vecPlayer, enemies); }
void EventNameEscape(MenuObject obj) { nameMenu = null; }
void EventDelete(MenuObject obj) { try { File.Delete (Constants.Constants.GetResourcePath (name + ".xml")); } catch (Exception ex) { Console.WriteLine (ex.ToString ()); } backToMenuHandler (obj); }