public HUDMenu() { Menu = Engine.Singleton.Menu; //Options2Choose = new List<TextLabel>(); Options2Choose = new TextLabel[6]; Header = Engine.Singleton.Labeler.NewTextLabel("Primitive", 0.1f, new ColourValue(0.7f, 0.4f, 0), new ColourValue(1, 1.0f, 0.6f), 2); Header.SetPosition(0.4f, 0.3f); MouseCursor = Engine.Singleton.Labeler.NewSimpleQuad("Kursor", 0.0f, 0.0f, Engine.Singleton.GetFloatFromPxWidth(32), Engine.Singleton.GetFloatFromPxHeight(32), new ColourValue(1, 1, 1), 4); BGQuad = Engine.Singleton.Labeler.NewSimpleQuad("QuadMaterial", 0.35f, 0.25f, 0.3f, 0.5f, ColourValue.Black, 1); for (int i = 0; i < 6; i++) { Options2Choose[i] = Engine.Singleton.Labeler.NewTextLabel("Primitive", 0.03f, new ColourValue(0.7f, 0.4f, 0), new ColourValue(1, 1.0f, 0.6f), 2); } }
public void Update() { //for (int i = 0; i < Options2Choose.Count; i++) //Engine.Singleton.Labeler.DestroyTextLabel(Options2Choose[i], 2); Menu = Engine.Singleton.Menu; //Options2Choose.Clear(); for (int i = 0; i < Menu.SubMenus.Count; i++) { SubMenu SB = Menu.SubMenus[i]; if (SB.Selected) { Options2Choose[i].SetColor(new ColourValue(1.0f, 0, 0.2f), new ColourValue(1, 1.0f, 0.6f)); } else if (SB.Enabled) { Options2Choose[i].SetColor(new ColourValue(0.7f, 0.4f, 0), new ColourValue(1, 1.0f, 0.6f)); } else { Options2Choose[i].SetColor(new ColourValue(0.22f, 0.22f, 0.22f), new ColourValue(1, 1.0f, 0.6f)); } Options2Choose[i].Caption = SB.MenuName; } Header.Caption = Menu.MenuName; for (int i = 0; i < 6; i++) { if (i < Menu.SubMenus.Count) { Options2Choose[i].IsVisible = true; } else { Options2Choose[i].IsVisible = false; } } for (int i = 0; i < 6; i++) { TextLabel TL = Options2Choose[i]; TL.SetPosition(0.4f, 0.45f + i * 0.05f); } MouseCursor.SetDimensions(Engine.Singleton.GetFloatFromPxWidth(Engine.Singleton.Mouse.MouseState.X.abs), Engine.Singleton.GetFloatFromPxHeight(Engine.Singleton.Mouse.MouseState.Y.abs), Engine.Singleton.GetFloatFromPxWidth(32), Engine.Singleton.GetFloatFromPxHeight(32)); }
public void Update() { //for (int i = 0; i < Options2Choose.Count; i++) //Engine.Singleton.Labeler.DestroyTextLabel(Options2Choose[i], 2); Menu = Engine.Singleton.Menu; //Options2Choose.Clear(); for (int i = 0; i < Menu.SubMenus.Count; i++) { SubMenu SB = Menu.SubMenus[i]; if (SB.Selected) Options2Choose[i].SetColor(new ColourValue(1.0f, 0, 0.2f), new ColourValue(1, 1.0f, 0.6f)); else if (SB.Enabled) Options2Choose[i].SetColor(new ColourValue(0.7f, 0.4f, 0), new ColourValue(1, 1.0f, 0.6f)); else Options2Choose[i].SetColor(new ColourValue(0.22f, 0.22f, 0.22f), new ColourValue(1, 1.0f, 0.6f)); Options2Choose[i].Caption = SB.MenuName; } Header.Caption = Menu.MenuName; for (int i = 0; i < 6; i++) { if (i < Menu.SubMenus.Count) Options2Choose[i].IsVisible = true; else Options2Choose[i].IsVisible = false; } for (int i = 0; i < 6; i++) { TextLabel TL = Options2Choose[i]; TL.SetPosition(0.4f, 0.45f + i * 0.05f); } MouseCursor.SetDimensions(Engine.Singleton.GetFloatFromPxWidth(Engine.Singleton.Mouse.MouseState.X.abs), Engine.Singleton.GetFloatFromPxHeight(Engine.Singleton.Mouse.MouseState.Y.abs), Engine.Singleton.GetFloatFromPxWidth(32), Engine.Singleton.GetFloatFromPxHeight(32)); }
static void Main(string[] args) { bool DebugMode = false; Engine.Singleton.Initialise(); //MENUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUu SubMenu MainMenu = new SubMenu(); SubMenu Continue = new SubMenu(); SubMenu NewGame = new SubMenu(); SubMenu LoadGame = new SubMenu(); SubMenu SaveGame = new SubMenu(); SubMenu Options = new SubMenu(); SubMenu Credits = new SubMenu(); SubMenu End = new SubMenu(); MainMenu.MenuName = "MENU"; MainMenu.AddSub(NewGame); MainMenu.AddSub(Continue); MainMenu.AddSub(LoadGame); MainMenu.AddSub(SaveGame); MainMenu.AddSub(Options); //MainMenu.AddSub(Credits); MainMenu.AddSub(End); Continue.MenuName = "Kontynuuj"; Continue.Ending = true; Continue.Enabled = false; Continue.Parent = MainMenu; Continue.AddAction(ContinueGame); NewGame.Ending = true; NewGame.MenuName = "Nowa gra"; NewGame.Parent = MainMenu; NewGame.AddAction(New); LoadGame.MenuName = "Laduj gre"; LoadGame.Enabled = false; LoadGame.Parent = MainMenu; SaveGame.MenuName = "Zapisz gre"; SaveGame.Enabled = false; SaveGame.Parent = MainMenu; Options.MenuName = "Opcje"; Options.Enabled = false; Options.Parent = MainMenu; Credits.MenuName = "Autorzy"; Credits.Enabled = false; Credits.Parent = MainMenu; End.MenuName = "Koniec"; End.Enabled = true; End.Parent = MainMenu; End.Ending = true; //CZASEM BYWA, ZE END NIE JEST ENDING .... POZDRO RABIS End.AddAction(Exit); Engine.Singleton.Menu = MainMenu; Engine.Singleton.HumanController.SwitchState(HumanController.HumanControllerState.MENU); //KONIEC MENUUUUUUUUUUUUUUUUUUUUUUUUUUUu Engine.Singleton.SoundManager.BGMPlaylist.Add("title.mp3"); Engine.Singleton.SoundManager.BGMPlaylist.Add("Folk Round.mp3"); Engine.Singleton.SoundManager.BGMPlaylist.Add("Achaidh Cheide.mp3"); Engine.Singleton.SoundManager.BGMPlaylist.Add("Thatched Villagers.mp3"); Engine.Singleton.SoundManager.PlayBGM(); Light light = Engine.Singleton.SceneManager.CreateLight(); light.Type = Light.LightTypes.LT_DIRECTIONAL; light.Direction = new Vector3(1, -3, 1).NormalisedCopy; light.DiffuseColour = new ColourValue(0.2f, 0.2f, 0.2f); //Engine.Singleton.SceneManager.AmbientLight = new ColourValue(0.24f, 0.30f, 0.24f); Engine.Singleton.SceneManager.ShadowTechnique = ShadowTechnique.SHADOWTYPE_STENCIL_MODULATIVE; Engine.Singleton.Mysz = Engine.Singleton.Mouse.MouseState; Character player = new Character(CharacterProfileManager.character); player.Position = new Vector3(-3.5f, 0, 1); player.Orientation = new Quaternion(new Radian(new Degree(90)), Vector3.UNIT_Y); player.Statistics = new Statistics(); player.Sword = (ItemSword)Items.I["sSword"]; player.GetSwordOrder = true; Engine.Singleton.ObjectManager.Add(player); Engine.Singleton.HumanController.Character = player; Engine.Singleton.CurrentLevel = new Level(); Engine.Singleton.CurrentLevel.WayPoints = new List <WayPoint>(); Engine.Singleton.CurrentLevel.LoadLevel("MenuLevel", "KarczmaNav", true); // MENU LVL Engine.Singleton.GameCamera.Character = player; Engine.Singleton.GameCamera.Distance = 7; Engine.Singleton.GameCamera.Angle = new Degree(33); String resourceGroupName = "debugger"; if (ResourceGroupManager.Singleton.ResourceGroupExists(resourceGroupName) == false) { ResourceGroupManager.Singleton.CreateResourceGroup(resourceGroupName); } // create material (colour) MaterialPtr moMaterial = Mogre.MaterialManager.Singleton.Create("line_material", resourceGroupName); moMaterial.ReceiveShadows = false; moMaterial.GetTechnique(0).SetLightingEnabled(true); moMaterial.GetTechnique(0).GetPass(0).SetDiffuse(0, 0, 1, 0); moMaterial.GetTechnique(0).GetPass(0).SetAmbient(0, 0, 1); moMaterial.GetTechnique(0).GetPass(0).SetSelfIllumination(0, 0, 1); moMaterial.Dispose(); SceneNode moNode = Engine.Singleton.SceneManager.RootSceneNode.CreateChildSceneNode("line_node"); ManualObject manOb = Engine.Singleton.SceneManager.CreateManualObject("line"); while (true) { Engine.Singleton.Update(); if (Engine.Singleton.Keyboard.IsKeyDown(MOIS.KeyCode.KC_ESCAPE) || Engine.Singleton.GameEnder) { break; } if (Engine.Singleton.IsKeyTyped(MOIS.KeyCode.KC_GRAVE)) { if (Engine.Singleton.HumanController.State == Gra.HumanController.HumanControllerState.TALK) { continue; } Engine.Singleton.Pause = !Engine.Singleton.Pause; } if (Engine.Singleton.IsKeyTyped(MOIS.KeyCode.KC_F3)) { DebugMode = !DebugMode; } if (DebugMode) { Engine.Singleton.NewtonDebugger.ShowDebugInformation(); } else { Engine.Singleton.NewtonDebugger.HideDebugInformation(); } /* * if (Engine.Singleton.IsKeyTyped(MOIS.KeyCode.KC_P)) * { * Engine.Singleton.CurrentLevel.navMesh.AStar(NPCManager.npc.Position, Engine.Singleton.HumanController.Character.Position); * if (Engine.Singleton.CurrentLevel.navMesh.TriPath.Count > 1) * { * Engine.Singleton.CurrentLevel.navMesh.GetPortals(); * NPCManager.npc.WalkPath = Engine.Singleton.CurrentLevel.navMesh.Funnel(); * * NPCManager.npc.FollowPathOrder = true; * } * } */ } Engine.Singleton.IngameConsole.Exit(); Engine.Singleton.Root.Dispose(); }
public void AddSub(SubMenu subMenu) { SubMenus.Add(subMenu); }