public void startLevelClick(Button a_b) { Music.getInstance().stop(); Game.getInstance().setState(new GameState(a_b.getText() + ".lvl")); }
private void setLayer(Button a_button) { foreach (Button t_button in m_layerButtonList) { t_button.setState(Button.State.Normal); } m_currentLayer = int.Parse(a_button.getText()) - 1; a_button.setState(Button.State.Toggled); }
private void selectAsset(Button a_button) { string t_newAsset = ""; Vector2 t_assetPosition = m_worldMouse + new Vector2(-36, -36); if (a_button != null) { t_newAsset = a_button.getText(); foreach (Button t_button in m_assetButtonList) { t_button.setState(0); } a_button.setState(3); } switch (m_itemToCreate) { case State.Platform: m_objectPreview = new Platform(t_assetPosition, "Images//Tile//Floor//" + t_newAsset, 0.000f); break; case State.Wall: m_objectPreview = new Wall(t_assetPosition, "Images//Tile//Wall//" + t_newAsset, 0.000f); break; case State.Delete: m_objectPreview = null; break; case State.Guard: m_objectPreview = new Guard(t_assetPosition, "Images//Sprite//Guard//guard_idle", m_worldMouse.X, true, 0.000f); break; case State.Ladder: m_objectPreview = new Ladder(t_assetPosition, "Images//Tile//Ladder//" + t_newAsset, 0.000f); break; case State.None: m_objectPreview = null; break; case State.Player: m_objectPreview = new Player(t_assetPosition, "Images//Sprite//Hero//hero_stand", 0.000f); break; case State.SpotLight: m_objectPreview = new SpotLight(t_assetPosition, "Images//LightCone//" + t_newAsset, 0.000f, 0.0f, false); break; case State.Background: m_objectPreview = new Environment(t_assetPosition, "Images//Background//" + t_newAsset, 0.000f); break; case State.DuckHidingObject: m_objectPreview = new DuckHideObject(t_assetPosition, "Images//Prop//DuckHide//" + t_newAsset, 0.000f); break; case State.StandHidingObject: m_objectPreview = new StandHideObject(t_assetPosition, "Images//Prop//StandHide//" + t_newAsset, 0.000f); break; case State.GuardDog: m_objectPreview = new GuardDog(t_assetPosition, "Images//Sprite//GuardDog//" + t_newAsset, m_worldMouse.X, m_worldMouse.X, 0.000f); break; case State.LightSwitch: m_objectPreview = new LampSwitch(t_assetPosition, "Images//Prop//Button//" + t_newAsset, 0.000f); break; case State.CrossVent: m_objectPreview = new CrossVentilation(t_assetPosition, "Images//Tile//Ventilation//Cross//" + t_newAsset, 0.000f); break; case State.CornerVent: m_objectPreview = new CornerVentilation(t_assetPosition, "Images//Tile//Ventilation//Corner//" + t_newAsset, 0.000f); break; case State.StraVent: m_objectPreview = new StraightVentilation(t_assetPosition, "Images//Tile//Ventilation//Straight//" + t_newAsset, 0.000f); break; case State.TVent: m_objectPreview = new TVentilation(t_assetPosition, "Images//Tile//Ventilation//TVent//" + t_newAsset, 0.000f); break; case State.Ventrance: m_objectPreview = new VentilationDrum(t_assetPosition, "Images//Tile//Ventilation//Drum//" + t_newAsset, 0.000f); break; case State.Window: m_objectPreview = new Window(t_assetPosition, "Images//Tile//Window//" + t_newAsset, 0.000f); break; case State.Foreground: m_objectPreview = new Foreground(t_assetPosition, "Images//Foregrounds//" + t_newAsset, 0.000f); break; case State.CornerHang: m_objectPreview = new CornerHang(t_assetPosition, "Images//Automagi//cornerthingy", 0.000f); break; case State.Checkpoint: m_objectPreview = new CheckPoint(t_assetPosition, "Images//Prop//Clutter//backdrop_door", 0.000f); break; case State.Camera: m_objectPreview = new GuardCamera(t_assetPosition, "Images//Sprite//Camera//camera", 0.200f, (float)(Math.PI * 0.5), (float)(Math.PI * 0.75), (float)(Math.PI * 0.25), false); break; case State.Prop: m_objectPreview = new Environment(t_assetPosition, "Images//Prop//Clutter//" + t_newAsset, 0.000f); break; case State.Rope: m_objectPreview = new Rope(t_assetPosition, "", 0.000f); break; case State.Heart: m_objectPreview = new ConsumableHeart(t_assetPosition, "Images//Prop//Consumables//shinyheart", 0.000f); break; case State.Key: m_objectPreview = new ConsumableKey(t_assetPosition, "Images//Automagi//derp_key", 0.000f); break; case State.Objective: m_objectPreview = new ConsumableGoal(t_assetPosition, "Images//Prop//Consumables//Objective//" + t_newAsset, 0.000f); break; case State.Shadow: m_objectPreview = new CoveringShadow(t_assetPosition, "Images//Foregrounds//Shadow//" + t_newAsset, 0.000f); break; case State.EndVent: m_objectPreview = new VentilationEnd(t_assetPosition, "Images//Tile//Ventilation//EndVent//" + t_newAsset, 0.000f); break; case State.Parallax: m_objectPreview = new ParallaxEnvironment(t_assetPosition, "Images//Background//Parallax//" + t_newAsset, 0.000f); break; case State.LockedDoor: m_objectPreview = new LockedDoor(t_assetPosition, "Images//Prop//SecurityDoor//door", 0.000f); break; case State.FlickeringSign: m_objectPreview = new FlickeringSign(t_assetPosition, "Images//Tile//Sign//" + t_newAsset, 0.000f); break; case State.Consumable: m_objectPreview = new Consumable(t_assetPosition, "Images//Prop//Consumables//" + t_newAsset, 0.000f); break; } }
public void startLevelClick(Button a_b) { Game.getInstance().setState(new GameState(a_b.getText())); }
public void saveProgressClick(Button a_b) { int t_index = 4; for (int i = 0; i < 3; ++i) { if (m_buttons.ElementAt(i) == a_b) { t_index = i+1; } } if (!File.Exists("Content//levels//Slot "+t_index+".prog")) { m_newSaveName.getPosition().setGlobalX(a_b.getPosition().getGlobalX()); m_newSaveName.getPosition().setGlobalY(a_b.getPosition().getGlobalY()); m_newSaveName.setVisible(true); m_newSaveName.setText("Enter the name"); m_newSaveName.setWrite(true); m_saveTo = "Slot "+(t_index)+".prog"; } else { Serializer.getInstance().saveGame(Serializer.getInstance().getFileToStream(a_b.getText(), true), Game.getInstance().getProgress()); } }
private void awaitInput(Button a_button) { m_inputFeedback = new Text(new Vector2(Game.getInstance().getResolution().X / 2, 300), "Select input for: " + a_button.getText(), "VerdanaBold", Color.White, false); lockButtons(a_button); }