public async Task <IActionResult> PutUnitMenu(int id, UnitMenu unitMenu) { if (id != unitMenu.MealId) { return(BadRequest()); } _context.Entry(unitMenu).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!UnitMenuExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
private void LoginButtonPictureBox_Click(object sender, EventArgs e) { // Account logInAccount = this.Service.ReadAccount("username","password"); #region REMOVE THIS UnitEmployee unitEmployee = new UnitEmployee(0, "UE_Surname", "UE_Forename", DateTime.Today, WorkingUnit.ICU); Account unitAccount = new Account(0, "unit", "", "", unitEmployee); PharmacyEmployee pharmacyEmployee = new PharmacyEmployee(1, "PH_Surname", "PH_Forename", DateTime.Today); Account pharmacyAccount = new Account(0, "pharm", "", "", pharmacyEmployee); #endregion if (usernameTextBox.Text.Equals("unit")) { var UnitMenu = new UnitMenu(unitAccount); UnitMenu.FormClosed += UnitMenu_FormClosed; UnitMenu.Show(); this.Hide(); } else if (usernameTextBox.Text.Equals("pharm")) { var PharmacyMenu = new PharmacyMenu(pharmacyAccount); PharmacyMenu.FormClosed += PharmacyMenu_FormClosed; PharmacyMenu.Show(); this.Hide(); } else { this.errorLabel.Text += "Invalid credentials. "; } }
// Use this for initialization void Start() { cam = Camera.main.GetComponent <CameraController>(); isMouse = true; UIActiveSquare = Instantiate(UIActiveSquare); unitMenu = FindObjectOfType <UnitMenu>(); }
protected override bool update_menu_unit() { if (UnitMenu != null) { UnitMenu.Update(!Combat_Scene_Fade_In && !Preparations_Fade_In); if (UnitMenu != null && UnitMenu.Finished) { UnitMenu = null; } return(true); } return(false); }
public async Task <ActionResult <UnitMenu> > PostUnitMenu(UnitMenu unitMenu) { _context.unitMenus.Add(unitMenu); try { await _context.SaveChangesAsync(); } catch (DbUpdateException) { if (UnitMenuExists(unitMenu.MealId)) { return(Conflict()); } else { throw; } } return(CreatedAtAction("GetUnitMenu", new { id = unitMenu.MealId }, unitMenu)); }
public virtual void CreateMenu(Menu unitsMenu) { this.Menu = new UnitMenu(this.Unit, unitsMenu); this.IsControllable = true; }
protected void draw_menu_ranges_skill(SpriteBatch sprite_batch, int width, int timer, Rectangle rect) { // Skills: Swoop // Temp Swoop Range if (Global.game_temp.temp_skill_ranges.ContainsKey("SWOOP") && UnitMenu.ShowSkillRange("SWOOP")) { sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend); int opacity = 144; Color color = new Color(opacity, opacity, opacity, opacity); foreach (Vector2 loc in Global.game_temp.temp_skill_ranges["SWOOP"]) { sprite_batch.Draw(Attack_Range_Texture, loc * TILE_SIZE + move_range_draw_vector() - Global.game_map.display_loc + new Vector2(0, width - timer), rect, color); } sprite_batch.End(); } // Skills: Trample // Temp Swoop Range if (Global.game_temp.temp_skill_ranges.ContainsKey("TRAMPLE") && UnitMenu.ShowSkillRange("TRAMPLE")) { sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend); int opacity = 144; Color color = new Color(opacity, opacity, opacity, opacity); foreach (Vector2 loc in Global.game_temp.temp_skill_move_ranges["TRAMPLE"]) { sprite_batch.Draw(Move_Range_Texture, loc * TILE_SIZE + move_range_draw_vector() - Global.game_map.display_loc + new Vector2(0, width - timer), rect, color); } foreach (Vector2 loc in Global.game_temp.temp_skill_ranges["TRAMPLE"]) { sprite_batch.Draw(Attack_Range_Texture, loc * TILE_SIZE + move_range_draw_vector() - Global.game_map.display_loc + new Vector2(0, width - timer), rect, color); } sprite_batch.End(); } // Skills: Old Swoop //@Debug // Temp Old Swoop Range if (Global.game_temp.temp_skill_ranges.ContainsKey("OLDSWOOP") && UnitMenu.ShowSkillRange("OLDSWOOP")) { sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend); int opacity = 144; Color color = new Color(opacity, opacity, opacity, opacity); foreach (Vector2 loc in Global.game_temp.temp_skill_ranges["OLDSWOOP"]) { sprite_batch.Draw(Attack_Range_Texture, loc * TILE_SIZE + move_range_draw_vector() - Global.game_map.display_loc + new Vector2(0, width - timer), rect, color); } sprite_batch.End(); } // Skills: Masteries for (int i = 0; i < Game_Unit.MASTERIES.Count; i++) { string skill = Game_Unit.MASTERIES[i]; if (UnitMenu.ShowSkillRange(skill)) { // Temp Skill Range if (Global.game_temp.temp_skill_ranges.ContainsKey(skill)) { sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend); int opacity = 144; Color color = new Color(opacity, opacity, opacity, opacity); foreach (Vector2 loc in Global.game_temp.temp_skill_ranges[skill]) { sprite_batch.Draw(Attack_Range_Texture, loc * TILE_SIZE + move_range_draw_vector() - Global.game_map.display_loc + new Vector2(0, width - timer), rect, color); } sprite_batch.End(); } // Temp Attack Range (once the skill is active for menuing) else { sprite_batch.Begin(SpriteSortMode.Deferred, BlendState.AlphaBlend); int opacity = 144; Color color = new Color(opacity, opacity, opacity, opacity); foreach (Vector2 loc in Global.game_temp.temp_attack_range) { sprite_batch.Draw(Attack_Range_Texture, loc * TILE_SIZE + move_range_draw_vector() - Global.game_map.display_loc + new Vector2(0, width - timer), rect, color); } sprite_batch.End(); } } } }