/// <summary> /// Lock the click manager with a mode and exceptions. /// </summary> /// <param name="eMode">mode.</param> /// <param name="listExceptions">List exceptions.</param> public void Lock(UIModeTypes mode = UIModeTypes.Generic, List <ClickLockExceptions> clickLockExceptions = null) { // because the screen is being locked, we must now reset temporary exceptions (but only if the stack of modes was empty) if (stackModes.Count == 0) { listTempExceptions = new List <ClickLockExceptions>(); if (clickLockExceptions != null) { listExceptions = clickLockExceptions; } } else if (stackModes.Count > 0 && clickLockExceptions != null) { Debug.Log("Something is trying to lock the click manager without an empty stack but with exceptions...this is not currently supported"); foreach (ClickLockExceptions e in clickLockExceptions) { print(e); } } // Check if the stack is already in same mode if (stackModes.Count == 0 || stackModes.Peek() != mode) { // push this latest mode stackModes.Push(mode); } }
private void CloseShop(object sender, EventArgs args) { StoreUIManager.OnShortcutModeEnd -= CloseShop; HUDUIManager.Instance.ToggleLabels(false); ClickManager.Instance.ReleaseLock(); UIModeTypes currentMode = ClickManager.Instance.CurrentMode; if (currentMode == UIModeTypes.MiniPet) { this.GetComponent <TweenToggleDemux>().Show(); if (content != null && minipetType == MiniPetTypes.Merchant) // Keep the hud and open deco inventory { content.GetComponent <TweenToggle>().Show(); MiniPetMerchantUIController merchantUI = (MiniPetMerchantUIController)SelectedMiniPetContentUIScript; merchantUI.ShowDecoInventoryHelper(); } else if (content != null) { content.GetComponent <TweenToggle>().Show(); HUDUIManager.Instance.HidePanel(); } else { HUDUIManager.Instance.HidePanel(); } storeTweenParent.Show(); } CheckStoreButtonPulse(); }
// When we exit UIMode, sometimes there are other modes in the stack, // this opens them properly protected void CloseUIOpenNext(UIModeTypes mode) { switch (mode) { default: // Default to base mode // Only run this chunk if in bedroom or yard scene if ((SceneUtils.CurrentScene == SceneUtils.BEDROOM || SceneUtils.CurrentScene == SceneUtils.YARD)) { // Editdeco mode check if (ClickManager.Instance.IsStackContainsType(UIModeTypes.EditDecos)) { if (RoomArrowsUIManager.Instance != null) { RoomArrowsUIManager.Instance.ShowPanel(); HUDUIManager.Instance.ShowPanel(); } } else if (ClickManager.Instance.IsStackContainsType(UIModeTypes.MiniPet)) { InventoryUIManager.Instance.ShowPanel(); } else if (ClickManager.Instance.IsStackContainsType(UIModeTypes.Accessory)) { HUDUIManager.Instance.ShowPanel(); } // Fireblowing room check else if (FireButtonManager.Instance.IsActive) { if (RoomArrowsUIManager.Instance != null) { RoomArrowsUIManager.Instance.ShowPanel(); HUDUIManager.Instance.ShowPanel(); } } // Default behaviour else { if (RoomArrowsUIManager.Instance != null) { RoomArrowsUIManager.Instance.ShowPanel(); HUDUIManager.Instance.ShowPanel(); } if (NavigationUIManager.Instance != null) { NavigationUIManager.Instance.ShowPanel(); HUDUIManager.Instance.ShowPanel(); } if (InventoryUIManager.Instance != null) { InventoryUIManager.Instance.ShowPanel(); HUDUIManager.Instance.ShowPanel(); } } } break; } }
private void ShowSpeechWithImage(Hashtable message) { currentSpeech = GameObjectUtils.AddChildGUI(parentCanvas.gameObject, speechImagePrefab); string imageSpriteAux = message.ContainsKey(SpeechKeys.ImageTextureName) ? (string)message[SpeechKeys.ImageTextureName] : null; GameObject objectToCall = message.ContainsKey(SpeechKeys.ImageClickTarget) ? (GameObject)message[SpeechKeys.ImageClickTarget] : null; string functionNameToCall = message.ContainsKey(SpeechKeys.ImageClickFunctionName) ? (string)message[SpeechKeys.ImageClickFunctionName] : null; UIModeTypes modeTypeAux = UIModeTypes.None; currentSpeech.GetComponent <SpeechBubble>().Init(imageSprite: imageSpriteAux, _objectToCall: objectToCall, _functionNameToCall: functionNameToCall, _modeType: modeTypeAux); }
// Helper to check UIMode for UI object toggles private bool CheckLgUIToggle(LgUIToggle uiToggleScript, UIModeTypes currentUIMode) { if (uiToggleScript.modeType1 == UIModeTypes.None) { return(true); } if (uiToggleScript.modeType1 == currentUIMode || uiToggleScript.modeType2 == currentUIMode || uiToggleScript.modeType3 == currentUIMode) { return(true); } return(false); }
// Helper to check UIMode for UI object buttons private bool CheckLgUIButton(LgUIButton uiButtonScript, UIModeTypes currentUIMode) { if (uiButtonScript.modeType1 == UIModeTypes.None) { return(true); } if (uiButtonScript.modeType1 == currentUIMode || uiButtonScript.modeType2 == currentUIMode || uiButtonScript.modeType3 == currentUIMode) { return(true); } return(false); }
// Helper to check UIMode for world object buttons private bool CheckLgWorldButton(LgWorldButton worldButtonScript, UIModeTypes currentUIMode) { List <UIModeTypes> modeTypes = worldButtonScript.ModeTypes; foreach (UIModeTypes mode in modeTypes) { if (currentUIMode == UIModeTypes.None || mode == currentUIMode || (mode == UIModeTypes.None && currentUIMode == UIModeTypes.None)) { return(true); } } return(false); }
/// <summary> /// Cancel attack so clean up. /// </summary> public void Cancel() { PetAnimationManager.Instance.AbortFireBlow(); //FireButtonUIManager.Instance.FireButtonCollider.enabled = true; //release lock if fire breathing lock was called previously UIModeTypes currentLockMode = ClickManager.Instance.CurrentMode; if (currentLockMode == UIModeTypes.FireBreathing) { ClickManager.Instance.ReleaseLock(); } Destroy(this); }
public void Init(string textString = null, string imageSprite = null, GameObject _objectToCall = null, string _functionNameToCall = null, UIModeTypes _modeType = UIModeTypes.None) { if (!string.IsNullOrEmpty(textString)) { text.text = textString; } if (!string.IsNullOrEmpty(imageSprite)) { image.sprite = SpriteCacheManager.GetSprite(imageSprite); } if (_objectToCall != null) { objectToCall = _objectToCall; if (!string.IsNullOrEmpty(_functionNameToCall)) { functionNameToCall = _functionNameToCall; } button.modeType1 = _modeType; button.interactable = true; } else { if (button != null) { button.interactable = false; } } }
public bool IsStackContainsType(UIModeTypes type) { return(stackModes.Contains(type)); }