Esempio n. 1
0
 public MenuItem(string txt, Screen screenLink, LinkedEvent evLink)
 {
     enabled = true;
     text = txt;
     linksTo = screenLink;
     if (evLink != null)
     {
         eventLink = new InputEventHandler(evLink);
     }
     else
     {
         eventLink = null;
     }
 }
Esempio n. 2
0
 public static SimpleUI InitUI()
 {
     FontSurface fnt = FontSurface.BitmapMonospace("Resources" + "/" + "monkey.png", new Size(6, 14));
     Screen initialActionChoices = new Screen("Act!", new List<MenuItem>()),
         attackChoices = new Screen("Attack!", new List<MenuItem>());
     MenuItem moveItem = new MenuItem("Move", null, Demo.OnKeyDown_SelectMove, Demo.HighlightMove),
         attackItem = new MenuItem("Attack", attackChoices, null),
         waitItem = new MenuItem("Wait", null, null, Demo.waitAction),
         lookItem = new MenuItem("Look", null, Demo.OnKeyDown_LookAround);
     initialActionChoices.menu.Add(moveItem);
     initialActionChoices.menu.Add(attackItem);
     initialActionChoices.menu.Add(waitItem);
     initialActionChoices.menu.Add(lookItem);
     attackChoices.previousScreen = initialActionChoices;
     //attackChoices.menu.Add(new MenuItem("Scorch", null, Demo.OnKeyDown_SelectSkill));
     SimpleUI sui = new SimpleUI(initialActionChoices, fnt);
     sui.allScreens.Add("Act", initialActionChoices);
     sui.allScreens.Add("Attack", attackChoices);
     sui.allMenuItems.Add(moveItem);
     sui.allMenuItems.Add(attackItem);
     sui.allMenuItems.Add(waitItem);
     sui.allMenuItems.Add(lookItem);
     return sui;
 }
Esempio n. 3
0
 public SimpleUI(Screen s, FontSurface fnt)
 {
     initialScreen = s;
     //   previousScreen = s.Clone();
     currentScreen = s;
     allScreens = new Dictionary<String, Screen>() { { s.title, s } };
     allMenuItems = new List<MenuItem>(s.menu);
     font = fnt;
 }
Esempio n. 4
0
 public static void NavigateBackward(Screen s)
 {
     // currentUI.initialScreen = currentUI.currentScreen.Clone();
     // currentUI.previousScreen = currentUI.currentScreen.Clone();
     currentUI.currentScreen = s.previousScreen;
 }