public static HudScene Create(int session) { Log.Debug("Scenes", "Creating language selection scene for {0}", session); var scene = new HudScene { Session = session, Name = NAME }; /*var background = SceneCommon.CreateBackground(); * var b = 0; * foreach (var bg in background) * { * scene[HUD_BG + b] = bg; * b++; * }*/ var hudChoose = new HudPanel( "Select your language", Colors.White, new Metric { Rectangle = new Rectangle(-256, -128, 512, 64), Origin = HudOrigin.Center }, true); scene[HUD_CHOOSE] = hudChoose; var langs = Enum.GetNames(typeof(Languages)); for (var i = 0; i < 6; i++) { var left = i % 2 == 0 ? -300 : 44; var lang = langs[i]; var langLabel = Lang.Ini.Configs[lang].Get("Name"); var langButton = new HudPanel( langLabel, Colors.White, new Metric { Rectangle = new Rectangle(left, 64 * (i / 2), 256, 32), Origin = HudOrigin.Center, }, true); langButton.Clickable = true; langButton.Clicked += (s, x, y) => { Log.Fine("Language Scene", "Session {0} has chosen {1}", s, lang); AWHT.Instance.GetUser(s).Language = (Languages)Enum.Parse(typeof(Languages), lang); scene.GotoScene(SceneTut1.Create(s)); }; scene[lang] = langButton; } return(scene); }
public static HudScene Create(int session) { Log.Debug("Scenes", "Creating tutorial 2 scene for {0}", session); var scene = new HudScene { Session = session, Name = NAME }; var user = AWHT.Instance.GetUser(session); var lang = user.Language; var hudTagline = new HudPanel( Lang.Get(lang, "Tut2a"), Colors.White, new Metric { Rectangle = new Rectangle(-512, 64, 1024, 64), Origin = HudOrigin.Top }, true); scene[HUD_TAGLINE] = hudTagline; var hudDiagramA = new HudPanel( new Texture { Name = "hud-tut2a.png" }, new Metric { Rectangle = new Rectangle(-300, 0, 256, 128), Origin = HudOrigin.Center }); scene["diagramA"] = hudDiagramA; scene[HUD_BTN_NEXT] = HudPanel.CreateNext(lang); scene[HUD_BTN_PREV] = HudPanel.CreatePrev(lang); scene[HUD_BTN_HIDE] = HudPanel.CreateHide(lang); scene[HUD_BTN_LANG] = HudPanel.CreateLanguage(); scene[HUD_BTN_NEXT].Clicked += (s, x, y) => { scene.GotoScene(SceneTut3.Create(s)); }; scene[HUD_BTN_PREV].Clicked += (s, x, y) => { scene.GotoScene(SceneTut1.Create(s)); }; scene[HUD_BTN_HIDE].Clicked += (s, x, y) => { scene.Minimize(HudOrigin.BottomLeft, 0, 0); }; scene[HUD_BTN_LANG].Clicked += (s, x, y) => { scene.GotoScene(SceneLanguage.Create(s)); }; scene.MinimizeHud = SceneCommon.CreateMinimizeButton(); return(scene); }
public static HudScene Create(int session) { Log.Debug("Scenes", "Creating intro scene for {0}", session); var scene = new HudScene { Session = session, Name = NAME }; var hudWelcome = new HudPanel( new Texture { Name = "hud-welcome.png" }, new Metric { Rectangle = new Rectangle(-256, -200, 512, 128), Origin = HudOrigin.Center }, true); hudWelcome.ShadowHud.Color = new AW.Color(0xA8, 0xC0, 0xFF); scene[HUD_WELCOME] = hudWelcome; var hudClickForHelp = new HudPanel( Lang.Core.Get("ClickForHelp").Replace('|', '\n'), Colors.White, new Metric { Rectangle = new Rectangle(-150, -50, 300, 200), Origin = HudOrigin.Center, }); var hudHelpBanner = new HudPanel( new Texture { Name = "clr_white" }, new Metric { Rectangle = new Rectangle(-150, -50, 300, 200), Origin = HudOrigin.Center }); hudHelpBanner.MainHud.Color = Colors.OrangeRed; hudClickForHelp.MainHud.Flags |= HudFlag.Highlight; hudClickForHelp.Clickable = true; hudClickForHelp.Clicked += (s, x, y) => { var user = AWHT.Instance.GetUser(s); if (user.Language != Languages.None) { scene.GotoScene(SceneTut1.Create(s)); } else { scene.GotoScene(SceneLanguage.Create(s)); } }; scene[HUD_CLICKFORHELP] = hudClickForHelp; scene[HUD_CLICKFORHELPBG] = hudHelpBanner; var hudClickToClose = new HudPanel( "X", new AW.Color(255, 255, 255), new Metric { Rectangle = new Rectangle(16, -64 - 16, 64, 64), Origin = HudOrigin.BottomLeft, }, true); hudClickToClose.Clickable = true; hudClickToClose.Clicked += (s, x, y) => { scene.Minimize(HudOrigin.BottomLeft, 0, 0); }; scene[HUD_CLICKTOCLOSE] = hudClickToClose; scene.MinimizeHud = SceneCommon.CreateMinimizeButton(); return(scene); }