public override void load() { base.load(); m_bakimg = Game.getInstance().Content.Load<Texture2D>("Images//Automagi//karta"); m_objects = new LinkedList<GameObject>(); //m_levelText = new Text(new Vector2(405, 80), "New Level:", "VerdanaBold", Color.White, false); //m_newLevelName = new TextField(new Vector2(400, 100), 200, 32, true, true, true, 20); string[] t_ext = { ".lvl" }; if (!Directory.Exists("Content//levels//")) { System.IO.Directory.CreateDirectory("Content//levels//"); } m_buttons = GuiListFactory.createListFromStringArray(Directory.GetFiles("Content//levels//"), t_ext, "pin"); m_buttons.ElementAt(0).setPosition(new Vector2(Game.getInstance().getResolution().X/3, Game.getInstance().getResolution().Y/1.9f)); m_buttons.ElementAt(1).setPosition(new Vector2(Game.getInstance().getResolution().X / 1.8f, Game.getInstance().getResolution().Y / 2)); //GuiListFactory.setListPosition(m_buttons, new Vector2(55, 55)); GuiListFactory.setTextOffset(m_buttons, new Vector2(10, -20)); //GuiListFactory.setButtonDistance(m_buttons, new Vector2(200, 30)); LinkedList<string> t_levelLocked = getLockedLevels(); LinkedListNode<Button> t_buttonIt = m_buttons.First; while (t_buttonIt != null) { LinkedListNode<Button> t_nextIt = t_buttonIt.Next; if (t_levelLocked.Remove(t_buttonIt.Value.getText())) { m_buttons.Remove(t_buttonIt); } else { if (Game.getInstance().getProgress().hasClearedLevel(t_buttonIt.Value.getText())) { Environment t_cricle = new Environment(t_buttonIt.Value.getPosition().getGlobalCartesian(), "Images//GUI//drawcirkle", 0.5f); t_cricle.getImg().setLooping(false); t_cricle.getImg().setAnimationSpeed(20); t_cricle.getPosition().plusXWith(-t_cricle.getBox().Width / 3); m_objects.AddLast(t_cricle); } t_buttonIt.Value.m_clickEvent += new Button.clickDelegate(startLevelClick); } t_buttonIt = t_nextIt; } //m_buttons.AddLast(m_btnTFAccept = new Button("btn_textfield_accept", new Vector2(600, 100))); //m_btnTFAccept.m_clickEvent += new Button.clickDelegate(createNewLevel); /*Button t_saveProgressButton = new Button("btn_asset_list_normal", "btn_asset_list_hover", "btn_asset_list_pressed", "btn_asset_list_toggle", new Vector2(500, 400), "Save Game", "VerdanaBold", Color.White, new Vector2(10, 0)); t_saveProgressButton.m_clickEvent += new Button.clickDelegate(saveProgressClick); m_buttons.AddLast(t_saveProgressButton);*/ }