private DialogResult GetDialogResult(IDifferenceDialog dialog, DialogDisplay display) { DialogResult result = DialogResult.OK; bool showDialog = false; if (display == DialogDisplay.Always || dialog.RequiresInput) { showDialog = true; } else if (display == DialogDisplay.UseOption) { showDialog = !dialog.OnlyShowIfShiftPressed || Options.IsShiftPressed; } if (showDialog) { dialog.ShowShiftCheck = display != DialogDisplay.Always; this.currentDifferenceDlg = dialog; try { result = dialog.ShowDialog(this); } finally { this.currentDifferenceDlg = null; } } return(result); }
public override void Unload() { CommandLogic.instance = null; orgCoatSlots = new int[0]; HidePartyUI(); HideCommandUI(); HideDialogUI(); HideLevelUpUI(); PartySelectHotkey = null; GuardHotKey = null; MusicUpKey = null; MusicLeftKey = null; MusicDownKey = null; MusicRightKey = null; if (partyUI != null && commandUI != null && dialogUI != null) { partyUI.Destroy(); commandUI.Destroy(); dialogUI.Destroy(); } partyUI = null; commandUI = null; dialogUI = null; instance = null; }
void toggleDialog() { Debug.Log("toggledialog called"); Debug.Log(dialogActive); if (!dialogActive) //activate dialog { ///make sighted object y and player y equal zero noSight(); sightedObject = actionSight.collider.gameObject; DialogCreator dc = sightedObject.GetComponent <DialogCreator>(); DialogDisplay dd = GetComponent <DialogDisplay>(); dd.enabled = true; dd.startDialog(sightedObject.name, dc.GetDialog().text); dialogActive = true; } else if (dialogActive) //deactivate dialog { whiteSight(); DialogDisplay dd = GetComponent <DialogDisplay>(); dd.closeDialog(); dd.enabled = false; dialogActive = false; } }
public void Setup(MemoryList memoryList, DialogDisplay dialogBox) { this.memoryList = memoryList; this.dialogBox = dialogBox; if (canMove) { throw new System.Exception("player is allowed to move around before Setup is called"); } memoryList.onMemoryLost += (_1, _2) => { if (finishedTips) { return; } canMove = false; finishedTips = true; StartCoroutine(dialogBox.DisplayText(new string[] { "(I feel like I haven just forgotten something)", "(Damn it, this headache just won't go way!)", "<Due to the condition, you can only remember the last 10 topics>" }, () => { canMove = true; })); }; }
private static void ProcessDirOption(string arg) { string data; char option = GetArgOption(arg, out data); switch (option) { case 'l': Options.ShowOnlyInA = GetBool(data); break; case 'r': Options.ShowOnlyInB = GetBool(data); break; case 'd': Options.ShowDifferent = GetBool(data); break; case 's': Options.ShowSame = GetBool(data); break; case 'c': Options.Recursive = GetBool(data); break; case 'g': displayDirDialog = GetBool(data) ? DialogDisplay.Always : DialogDisplay.OnlyIfNecessary; break; } }
protected override void Interact() { if (!independent) { priorSuccess = priorEvent.RuntimeValue; if (!priorSuccess) { Debug.Log("the prior conversation is set to" + priorSuccess); return; } } if (!unlocked) { if (player.inventory[item1] == 0) { Debug.Log("you don't have the item needed"); return; } } if (thisSpeechType == SpeechType.oneOffConvo) { if (!onlyOnce) { Debug.Log("one off convo"); DialogDisplay.NewConversation(conversation); isCompleted = true; convoCompleted.RuntimeValue = isCompleted; onlyOnce = true; if (!giftless) { player.inventory[item2]++; //I am hard coding these sound effects in AudioManager.Instance.Play("ItemGet"); } if (!noTake) { player.inventory[item3]--; //I am hard coding these sound effects in //this needs a different sound effect for 'character taking item' AudioManager.Instance.Play("Whp"); } onlyOnce = true; } Debug.Log("already did one off convo"); } else { Debug.Log("looping convo"); DialogDisplay.NewConversation(conversation); // check that the conversation is in progress? isCompleted = true; convoCompleted.RuntimeValue = isCompleted; } }
public void StartTimer(float delay, DialogDisplay dd) { dialogDisplay = dd; CooldownTime = delay; TimerBar.fillAmount = 1; TimerBar.enabled = true; TimerRunning = true; }
private void OnTriggerEnter2D(Collider2D triggerObj) { if (triggerObj.gameObject.CompareTag("Talkable")) { talk.enabled = true; buttons.SetActive(true); Dial = triggerObj.gameObject.GetComponent <DialogDisplay>(); PlayerData.Dial = Dial; PlayerData.speakerUILeft = Dial.speakerLeft.GetComponent <SpeakerUI>(); PlayerData.speakerUIRight = Dial.speakerRight.GetComponent <SpeakerUI>(); PlayerData.speakerUILeft.Speaker = Dial.conversation.speakerLeft; PlayerData.speakerUIRight.Speaker = Dial.conversation.speakerRight; } if (triggerObj.gameObject.CompareTag("MiniGame")) { if (triggerObj.gameObject.name == "Minigame1") { MiniGame1.SetBool("isOpen", true); } else if (triggerObj.gameObject.name == "Minigame2") { MiniGame2.SetBool("isOpen", true); } else if (triggerObj.gameObject.name == "Minigame3") { MiniGame3.SetBool("isOpen", true); } else if (triggerObj.gameObject.name == "Minigame4") { MiniGame4.SetBool("isOpen", true); } else if (triggerObj.gameObject.name == "Minigame5") { MiniGame5.SetBool("isOpen", true); } } if (triggerObj.gameObject.CompareTag("Suspect")) { if (triggerObj.gameObject.name == "Antique") { Antique.SetActive(true); } else if (triggerObj.gameObject.name == "Husband") { Husband.SetActive(true); } else if (triggerObj.gameObject.name == "Sissy") { Sister.SetActive(true); } else if (triggerObj.gameObject.name == "Besty") { Best.SetActive(true); } } }
public override void SetupUI(DialogDisplay display) { base.SetupUI(display); NPCText.gameObject.SetActive(false); PlayerDefaultText.gameObject.SetActive(false); if (AllPlayerReplies.Count > 0) { ClearPlayerOptions(); } gameObject.SetActive(true); }
private static void ProcessFileOption(string arg) { string data; char option = GetArgOption(arg, out data); switch (option) { case 'c': Options.IgnoreCase = GetBool(data); break; case 'x': // Use Text (for /f:x-) instead of Auto for backward compatibility. // The preferred method now is to use /f:t[atxb] Options.CompareType = GetBool(data) ? CompareType.Xml : CompareType.Text; break; case 'w': Options.IgnoreTextWhitespace = GetBool(data); break; case 'g': displayFileDialog = GetBool(data) ? DialogDisplay.Always : DialogDisplay.OnlyIfNecessary; break; case 't': switch ((data ?? string.Empty).ToLower()) { case "a": Options.CompareType = CompareType.Auto; break; case "t": Options.CompareType = CompareType.Text; break; case "x": Options.CompareType = CompareType.Xml; break; case "b": Options.CompareType = CompareType.Binary; break; } break; } }
private void ShowDirDifferences(string directoryA, string directoryB, DialogDisplay display) { using (DirDiffDialog dialog = new DirDiffDialog()) { dialog.NameA = directoryA; dialog.NameB = directoryB; if (this.GetDialogResult(dialog, display) == DialogResult.OK) { Options.LastDirA = dialog.NameA; Options.LastDirB = dialog.NameB; this.ShowDifferences(dialog.NameA, dialog.NameB, DiffType.Directory); } } }
public void ShowFileDifferences(string fileNameA, string fileNameB, DialogDisplay display) { using (FileDiffDialog dialog = new FileDiffDialog()) { dialog.NameA = fileNameA; dialog.NameB = fileNameB; if (this.GetDialogResult(dialog, display) == DialogResult.OK) { Options.LastFileA = dialog.NameA; Options.LastFileB = dialog.NameB; this.ShowDifferences(dialog.NameA, dialog.NameB, DiffType.File); } } }
public override void SetupUI(DialogDisplay display) { base.SetupUI(display); }
private void SendStartingMessage() { DialogDisplay.DisplayDialog(Introduction); }
private void Start() { _bc = GameObject.Find("MainPlayer").GetComponent <BCConfig>().GetBrainCloud(); if (!_bc.Client.Initialized) { SceneManager.LoadScene("Connect"); return; } m_playerName = GameObject.Find("PlayerName").GetComponent <InputField>(); m_playerNameImage = GameObject.Find("PlayerName").GetComponent <Image>(); m_dialogDisplay = GameObject.Find("DialogDisplay").GetComponent <DialogDisplay>(); m_acesTabImg = GameObject.Find("Aces Tab").GetComponent <Image>(); m_acesTabText = GameObject.Find("Aces Tab").transform.GetChild(0).GetComponent <Text>(); m_bombersTabImg = GameObject.Find("Bombers Tab").GetComponent <Image>(); m_bombersTabText = GameObject.Find("Bombers Tab").transform.GetChild(0).GetComponent <Text>(); m_selectedTabColor = GameObject.Find("Aces Tab").transform.GetChild(0).GetComponent <Text>().color; m_tabColor = GameObject.Find("Bombers Tab").transform.GetChild(0).GetComponent <Text>().color; m_achievementsWindow = GameObject.Find("Achievements"); m_refreshLabel = GameObject.Find("RefreshLabel"); m_refreshLabel.GetComponent <Text>().text = "Refreshing list..."; m_achievementsWindow.transform.GetChild(3).GetChild(0).gameObject.SetActive(false); m_achievementsWindow.transform.GetChild(4).GetChild(0).gameObject.SetActive(false); m_achievementsWindow.transform.GetChild(5).GetChild(0).gameObject.SetActive(false); m_achievementsWindow.SetActive(false); m_joiningGameWindow = GameObject.Find("JoiningGame"); m_joiningGameWindow.SetActive(false); m_leaderboardWindow = GameObject.Find("Leaderboard"); m_scoreText = GameObject.Find("SCORE").GetComponent <Text>(); m_basePresetButton = GameObject.Find("PresetButton"); m_baseSizeButton = GameObject.Find("SizeButton"); m_basePresetButton.SetActive(false); m_baseSizeButton.SetActive(false); m_presetButtons = new List <GameObject>(); m_sizeButtons = new List <GameObject>(); m_mapPresets = GameObject.Find("MapPresets").GetComponent <MapPresets>().m_presets; m_mapSizes = GameObject.Find("MapPresets").GetComponent <MapPresets>().m_mapSizes; m_leaderboardWindow.SetActive(false); m_controlWindow = GameObject.Find("Controls"); m_controlWindow.SetActive(false); for (int i = 0; i < m_mapPresets.Count; i++) { GameObject presetButton = (GameObject)Instantiate(m_basePresetButton, m_basePresetButton.transform.position, m_basePresetButton.transform.rotation); presetButton.transform.SetParent(m_basePresetButton.transform.parent); Vector3 position = presetButton.GetComponent <RectTransform>().position; position.y -= i * 23; presetButton.GetComponent <RectTransform>().position = position; int option = i; presetButton.GetComponent <Button>().onClick.AddListener(() => { SelectLayoutOption(option); }); presetButton.transform.GetChild(0).GetComponent <Text>().text = m_mapPresets[i].m_name; m_presetButtons.Add(presetButton); } for (int i = 0; i < m_mapSizes.Count; i++) { GameObject sizeButton = (GameObject)Instantiate(m_baseSizeButton, m_baseSizeButton.transform.position, m_baseSizeButton.transform.rotation); sizeButton.transform.SetParent(m_baseSizeButton.transform.parent); Vector3 position = sizeButton.GetComponent <RectTransform>().position; position.y -= i * 23; sizeButton.GetComponent <RectTransform>().position = position; int option = i; sizeButton.GetComponent <Button>().onClick.AddListener(() => { SelectSizeOption(option); }); sizeButton.transform.GetChild(0).GetComponent <Text>().text = m_mapSizes[i].m_name; m_sizeButtons.Add(sizeButton); } m_baseButton = GameObject.Find("Game Lineitem"); m_baseButton.SetActive(false); m_roomButtons = new List <RoomButton>(); m_showRoomsWindow = GameObject.Find("ShowRooms"); m_createGameWindow = GameObject.Find("CreateGame"); m_createGameWindow.SetActive(false); m_playerName.text = PhotonNetwork.player.NickName; m_playerName.interactable = false; PhotonNetwork.JoinLobby(); BrainCloudStats.Instance.ReadStatistics(); BrainCloudStats.Instance.GetLeaderboard(m_currentLeaderboardID); // OnRoomsWindow(); }
public virtual void SetupUI(DialogDisplay display) { dspl = display; }
public IEnumerator Talk(MemoryList memoryList, DialogDisplay dialogBox, OnDialogFinish onDialogFinish) { bool keepTalking = true; while (keepTalking) { if (node == null) { keepTalking = false; } else if (node is DialogTextNode) { DialogTextNode textNode = (DialogTextNode)node; if (textNode.requireItems == null || memoryList.Contains(textNode.requireItems)) { yield return(dialogBox.DisplayText(textNode.dialogs)); if (textNode.addItems != null) { foreach (string item in textNode.addItems) { memoryList.AddItem(item); } } if (node.children != null) { node = node.children[0]; if (node.id == 999) { GameObject.FindGameObjectWithTag("GameController").GetComponent <GameManager>().GameEnd(); onDialogFinish(); yield break; } } else { node = null; } } else { yield return(dialogBox.DisplayText(new string[] { "Hi Ben!" })); } keepTalking = false; } else if (node is DialogOptionNode) { DialogOptionNode optionNode = (DialogOptionNode)node; string[] availableOptions = optionNode.options .Where((option) => !option.selected && (option.requireItems == null || memoryList.Contains(option.requireItems))) .Select((option) => option.text).ToArray(); if (availableOptions.Length > 0) { yield return(dialogBox.DisplayOptionList(availableOptions, (selection) => { node = optionNode.Select(selection); })); if (optionNode == node) { keepTalking = false; } } else { yield return(dialogBox.DisplayText(new string[] { "Hi Ben!" })); keepTalking = false; } } yield return(null); } onDialogFinish(); }
public void OnSelected() { DialogDisplay.DisplayDialogNode(Next); }
public override void Load() { PartySelectHotkey = KeybindLoader.RegisterKeybind(this, "Party menu", "F"); GuardHotKey = KeybindLoader.RegisterKeybind(this, "Guard", "Q"); MusicUpKey = KeybindLoader.RegisterKeybind(this, "MusicalUp", "Z"); MusicLeftKey = KeybindLoader.RegisterKeybind(this, "MusicalLeft", "X"); MusicDownKey = KeybindLoader.RegisterKeybind(this, "MusicalDown", "N"); MusicRightKey = KeybindLoader.RegisterKeybind(this, "MusicalRight", "M"); instance = this; CommandLogic.Initialize(); CommandLogic.instance.ChangeCommand(0); Logger.InfoFormat("{0} Sora logging", Name); if (!Main.dedServ) { orgCoatSlots = new int[3]; orgCoatSlots[0] = AddEquipTexture(new Items.Armor.orgCoat(), EquipType.Body, "KingdomTerrahearts/Items/Armor/orgCoat_Body"); orgCoatSlots[1] = AddEquipTexture(new Items.Armor.orgCoat(), EquipType.Legs, "KingdomTerrahearts/Items/Armor/orgCoat_Legs"); orgCoatSlots[2] = AddEquipTexture(new Items.Armor.orgCoat(), EquipType.Head, "KingdomTerrahearts/Items/Armor/orgCoat_Head"); MusicLoader.AddMusicBox(this, MusicLoader.GetMusicSlot(this, "Sounds/Music/Lazy Afternoons"), ModContent.ItemType <Items.Placeable.LazyAfternoons_Item>(), ModContent.TileType <Tiles.MusicBoxes.LazyAfternoons_MusicBox>()); MusicLoader.AddMusicBox(this, MusicLoader.GetMusicSlot(this, "Sounds/Music/Vector to the Heaven"), ModContent.ItemType <Items.Placeable.VectorToHeaven_Item>(), ModContent.TileType <Tiles.MusicBoxes.VectorToHeaven_MusicBox>()); } if (Main.netMode != NetmodeID.Server) { // First, you load in your shader file. // You'll have to do this regardless of what kind of shader it is, // and you'll have to do it for every shader file. // This example assumes you have both armour and screen shaders. Ref <Effect> dyeRef = new Ref <Effect>(ModContent.Request <Effect>("KingdomTerrahearts/Effects/lastWorldShader").Value); // To add a dye, simply add this for every dye you want to add. // "PassName" should correspond to the name of your pass within the *technique*, // so if you get an error here, make sure you've spelled it right across your effect file. GameShaders.Armor.BindShader(ModContent.ItemType <Items.lastWorldDye>(), new ArmorShaderData(dyeRef, "ArmorMyShader")); Ref <Effect> screenRef = new Ref <Effect>(ModContent.Request <Effect>("KingdomTerrahearts/Effects/Shockwave").Value); // The path to the compiled shader file. Filters.Scene["Shockwave"] = new Filter(new ScreenShaderData(screenRef, "Shockwave"), EffectPriority.VeryHigh); Filters.Scene["Shockwave"].Load(); } if (!Main.dedServ) { partyInterface = new UserInterface(); partyUI = new PartyUI(); partyUI.Activate(); commandInterface = new UserInterface(); commandUI = new CommandMenu(); commandUI.Activate(); dialogInterface = new UserInterface(); dialogUI = new DialogDisplay(); dialogUI.Activate(); levelUpInterface = new UserInterface(); levelUpUI = new KeybladeLeveling(); levelUpUI.Activate(); } //Collision extra On.Terraria.Player.Update_NPCCollision += CollisionDetour; }
public void OnSelected() { DialogDisplay.DisplayDialog(Tree); }
void Awake() { Instance = this; }
private void Awake() { ins = this; }
private void HandlePostedFiles(string[] files, bool commandLine) { int numFiles = files.Length; if (numFiles == 1 || numFiles == 2) { string fileNameA = files[0]; string fileNameB = string.Empty; if (numFiles == 2) { fileNameB = files[1]; } // See if the first arg is a file. I'm using the File.Exists // method here instead of Options.FileExists because I really // always need to know what type of argument was passed in. bool fileExists = File.Exists(fileNameA); DialogDisplay display = DialogDisplay.UseOption; if (commandLine) { if (fileExists) { display = CommandLineProcessor.DisplayFileDialog; } else { display = CommandLineProcessor.DisplayDirDialog; } } // See if a diff dialog is currently displayed. If so, // then we need to route the args to it instead of popping // up a new dialog. if (this.currentDifferenceDlg != null) { if (numFiles == 1) { if (this.currentDifferenceDlg.NameA.Length == 0) { this.currentDifferenceDlg.NameA = fileNameA; } else { this.currentDifferenceDlg.NameB = fileNameA; } } else { this.currentDifferenceDlg.NameA = fileNameA; this.currentDifferenceDlg.NameB = fileNameB; } } else if (fileExists) { this.ShowFileDifferences(fileNameA, fileNameB, display); } else { this.ShowDirDifferences(fileNameA, fileNameB, display); } } }