private void ConfirmReturnToNormal() { var box = RPGMessageBox.Create("Are you sure you want to return to normal mode?", "Return to normal mode", "Continue Playing GTA:RPG", () => { View.CloseAllMenus(); RPGMethods.ReturnToNormal(); }, () => { View.MenuPosition = new Point(UI.WIDTH - 300, 0); }); RPGUI.FormatMenu(box); View.AddMenu(box); }
private void ConfirmPlayAsYourCharacter() { var box = RPGMessageBox.Create("Are you sure you want to switch to your character?", "Play as " + RPG.PlayerData.Name, "Continue Playing", () => { View.CloseAllMenus(); RPG.InitCharacter(); }, () => { View.MenuPosition = new Point(UI.WIDTH - 300, 0); }); RPGUI.FormatMenu(box); View.AddMenu(box); }
private void ConfirmPlayAsTrio() { var box = RPGMessageBox.Create("Are you sure you want to play as the trio?", "Play as Michael Trevor and Franklin", "Continue Playing GTA:RPG", () => { View.CloseAllMenus(); RPGMethods.PlayAsTrio(); }, () => { View.MenuPosition = new Point(UI.WIDTH - 300, 0); }); RPGUI.FormatMenu(box); View.AddMenu(box); }
private void NewGame() { var confirm = RPGMessageBox.Create("Are you sure you want to start over?", "Start new game", "Continue playing", () => { RPG.GameLoaded = false; CharCreationNew.RestartCharCreation(); }, () => { }); RPGUI.FormatMenu(confirm); RPG.UIHandler.View.AddMenu(confirm); }
public UIHandler() { RPG.UIHandler = this; KeyDown += OnKeyDown; //Use some fancy transitions View.MenuTransitions = true; View.PopMenu(); View.MenuOffset = new Point(-302, 0); View.MenuPosition = new Point(UI.WIDTH - 300, 0); CharacterMenu = new RPGMenu("Character Menu", new GTASprite("CommonMenu", "interaction_bgd", Color.ForestGreen), new IMenuItem[] { new MenuButton("Quests", "").WithActivate(OpenQuestLog), new MenuButton("Set Skillbar", "").WithActivate(OpenSkillBarMenu), new MenuButton("Skills", "").WithActivate(OpenSkillsMenu), new MenuButton("Weapons", "").WithActivate(OpenWeaponsMenu), //new MenuButton("Talents", "", () => { View.PopMenu(); }), //new MenuButton("Mod Weapons", "", () => { View.PopMenu(); }), //new MenuButton("Mod Cars", "", () => { View.PopMenu();}), new MenuButton("Back", "").WithActivate(() => View.PopMenu()) }); ActionsMenu = new RPGMenu("ACTIONS", new GTASprite("CommonMenu", "interaction_bgd", Color.Red), new IMenuItem[] { new MenuButton("Spawn Personal Vehicle", "").WithActivate(() => RPGMethods.SpawnCar()), new MenuButton("Get Random Contract", "").WithActivate(GetRandomContract), new MenuButton("Purchase Goods", "").WithActivate(OpenShop), new MenuButton("Craft Items", "").WithActivate(OpenCrafting), new MenuButton("Back", "").WithActivate(View.PopMenu) }); SkillTreeMenu = RPG.SkillHandler.GetSkillMenu(); WeaponTreeMenu = RPG.WeaponHandler.GetWeaponMenu(); //var o = new MenuNumericScroller("Number", "", d => { }, d => { }, 0, 100, 1); //var p = new MenuToggle("Toggle", "", ()=> { }, () => { }); MainMenu = new RPGMenu("RPG Menu", new GTASprite("CommonMenu", "interaction_bgd", Color.DodgerBlue), new IMenuItem[] { new MenuButton("Inventory", "").WithActivate(OpenInventory), new MenuButton("Character Menu", "").WithActivate(OpenCharacterMenu), new MenuButton("Actions ", "").WithActivate(() => View.AddMenu(ActionsMenu)), new MenuButton("Options", "").WithActivate(() => OpenOptionsMenu()), new MenuButton("Play as Michael, Franklin and Trevor ", "").WithActivate(ConfirmPlayAsTrio), new MenuButton("Play as Yourself", "").WithActivate(ConfirmPlayAsYourCharacter), new MenuButton("Return to Normal Mode ", "").WithActivate(ConfirmReturnToNormal), new MenuButton("Close", "").WithActivate(View.PopMenu) }); RPGUI.FormatMenu(ActionsMenu); RPGUI.FormatMenu(MainMenu); RPGUI.FormatMenu(CharacterMenu); }
public void UpdateDialog(int selected = 0) { var dialogList = new List <IMenuItem>(); if (CurrentDialog == null) { return; } var dialogs = CurrentDialog.Current.Responses.Where(r => r.ConditionsMet).ToList(); for (int i = 0; i < dialogs.Count; i++) { var item = dialogs[i]; dialogList.Add(new MenuButton((item.Text))); } foreach (var i in dialogList) { i.Parent = DialogMenu; } if (DialogMenu == null) { DialogMenu = new RPGDialogMenu(CurrentNpc.Name + ": " + CurrentDialog.Current.NpcText, SelectDialog, dialogList.ToArray()); DialogMenu.ExtendWindowHeight = false; } else { DialogMenu.Caption = CurrentNpc.Name + ": " + CurrentDialog.Current.NpcText; DialogMenu.Items.Clear(); DialogMenu.Items.AddRange(dialogList); DialogMenu.Initialize(); } DialogMenu.Caption = CurrentNpc.Name + ": " + CurrentDialog.Current.NpcText; RPGUI.FormatMenu(DialogMenu); DialogMenu.HeaderHeight = 25; if (DialogMenu != null && IsOpen(DialogMenu)) { DialogMenu.SelectedIndex = selected; } }
private void UseQuestLogEntry(RPGListMenu obj) { var quests = PlayerData.Quests.Where(s => s.InProgress).Concat(PlayerData.Quests.Where(c => !c.InProgress)).Where(c => !c.IsContract || c.InProgress).ToList(); var selected = obj.SelectedIndex; if (selected >= quests.Count) { View.PopMenu(); return; } var selectedItem = quests[selected]; if (selectedItem.InProgress && selectedItem.Cancellable) { var abandon = RPGMessageBox.Create("Would you like to abandon [" + selectedItem.Name + "] ?", "Abandon Quest", "Cancel", () => { selectedItem.Reset(); UpdateQuestLog(); }, () => { }); RPGUI.FormatMenu(abandon); abandon.HeaderCentered = true; View.AddMenu(abandon); } }
protected override void Start() { RPGSettings.AudioVolume = RPG.Settings.GetValue("Options", "AudioVolume", 35); RPGSettings.PlayKillstreaks = RPG.Settings.GetValue("Options", "PlayKillAnnouncements", true); RPGSettings.ShowKillstreaks = RPG.Settings.GetValue("Options", "ShowKillAnnouncements", true); RPGSettings.ShowPrerequisiteWarning = RPG.Settings.GetValue("Options", "ShowPrerequisiteWarning", true); RPGSettings.ShowPressYToStart = RPG.Settings.GetValue("Options", "ShowPressYToStart", true); RPGSettings.EnableAutoSave = RPG.Settings.GetValue("Options", "EnableAutoSave", true); RPGSettings.AutosaveInterval = RPG.Settings.GetValue("Options", "AutosaveIntervalSeconds", 30); RPGSettings.AutostartRPGMode = RPG.Settings.GetValue("Options", "AutostartRPGMode", true); RPGSettings.ShowQuestTracker = RPG.Settings.GetValue("Options", "ShowQuestTracker", true); RPGSettings.ShowSkillBar = RPG.Settings.GetValue("Options", "ShowSkillBar", true); RPGSettings.SafeArea = RPG.Settings.GetValue("Options", "SafeArea", 10); NpcCamera = World.CreateCamera(Game.Player.Character.Position, Game.Player.Character.Rotation, GameplayCamera.FieldOfView); OptionsMenu = new RPGMenu("Options", new GTASprite("CommonMenu", "interaction_bgd", Color.ForestGreen), new IMenuItem[] { new MenuButton("Save Game", "").WithActivate(() => { RPG.SaveAllData(); RPG.Subtitle("Saved"); }), new MenuButton("New Game", "").WithActivate(NewGame), new MenuNumericScroller("AudioVolume", "", 0, 100, 10, RPGSettings.AudioVolume / 10).WithNumericActions(ChangeAudioVolume, d => { }), new MenuNumericScroller("SafeArea Setting", "", 0, 10, 1, RPGSettings.SafeArea).WithNumericActions(ChangeSafeArea, d => { }), new MenuToggle("Toggle Skill Bar", "", RPGSettings.ShowSkillBar).WithToggles(ToggleSkillBar, ToggleSkillBar), new MenuToggle("Toggle Quest Tracker", "", RPGSettings.ShowQuestTracker).WithToggles(ToggleQuestTracker, ToggleQuestTracker), new MenuToggle("Play Kill Announcer Sounds", "", RPGSettings.PlayKillstreaks).WithToggles(ToggleKillAnnounceSounds, ToggleKillAnnounceSounds), new MenuToggle("Show Killstreak Text", "", RPGSettings.ShowKillstreaks).WithToggles(ToggleShowKillAnnounce, ToggleShowKillAnnounce), new MenuToggle("Show Prerequisite Warning", "", RPGSettings.ShowPrerequisiteWarning).WithToggles(ToggleWarning, ToggleWarning), new MenuToggle("Show Press Y To Start", "", RPGSettings.ShowPressYToStart).WithToggles(ToggleShowPressY, ToggleShowPressY), new MenuToggle("Enable Auto Save", "", RPGSettings.EnableAutoSave).WithToggles(ToggleAutoSave, ToggleAutoSave), new MenuNumericScroller("Autosave Interval (s)", "", 0, 120, 10, RPGSettings.AutosaveInterval / 10).WithNumericActions(ChangeAutosaveInterval, d => { }), new MenuToggle("Autostart RPG Mode", "", RPGSettings.AutostartRPGMode).WithToggles(ToggleAutostartRPG, ToggleAutostartRPG), new MenuButton("Mod Version: " + RPG.Version, ""), new MenuButton("Back", "").WithActivate(() => View.PopMenu()) }); RPGUI.FormatMenu(OptionsMenu); }
private void StartRPGMode() { World.DestroyAllCameras(); Game.Player.CanControlCharacter = true; string missing; var statusGood = CheckStatus(out missing); if (statusGood || !RPGSettings.ShowPrerequisiteWarning) { RPG.Initialise(); Enabled = false; } else { var mb = (RPGMessageBox)RPGMessageBox.Create("Missing: " + missing + " View readme for more info.", "Play Anyway ( WARNING: Bugs/errors expected))", "Return to normal mode", PlayAnyway, () => { RPGMethods.ReturnToNormal(); RPG.UIHandler.View.CloseAllMenus(); }); RPGUI.FormatMenu(mb); mb.TopColor = Color.Red; mb.HeaderScale = 0.5f; RPG.UIHandler.View.AddMenu(mb); Enabled = false; } }