protected virtual void OfferQuest_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes) { // Show accept message, add quest sender.CloseWindow(); ShowQuestPopupMessage(offeredQuest, (int)QuestMachine.QuestMessages.AcceptQuest); QuestMachine.Instance.StartQuest(offeredQuest); // Assign QuestResourceBehaviour to questor NPC - this will be last NPC clicked // This will ensure quests actions like "hide npc" will operate on questor at quest startup if (QuestMachine.Instance.LastNPCClicked != null) { QuestMachine.Instance.LastNPCClicked.AssignQuestResourceBehaviour(); } } else { // inform TalkManager so that it can remove the quest topics that have been added // (note by Nystul: I know it is a bit ugly that it is added in the first place at all, but didn't find a good way to do it differently - // may revisit this later) GameManager.Instance.TalkManager.RemoveQuestInfoTopicsForSpecificQuest(offeredQuest.UID); // remove quest rumors (rumor mill command) for this quest from talk manager GameManager.Instance.TalkManager.RemoveQuestRumorsFromRumorMill(offeredQuest.UID); // remove quest progress rumors for this quest from talk manager GameManager.Instance.TalkManager.RemoveQuestProgressRumorsFromRumorMill(offeredQuest.UID); // Show refuse message sender.CloseWindow(); ShowQuestPopupMessage(offeredQuest, (int)QuestMachine.QuestMessages.RefuseQuest, false); } }
private static void PackPopUp_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.No) { sender.CloseWindow(); } else { if (!GameManager.Instance.PlayerEnterExit.IsPlayerInside && GameManager.Instance.AreEnemiesNearby()) { DaggerfallUI.MessageBox("There are enemies nearby."); } else { DaggerfallUnityItem CampEquip = ItemBuilder.CreateItem(ItemGroups.UselessItems2, ClimateCalories.templateIndex_CampEquip); CampEquip.LowerCondition(CampDmg, GameManager.Instance.PlayerEntity); DestroyCamp(); GameManager.Instance.PlayerEntity.Items.AddItem(CampEquip); CampDeployed = false; FireLit = false; TentMatrix = new Matrix4x4(); sender.CloseWindow(); } } }
protected virtual void OfferQuest_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes) { // Show accept message, add quest sender.CloseWindow(); ShowQuestPopupMessage(offeredQuest, (int)QuestMachine.QuestMessages.AcceptQuest); QuestMachine.Instance.InstantiateQuest(offeredQuest); } else { // inform TalkManager so that it can remove the quest topics that have been added // (note by Nystul: I know it is a bit ugly that it is added in the first place at all, but didn't find a good way to do it differently - // may revisit this later) GameManager.Instance.TalkManager.RemoveQuestInfoTopicsForSpecificQuest(offeredQuest.UID); // remove quest rumors (rumor mill command) for this quest from talk manager GameManager.Instance.TalkManager.RemoveQuestRumorsFromRumorMill(offeredQuest.UID); // remove quest progress rumors for this quest from talk manager GameManager.Instance.TalkManager.RemoveQuestProgressRumorsFromRumorMill(offeredQuest.UID); // Show refuse message sender.CloseWindow(); ShowQuestPopupMessage(offeredQuest, (int)QuestMachine.QuestMessages.RefuseQuest, false); } }
public void ConfirmTraining_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { CloseWindow(); if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes) { if (playerEntity.GetGoldAmount() >= GetServicePrice()) { // Show skill picker loaded with guild training skills DaggerfallListPickerWindow skillPicker = new DaggerfallListPickerWindow(uiManager, this); skillPicker.OnItemPicked += TrainingSkill_OnItemPicked; List <DFCareer.Skills> trainingSkills; if (guildTrainingSkills.TryGetValue(service, out trainingSkills)) { foreach (DFCareer.Skills skill in trainingSkills) { skillPicker.ListBox.AddItem(DaggerfallUnity.Instance.TextProvider.GetSkillName(skill)); } uiManager.PushWindow(skillPicker); } } else { DaggerfallUI.MessageBox(notEnoughGoldId); } } }
/// <summary> /// Apply selected preset. /// </summary> private void ConfirmPreset_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes) { // Save current settings SaveSettings(false); // Confront current settings and preset foreach (SectionData section in presets[currentPresetIndex].Sections.Where(x => x.SectionName != ModSettingsReader.internalSection)) { foreach (KeyData key in section.Keys) { data[section.SectionName][key.KeyName] = key.Value; } } // Apply changes CloseWindow(); presetPicker.CloseWindow(); RestartSettingsWindow(); } else { CloseWindow(); } }
//handles button clicks from Sell ship message box void SellShip_messageBox_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes) { DaggerfallBankManager.MakeTransaction(TransactionType.Sell_ship, 0, regionIndex); } sender.CloseWindow(); }
protected virtual void MoveEntry_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { if (messageBoxButton != DaggerfallMessageBox.MessageBoxButtons.Yes) { selectedEntry = NULLINT; } sender.CloseWindow(); }
private void ConfirmStatReset_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { CloseWindow(); if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes) { EntityEffectManager playerEffectMgr = playerEntity.EntityBehaviour.GetComponent <EntityEffectManager>(); playerEffectMgr.CureAllAttributes(); } }
static void ReplaceBookBox_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { sender.CloseWindow(); if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes) { GivePlayerLocationsBook(); DaggerfallUI.MessageBox("Here's your replacement guild hall locations book."); } }
private void ConfirmTrade_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes) { // Proceed with trade. int tradePrice = GetTradePrice(); switch (windowMode) { case WindowModes.Sell: case WindowModes.SellMagic: float goldWeight = (float)tradePrice / DaggerfallBankManager.gold1kg; if (PlayerEntity.CarriedWeight + goldWeight <= PlayerEntity.MaxEncumbrance) { PlayerEntity.GoldPieces += tradePrice; } else { DaggerfallUnityItem loc = ItemBuilder.CreateItem(ItemGroups.MiscItems, (int)MiscItems.Letter_of_credit); loc.value = tradePrice; GameManager.Instance.PlayerEntity.Items.AddItem(loc, Items.ItemCollection.AddPosition.Front); } RaiseOnTradeHandler(remoteItems.GetNumItems(), tradePrice); remoteItems.Clear(); break; case WindowModes.Buy: PlayerEntity.DeductGoldAmount(tradePrice); RaiseOnTradeHandler(basketItems.GetNumItems(), tradePrice); PlayerEntity.Items.TransferAll(basketItems); break; case WindowModes.Repair: PlayerEntity.DeductGoldAmount(tradePrice); for (int i = 0; i < remoteItems.Count; i++) { DaggerfallUnityItem item = remoteItems.GetItem(i); item.currentCondition = item.maxCondition; } RaiseOnTradeHandler(remoteItems.GetNumItems(), tradePrice); break; case WindowModes.Identify: PlayerEntity.DeductGoldAmount(GetTradePrice()); for (int i = 0; i < remoteItems.Count; i++) { DaggerfallUnityItem item = remoteItems.GetItem(i); item.IdentifyItem(); } RaiseOnTradeHandler(remoteItems.GetNumItems(), tradePrice); break; } DaggerfallUI.Instance.PlayOneShot(SoundClips.GoldPieces); PlayerEntity.TallySkill(DFCareer.Skills.Mercantile, 1); Refresh(); } CloseWindow(); }
private void ConfirmDialog_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.No) { classIndex = noClassIndex; } sender.CloseWindow(); CloseWindow(); }
//handles button clicks from Deposit LOC message box void DepositLOC_messageBox_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes) { DaggerfallBankManager.MakeTransaction(TransactionType.Depositing_LOC, 0, regionIndex); } sender.CloseWindow(); }
private void ConfirmDefaultsBox_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { sender.CloseWindow(); if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes) { SetDefaults(); InputManager.Instance.SaveKeyBinds(); } }
private void ConfirmExitBox_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { sender.CloseWindow(); if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes) { DaggerfallUI.PostMessage(DaggerfallUIMessages.dfuiExitGame); CancelWindow(); } }
static void ReplaceMarkBox_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { sender.CloseWindow(); if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes) { GameManager.Instance.PlayerEntity.DeductGoldAmount(replaceMarkCost); GivePlayerMarkOfRecall(); DaggerfallUI.MessageBox("Here's your replacement Mark of Recall, take more care in future!"); } }
/// <summary> /// Set default settings on confirmation. /// </summary> private void ConfirmReset_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes) { settings.RestoreDefaults(); RefreshControls(); } CloseWindow(); }
/// <summary> /// Button handler for travel confirmation pop up. This is a temporary solution until implementing the final pop-up. /// </summary> void ConfirmTravelPopupButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { //sender.CloseWindow(); //if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes) //{ // DFPosition pos = MapsFile.LongitudeLatitudeToMapPixel((int)locationInfo.Longitude, (int)locationInfo.Latitude); // TravelToLocation(pos); //} }
protected virtual void FindPlace_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { sender.CloseWindow(); if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes) { Debug.Log("Find " + findPlaceName + findPlaceRegion); this.CloseWindow(); DaggerfallUI.Instance.DfTravelMapWindow.GotoLocation(findPlaceName, findPlaceRegion); DaggerfallUI.PostMessage(DaggerfallUIMessages.dfuiOpenTravelMapWindow); } }
private void ConfirmOverwrite_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes) { SaveGame(); } else { CloseWindow(); } }
private void DeleteSpellConfirm_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { if (deleteSpellIndex != -1 && messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes) { GameManager.Instance.PlayerEntity.DeleteSpell(deleteSpellIndex); deleteSpellIndex = -1; RefreshSpellsList(true); } CloseWindow(); }
void ConfirmRacePopup_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes) { CloseWindow(); } else if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.No) { sender.CancelWindow(); } }
protected virtual void SaveBoxClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { DaggerfallUI.Instance.PlayOneShot(SoundClips.ButtonClick); sender.CloseWindow(); if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes) { WriteRoadData(); roadTexturing.UpdateRoadData(roadData); } CloseTravelWindows(); }
protected virtual void SaveBoxClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { DaggerfallUI.Instance.PlayOneShot(SoundClips.ButtonClick); sender.CloseWindow(); if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes) { WriteEditedPathData(BasicRoadsTexturing.roads, RoadDataFilename); WriteEditedPathData(BasicRoadsTexturing.tracks, TrackDataFilename); } CloseTravelWindows(); }
private static void Bribe_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { sender.CloseWindow(); if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes) { BribePopup(); } else { ArrestPrompt(); } }
private void GuiltyNotGuilty_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { sender.CloseWindow(); if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Guilty) { if (punishmentType != 0) { if (punishmentType == 1) { state = 5; } else { fine >>= 1; daysInPrison >>= 1; playerEntity.DeductGoldAmount(fine); // Classic gives a legal reputation raise here, probably a bug since it means you get a separate raise // for paying the fine and for serving prison time. if (daysInPrison > 0) { state = 3; } else { // Give the reputation raise here if no prison time will be served. playerEntity.RaiseReputationForDoingSentence(); repositionPlayer = true; // Oversight in classic: Does not refill vital signs when releasing in this case, so player is left with 1 health. playerEntity.FillVitalSigns(); ReleaseFromPrison(); } } } else { state = 4; } } else // Pleading not guilty { DaggerfallMessageBox messageBox = new DaggerfallMessageBox(uiManager, this, false, 127); messageBox.SetTextTokens(DaggerfallUnity.Instance.TextProvider.GetRSCTokens(courtTextHowConvince)); messageBox.ScreenDimColor = new Color32(0, 0, 0, 0); messageBox.AddButton(DaggerfallMessageBox.MessageBoxButtons.Debate); messageBox.AddButton(DaggerfallMessageBox.MessageBoxButtons.Lie); messageBox.OnButtonClick += DebateLie_OnButtonClick; messageBox.ParentPanel.VerticalAlignment = VerticalAlignment.Bottom; messageBox.AllowCancel = false; uiManager.PushWindow(messageBox); } Update(); }
void ConfirmClassPopup_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { sender.CloseWindow(); if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes) { ; } else if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.No) { DeleteOutfit(); } }
// Access wagon or dungeon exit private void DungeonWagonAccess_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.No) { playerEnterExit.TransitionDungeonExterior(true); } else { DaggerfallUI.Instance.InventoryWindow.AllowDungeonWagonAccess(); DaggerfallUI.PostMessage(DaggerfallUIMessages.dfuiOpenInventoryWindow); } sender.CloseWindow(); }
/// <summary> /// Set default settings on confirmation. /// </summary> private void ConfirmReset_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes) { ModSettingsReader.ResetSettings(mod, ref data, defaultSettings); CloseWindow(); RestartSettingsWindow(); } else { CloseWindow(); } }
public void ConfirmJoinGuild_OnButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { sender.CloseWindow(); if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes) { guildManager.AddMembership(guildGroup, guild); DaggerfallMessageBox messageBox = new DaggerfallMessageBox(uiManager, uiManager.TopWindow); messageBox.SetTextTokens(guild.TokensWelcome(), guild); messageBox.ClickAnywhereToClose = true; messageBox.Show(); } }
/// <summary> /// Button handler for travel-with-incubating-disease confirmation pop up. /// </summary> void ConfirmTravelPopupDiseasedButtonClick(DaggerfallMessageBox sender, DaggerfallMessageBox.MessageBoxButtons messageBoxButton) { sender.CloseWindow(); if (messageBoxButton == DaggerfallMessageBox.MessageBoxButtons.Yes) { CallFastTravelGoldCheck(); } else { return; } }