Survivalcraft API 1.8.2.3 v1.8.2.3
Survivalcraft 2.4
载入中...
搜索中...
未找到
NagScreen.cs
浏览该文件的文档.
1using System.Xml.Linq;
2using Engine;
3using Engine.Input;
4
5namespace Game {
6 public class NagScreen : Screen {
7 public NagScreen() {
8 XElement node = ContentManager.Get<XElement>("Screens/NagScreen");
9 LoadContents(this, node);
10 }
11
12 public override void Enter(object[] parameters) {
14 Children.Find<Widget>("Quit").IsVisible = true;
15 Children.Find<Widget>("QuitLabel_Wp81").IsVisible = false;
16 Children.Find<Widget>("QuitLabel_Win81").IsVisible = false;
17 }
18
19 public override void Leave() {
21 }
22
23 public override void Update() {
24 if (Children.Find<ButtonWidget>("Buy").IsClicked) {
26 ScreensManager.SwitchScreen("MainMenu");
27 }
28 if (Children.Find<ButtonWidget>("Quit").IsClicked
29 || Input.Back) {
30 Window.Close();
31 }
32 }
33 }
34}
static bool BackButtonQuitsApp
static void Close()
readonly WidgetsList Children
static object Get(Type type, string name)
override void Enter(object[] parameters)
override void Leave()
override void Update()
static void SwitchScreen(string name, params object[] parameters)
virtual bool IsVisible
virtual void LoadContents(object eventsTarget, XElement node)