protected override void OnClosing(CancelEventArgs e) { if (this.Sound != null) { ThreadingEngine.GetThread <SoundEngine>().StopSound(this.Sound); } base.OnClosing(e); }
public CameraForm(Sound sound, string name) : base(name) { InitializeComponent(); if (Sound != null) { base.Sound = ThreadingEngine.GetThread <SoundEngine>().PlaySound(Sound); } }
private CharacterCollection GetCharacters(Button button) { switch (button.Name) { case "Camera1Button": return(ThreadingEngine.GetThread <GameEngine>().GetCharacters(RoomType.PartyRoom1)); case "Camera2Button": return(ThreadingEngine.GetThread <GameEngine>().GetCharacters(RoomType.PartyRoom2)); case "Camera3Button": return(ThreadingEngine.GetThread <GameEngine>().GetCharacters(RoomType.PartyRoom3)); case "Camera4Button": return(ThreadingEngine.GetThread <GameEngine>().GetCharacters(RoomType.PartyRoom4)); case "Camera5Button": return(ThreadingEngine.GetThread <GameEngine>().GetCharacters(RoomType.MainHall)); case "Camera6Button": break; case "Camera7Button": break; case "Camera8Button": break; case "Camera9Button": break; case "Camera10Button": break; case "Camera11utton": break; case "Camera12Button": break; case "YouButton": break; } return(new CharacterCollection()); }
private void CameraButton_Click(object sender, EventArgs e) { _soundEngine.PlaySound(global::FNAF.Properties.Resources.VariousFNAFSound); Button button = (Button)sender; CharacterCollection characters = GetCharacters(button); FormBase form = GetForm(button); FormBase parent = GetParentForm(); ThreadingEngine.GetThread <GameEngine>().UpdateForm(parent, form); }
private FormBase GetForm(Button button) { switch (button.Name) { case "Camera1Button": return(ThreadingEngine.GetThread <GameEngine>().GetCameraForm(RoomType.PartyRoom1)); case "Camera2Button": return(ThreadingEngine.GetThread <GameEngine>().GetCameraForm(RoomType.PartyRoom2)); case "Camera3Button": return(ThreadingEngine.GetThread <GameEngine>().GetCameraForm(RoomType.PartyRoom3)); case "Camera4Button": return(ThreadingEngine.GetThread <GameEngine>().GetCameraForm(RoomType.PartyRoom4)); case "Camera5Button": return(ThreadingEngine.GetThread <GameEngine>().GetCameraForm(RoomType.LeftAirVent)); case "Camera6Button": return(ThreadingEngine.GetThread <GameEngine>().GetCameraForm(RoomType.RightAirVent)); case "Camera7Button": return(ThreadingEngine.GetThread <GameEngine>().GetCameraForm(RoomType.MainHall)); case "Camera8Button": return(ThreadingEngine.GetThread <GameEngine>().GetCameraForm(RoomType.PartsService)); case "Camera9Button": return(ThreadingEngine.GetThread <GameEngine>().GetCameraForm(RoomType.ShowStage)); case "Camera10Button": return(ThreadingEngine.GetThread <GameEngine>().GetCameraForm(RoomType.GameArea)); case "Camera11utton": return(ThreadingEngine.GetThread <GameEngine>().GetCameraForm(RoomType.PrizeCorner)); case "Camera12Button": return(ThreadingEngine.GetThread <GameEngine>().GetCameraForm(RoomType.KidsCove)); case "YouButton": return(new OfficeForm()); } return(new CameraForm()); }
public CameraMap() { _soundEngine = ThreadingEngine.GetThread <SoundEngine>(); InitializeComponent(); }
protected override void OnLoad(EventArgs e) { // // The PictureBox with the Image of the room. // this.BackgroundPictureBox = new PictureBox(); this.BackgroundPictureBox.BackColor = System.Drawing.Color.Transparent; this.BackgroundPictureBox.Image = this.DefaultImage; this.BackgroundPictureBox.Location = new System.Drawing.Point(0, 0); this.BackgroundPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.BackgroundPictureBox.Size = new Size(this.Size.Width - 5, this.Size.Height - 15); this.Controls.Add(this.BackgroundPictureBox); if (this.AutoScrollBackForth) { _scrollBackForthTimer = new Timer(); _scrollBackForthTimer.Interval = 500; // 1/2 second this.BackgroundPictureBox.Size = new Size(this.Size.Width + 100, this.Size.Height + 100); } if (this.SupportsFlashlight) { _flashlight = ThreadingEngine.GetThread <Flashlight>(); _flashlight.OutOfPower += Flashlight_OutOfPower; _flashlight.ImageChanged += Flashlight_ImageChanged; this.FlashlightPowerPictureBox = new PictureBox(); this.FlashlightPowerPictureBox.BackColor = System.Drawing.Color.Transparent; this.FlashlightPowerPictureBox.Image = _flashlight.Image; this.FlashlightPowerPictureBox.Location = new System.Drawing.Point(20, 20); this.FlashlightPowerPictureBox.Name = "FlashlightPictureBox"; this.FlashlightPowerPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.FlashlightPowerPictureBox.Size = new Size(_flashlight.Image.Width / 3, _flashlight.Image.Height / 3); this.FlashlightPowerPictureBox.Tag = _flashlight.Image.Tag; this.BackgroundPictureBox.Controls.Add(this.FlashlightPowerPictureBox); } if (this.SupportsMask) { // // The PictureBox to overlay on the BackgroundPictureBox // this.MaskPictureBox = new PictureBox(); this.MaskPictureBox.BackColor = System.Drawing.Color.Transparent; this.MaskPictureBox.Image = ThreadingEngine.GetThread <GameEngine>().User.MaskImage; this.MaskPictureBox.Location = new System.Drawing.Point(0, 0); this.MaskPictureBox.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage; this.MaskPictureBox.Size = new Size(this.Size.Width - 5, this.Size.Height - 15); this.MaskPictureBox.Visible = false; this.BackgroundPictureBox.Controls.Add(this.MaskPictureBox); } if (this.SupportsMap) { // // The PictureBox to overlay on the BackgroundPictureBox // this.CameraMap = new CameraMap(); this.CameraMap.BackColor = System.Drawing.Color.Transparent; this.CameraMap.Anchor = AnchorStyles.Bottom | AnchorStyles.Right; this.CameraMap.Visible = true; this.BackgroundPictureBox.Controls.Add(this.CameraMap); } this.KeyDown += new KeyEventHandler(Form_KeyDown); base.OnLoad(e); }