private void MenuScript_KeyDown(object sender, KeyEventArgs e) { switch (e.KeyCode) { case Keys.N: mainMenu.Visible = !mainMenu.Visible; itemDifficulty.AltTitle = Strings.ResourceManager.GetString("Difficulty" + Common.CurrentDifficulty.ToString()); itemKills.AltTitle = Common.Kills.ToString(); break; case Keys.E: if (mainMenu.Visible) { return; } if (buyMenu.Visible) { buyMenu.Visible = false; return; } if (AmmuController.DistanceToAmmu() && !lemonPool.AreAnyVisible) { buyMenu.Visible = true; } if (HungryController.IsPlayerCloseReseller() && !lemonPool.AreAnyVisible) { foodMenu.Visible = true; } if (repair.DistanceTo(Game.Player.Character.Position) <= 10f && Game.Player.Character.IsInVehicle()) { if (!Game.Player.Character.CurrentVehicle.IsDamaged) { Screen.ShowSubtitle(Strings.RepairUndamaged); return; } if (!Common.Cost(100)) { break; } Game.Player.Character.CurrentVehicle.Repair(); Screen.ShowSubtitle(Strings.RepairSuccess); } break; } }
private void MenuScript_Tick(object sender, EventArgs e) { lemonPool.Process(); timerBars.Process(); hungryBar.Progress = HungryController.ProgressBarStatus; waterBar.Progress = HungryController.WaterBarStatus; if (AmmuController.DistanceToAmmu()) { GameUI.DisplayHelp(Strings.AmmuOpenShop); } if (HungryController.IsPlayerCloseReseller()) { GameUI.DisplayHelp(Strings.FoodOpenShop); } if (repair.DistanceTo(Game.Player.Character.Position) <= 10f && Game.Player.Character.IsInVehicle()) { GameUI.DisplayHelp(Strings.RepairHelp); } }