protected override void ClickDelegate(ref POINTER_INFO pointer) { if (isMoving == true) return; if (pointer.evt == GameValues.defaultInputEvent) { if (CameraControl.I.IsPinching == true) return; if (UserBase.I.CurrentExcercise != null) //if we are doing an excercise dont create a popup { if (isMoving == false) //create it if we are moving, because if we place a new piece of equipment while excercising we need to be able to place it. { OneButtonPopup temp= PopupManager.CreatePopup<OneButtonPopup>() as OneButtonPopup; temp.titleText.Text = "Woah!"; temp.messageText.Text = "Already doing " + UserBase.I.CurrentExcercise.displayName; temp.cancelButton.Text = "Whoops"; return; } } EquipmentPopup temp2 = PopupManager.CreatePopup<EquipmentPopup>(true) as EquipmentPopup; temp2.EquipmentToPopulateListFrom = this; temp2.Initialize(); } }
void DetectSwipe (ref POINTER_INFO ptr) { if (ptr.active && !swiped) { Debug.Log (title + ": ptr.active && !swiped"); if (swipeOnYAxis) { if (ptr.origPos.y - ptr.devicePos.y < -swipeThreshold) { Debug.Log (title + ": Swipe Detected! UP"); swiped = true; } if (ptr.origPos.y - ptr.devicePos.y > swipeThreshold) { Debug.Log (title + ": Swipe Detected! DOWN"); swiped = true; } } else { if (ptr.origPos.x - ptr.devicePos.x > swipeThreshold) { Debug.Log (title + ": Swipe Detected! LEFT"); _toggle.SetToggleState(0); _toggle.soundToPlay.Play(); swiped = true; } if (ptr.origPos.x - ptr.devicePos.x < -swipeThreshold) { Debug.Log (title + ": Swipe Detected! RIGHT"); _toggle.SetToggleState(1); _toggle.soundToPlay.Play(); swiped = true; } } } if (ptr.evt == POINTER_INFO.INPUT_EVENT.RELEASE || ptr.evt == POINTER_INFO.INPUT_EVENT.RELEASE_OFF) { swiped = false; // Debug.Log (title + ": Swiped = " + swiped); } }
private void OKBtnDelegate( ref POINTER_INFO ptr ) { if( ptr.evt == POINTER_INFO.INPUT_EVENT.TAP) { AsSoundManager.Instance.PlaySound( "Sound/Interface/S6002_EFF_Button", Vector3.zero, false); CloseDlg(); // send request reward server if( rewardType == eDesignationRewardType.Normal ) { body_CS_SUBTITLE_INDEX_REWARD subtitleIndexReward = new body_CS_SUBTITLE_INDEX_REWARD( designationID ); byte[] data = subtitleIndexReward.ClassToPacketBytes(); AsNetworkMessageHandler.Instance.Send( data); } else if( rewardType == eDesignationRewardType.Accrue ) { int nLastReceiveRewardRankPoint = AsDesignationRankRewardManager.Instance.LastReceiveRewardRankPoint; DesignationRankRewardData nextRankRewardData = AsDesignationRankRewardManager.Instance.GetNextRankRewardData (nLastReceiveRewardRankPoint); body_CS_SUBTITLE_ACCRUE_REWARD subtitleAccrueReward = new body_CS_SUBTITLE_ACCRUE_REWARD( nextRankRewardData.id ); byte[] data = subtitleAccrueReward.ClassToPacketBytes(); AsNetworkMessageHandler.Instance.Send( data); } AsDesignationManager.Instance.SendRequestReward = true; } }
public override void OnInput(ref POINTER_INFO ptr) { if (deleted) return; base.OnInput(ref ptr); if (!m_controlIsEnabled || IsHidden()) return; if (ptr.evt == whenToInvoke) { if (loadingPanel != null) { UIPanelManager mgr = (UIPanelManager)loadingPanel.Container; // Let us know when the panel is finished coming in: loadingPanel.AddTempTransitionDelegate(LoadSceneDelegate); if (mgr is UIPanelManager && mgr != null) { mgr.BringIn(loadingPanel); } else { loadingPanel.StartTransition(UIPanelManager.SHOW_MODE.BringInForward); } } else Invoke("DoLoadScene", delay); } }
private void MiracleBtnDelegate( ref POINTER_INFO ptr ) { if( ptr.evt == POINTER_INFO.INPUT_EVENT.TAP) { AsSoundManager.Instance.PlaySound( "Sound/Interface/S6110_EFF_MiracleBuy_Popup", Vector3.zero, false); if( AsUserInfo.Instance.nMiracle < costMiracle ) { string title = AsTableManager.Instance.GetTbl_String(1412); string content = AsTableManager.Instance.GetTbl_String(368); //KB if (AsGameMain.useCashShop == true) AsNotify.Instance.MessageBox(title, content, this, "OpenCashShop", AsNotify.MSG_BOX_TYPE.MBT_OKCANCEL, AsNotify.MSG_BOX_ICON.MBI_QUESTION); else AsNotify.Instance.MessageBox(title, content, AsNotify.MSG_BOX_TYPE.MBT_OK); } else { cosSynthesisDlg.ExcuteUpgrade( 0 , costMiracle ); } Close (); } }
protected override void ClickDelegate(ref POINTER_INFO pointer) { if (pointer.evt == GameValues.defaultInputEvent) { PopupManager.CreatePopup<FridgePopup>(); } }
private void FaceBookBtnDelegate( ref POINTER_INFO ptr) { if( ptr.evt == POINTER_INFO.INPUT_EVENT.TAP) { Debug.Log( "FaceBookBtnDelegate"); AsSoundManager.Instance.PlaySound( "Sound/Interface/S6002_EFF_Button", Vector3.zero, false); if (ArkQuestmanager.instance.CheckHaveOpenUIType(OpenUIType.OPEN_FACEBOOK) != null) AsCommonSender.SendClearOpneUI(OpenUIType.OPEN_FACEBOOK); if( AsSocialManager.Instance.IsLoginFacebook()) { if( AsSocialManager.Instance.getSessionPermissions()) AsSocialManager.Instance.PostMessageFacebook( m_strArticle, m_data.nCharUniqKey, m_data.nSubTitleIdx); else AsSocialManager.Instance.reauthorizeWithPublishPermissions(); // AsCommonSender.SendSocialHistoryRegister( m_data.nCharUniqKey, m_data.nSubTitleIdx, ( int)eSOCIAL_HISTORY_PLATFORM.eSOCIAL_HISTORY_PLATFORM_FACEBOOK); } else { Debug.Log( "FaceBookBtnDelegate::LoginFacebook()"); AsSocialManager.Instance.LoginFacebook(); } } }
void CoinButtonClickedDelegate(ref POINTER_INFO pointer) { if (pointer.evt == GameValues.defaultInputEvent) { ScreenLog.AddMessage("Coin And Cash Button Clicked"); } }
protected void DecreaseValueButtonDelegate(ref POINTER_INFO pointer) { if (pointer.evt == GameValues.defaultInputEvent) { HandleWeightValueChange(-10); } }
private void _OkBtnDelegate( ref POINTER_INFO ptr) { if( ptr.evt == POINTER_INFO.INPUT_EVENT.TAP) { if( null == goldField) return; if( true == _isDigit( goldField.Text)) { ulong nGold = Convert.ToUInt64( goldField.Text); if( nGold <= AsUserInfo.Instance.SavedCharStat.nGold) AsCommonSender.SendTradeRegistrationGold( nGold); else AsChatManager.Instance.InsertChat( AsTableManager.Instance.GetTbl_String(28), eCHATTYPE.eCHATTYPE_SYSTEM); // AsMessageManager.Instance.InsertMessage( AsTableManager.Instance.GetTbl_String(28)); } else { // AsMessageManager.Instance.InsertMessage( AsTableManager.Instance.GetTbl_String(70)); AsChatManager.Instance.InsertChat( AsTableManager.Instance.GetTbl_String(70), eCHATTYPE.eCHATTYPE_SYSTEM); } AsSoundManager.Instance.PlaySound( "Sound/Interface/S6002_EFF_Button", Vector3.zero, false); Close(); } }
protected virtual void YesButtonClicked(ref POINTER_INFO pointer) { if (pointer.evt == GameValues.defaultInputEvent) { Kill(); } }
void ConfirmBtnDelegate( ref POINTER_INFO ptr ) { if(CheckMsgBoxPopUp() == true) return; if( ptr.evt == POINTER_INFO.INPUT_EVENT.TAP) { AsSoundManager.Instance.PlaySound( "Sound/Interface/S6002_EFF_Button", Vector3.zero, false); if(textContent_.text == "") { // string name = AsUserInfo.Instance.GetCurrentUserEntity().GetProperty<string>(eComponentProperty.NAME); // textContent_.text = string.Format(AsTableManager.Instance.GetTbl_String(1231), name); } if(AsTableManager.Instance.TextFiltering_PStoreContent(textContent_.text) == true) { AsPStoreManager.Instance.SetContentText(textContent_.text); AsPStoreManager.Instance.Request_Modify(); Close(); ClearMsgBox(); } else { m_MsgBox = AsNotify.Instance.MessageBox("", AsTableManager.Instance.GetTbl_String(364), this, "", AsNotify.MSG_BOX_TYPE.MBT_OK, AsNotify.MSG_BOX_ICON.MBI_ERROR); } } }
void OnEventBtnClick( ref POINTER_INFO ptr) { if( ptr.evt == POINTER_INFO.INPUT_EVENT.TAP) { DestroyWindow(); } }
void ReturnToGymButtonDelegate(ref POINTER_INFO pointer) { if (pointer.evt == GameValues.defaultInputEvent) { LevelManager.LoadNewLevel("PersonalGym"); } }
private void LearnBtnDelegate( ref POINTER_INFO ptr ) { if( ptr.evt == POINTER_INFO.INPUT_EVENT.TAP) { if( false != AsHudDlgMgr.Instance.productionDlg.isOpenMessageBox ) return; string strTitle = AsTableManager.Instance.GetTbl_String( 126 ); //m_sbLearn.Remove( 0, m_sbLearn.Length ); //m_sbLearn.Append( string.Format( AsTableManager.Instance.GetTbl_String( 262 ), GetName(getProductTechType) ) ); //m_sbLearn.Append( GetTypeString( getProductTechType ) ); //m_sbLearn.Append( "\n" ); //m_sbLearn.Append( Color.red ); //m_sbLearn.Append( AsTableManager.Instance.GetTbl_String( 1334 ) ); //string strText = string.Format( AsTableManager.Instance.GetTbl_String( 262 ), GetName(getProductTechType) ) + "\n" + // Color.red.ToString() + AsTableManager.Instance.GetTbl_String( 1334 ); AsHudDlgMgr.Instance.productionDlg.SetMessageBox( AsNotify.Instance.MessageBox( strTitle, GetTypeString( getProductTechType ), this, "SendLearn", AsNotify.MSG_BOX_TYPE.MBT_OKCANCEL, AsNotify.MSG_BOX_ICON.MBI_QUESTION) ); AsSoundManager.Instance.PlaySound( "Sound/Interface/S6002_EFF_Button", Vector3.zero, false); } }
public override void OnInput(ref POINTER_INFO ptr) { base.OnInput(ref ptr); if (!m_controlIsEnabled || IsHidden()) return; if (ptr.evt == whenToInvoke) { if (loadingPanel != null) { UIPanelManager mgr = (UIPanelManager)loadingPanel.Container; if (mgr is UIPanelManager && mgr != null) { loadingPanel.SetTempTransitionDelegate(LoadSceneDelegate); mgr.BringIn(loadingPanel); } else { Debug.LogWarning("No panel manager found for panel \"" + loadingPanel.name + "\"!"); } } else Invoke("LoadScene", delay); } }
public override void OnInput(ref POINTER_INFO ptr) { base.OnInput(ref ptr); if (!m_controlIsEnabled) { return; } switch(ptr.evt) { case POINTER_INFO.INPUT_EVENT.PRESS: // Save this input point: prevPoint = GetLocalInputPoint(ptr.ray); break; case POINTER_INFO.INPUT_EVENT.DRAG: inputPoint = GetLocalInputPoint(ptr.ray); dist = inputPoint.x - prevPoint.x; // Save this as our previous point: prevPoint = inputPoint; newPos = transform.localPosition; newPos.x = Mathf.Clamp(newPos.x + dist, origPos.x, origPos.x + maxScrollPos); transform.localPosition = newPos; prevPoint.x = Mathf.Clamp(prevPoint.x, origPos.x - colliderExtent, origPos.x + colliderExtent + maxScrollPos); // Inform the slider that we've moved: slider.ScrollKnobMoved(this, GetScrollPos()); break; } }
void ButtonInputProcess( ref POINTER_INFO ptr) { if( ptr.evt == POINTER_INFO.INPUT_EVENT.TAP) { if (AsUserInfo.Instance.IsDied()) return; AsChatFullPanel.Instance.Close(); ArkQuest wantedQuest = ArkQuestmanager.instance.GetWantedQuest(); if( wantedQuest != null) { if (AsEntityManager.Instance.UserEntity.GetProperty<bool>(eComponentProperty.SHOP_OPENING) == true) AsNotify.Instance.MessageBox(AsTableManager.Instance.GetTbl_String(126), AsTableManager.Instance.GetTbl_String(365)); else { AsHudDlgMgr.Instance.OpenQuestAcceptUI(wantedQuest.GetQuestData(), true); CancelBlink(); } } else Debug.Log( "wanted quest is null"); } }
// Necessary input processing that is required // if the control is disabled: protected void DoNeccessaryInput(ref POINTER_INFO ptr) { switch (ptr.evt) { case POINTER_INFO.INPUT_EVENT.NO_CHANGE: if (list != null && ptr.active) list.ListDragged(ptr); break; case POINTER_INFO.INPUT_EVENT.DRAG: if (list != null && !ptr.isTap) list.ListDragged(ptr); break; case POINTER_INFO.INPUT_EVENT.TAP: case POINTER_INFO.INPUT_EVENT.RELEASE: case POINTER_INFO.INPUT_EVENT.RELEASE_OFF: if (list != null) list.PointerReleased(); break; } // Apply any mousewheel scrolling to our list: if (list != null && ptr.inputDelta.z != 0 && ptr.type != POINTER_INFO.POINTER_TYPE.RAY) { list.ScrollWheel(ptr.inputDelta.z); } if (Container != null) { ptr.callerIsControl = true; Container.OnInput(ptr); } }
void FriendButtonClickedDelegate(ref POINTER_INFO pointer) { if (pointer.evt == GameValues.defaultInputEvent) { ScreenLog.AddMessage("Friend Button Clicked", ScreenLogType.Warning); } }
void onInput(ref POINTER_INFO ptr) { if(_gestures == null) _gestures = GameObject.FindGameObjectWithTag("UserHitbox").GetComponent<Gestures>(); switch(ptr.evt) { case POINTER_INFO.INPUT_EVENT.PRESS: _gestures.onBeginTouch(); Debug.Log("STARTED TO HOVER!"); _hovering = true; break; case POINTER_INFO.INPUT_EVENT.NO_CHANGE: if(_hovering) { _hoverTime += Time.deltaTime; if(_hoverTime >= hoverTime) { _hovering = false; _hoverTime = 0; doHover(); } } break; default: _hovering = false; _hoverTime = 0; break; } }
private void ResetGame (ref POINTER_INFO ptr) { if(ptr.evt == POINTER_INFO.INPUT_EVENT.TAP) { PlayerPrefs.DeleteAll (); LevelLoader.Instance.LoadScene (LevelLoader.MENU); } }
private void BlockBtnDelegate( ref POINTER_INFO ptr) { if( ptr.evt == POINTER_INFO.INPUT_EVENT.TAP) { AsSoundManager.Instance.PlaySound( "Sound/Interface/S6002_EFF_Button", Vector3.zero, false); AsSocialManager.Instance.OpenBlockDlg( false); } }
protected virtual void ConfirmStoppingCurrentExcercise(ref POINTER_INFO pointer) { if (pointer.evt == GameValues.defaultInputEvent) { UserBase.I.StopCurrentExcercise(); LevelManager.LoadNewLevel("CompetitionArea"); } }
public void RadioBtnInput(ref POINTER_INFO ptr) { if (ptr.evt == POINTER_INFO.INPUT_EVENT.TAP) { AsSoundManager.Instance.PlaySound(AsSoundPath.ButtonClick, Vector3.zero, false); AddListItem(subCategories[(int)ptr.targetObj.Data]); } }
private void UnBlockBtnDelegate( ref POINTER_INFO ptr) { if( ptr.evt == POINTER_INFO.INPUT_EVENT.TAP) { AsCommonSender.SendBlockOutDelete( m_nUserUniqKey); AsSoundManager.Instance.PlaySound( "Sound/Interface/S6002_EFF_Button", Vector3.zero, false); } }
private void _BtnDelegate_Cancel(ref POINTER_INFO ptr) { if( ptr.evt == POINTER_INFO.INPUT_EVENT.TAP) { AsSoundManager.Instance.PlaySound( "Sound/Interface/S6002_EFF_Button", Vector3.zero, false); Close(); } }
private void CloseBtnDelegate( ref POINTER_INFO ptr ) { if( ptr.evt == POINTER_INFO.INPUT_EVENT.TAP) { AsSoundManager.Instance.PlaySound( "Sound/Interface/S6002_EFF_Button", Vector3.zero, false); AsHudDlgMgr.Instance.CloseRandItemUI(); } }
void OnIconClicked(ref POINTER_INFO ptr) { if(ptr.evt == POINTER_INFO.INPUT_EVENT.TAP) { AsEmotionManager.Instance.ButtonClicked(); Destroy(gameObject); } }
private void Catch (ref POINTER_INFO ptr) { if(ptr.evt == POINTER_INFO.INPUT_EVENT.PRESS || ptr.evt == POINTER_INFO.INPUT_EVENT.TAP) { fishingManager.Catch (); counter.Text = fishingManager.ItemsCatched.ToString (); } }
//--------------------------------------------------- // Input handling: //--------------------------------------------------- public override void OnInput(ref POINTER_INFO ptr) { if (deleted) { return; } if (!m_controlIsEnabled) { base.OnInput(ref ptr); return; } if (inputDelegate != null) { inputDelegate(ref ptr); } // Check to see if we're disabled or hidden again in case // we were disabled by an input delegate: if (!m_controlIsEnabled) { base.OnInput(ref ptr); return; } if (ptr.evt == POINTER_INFO.INPUT_EVENT.TAP) { ToggleState(); if (soundToPlay != null) { soundToPlay.PlayOneShot(soundToPlay.clip); } } // Toggle if the required event occurred: if (ptr.evt == whenToInvoke) { if (scriptWithMethodToInvoke != null) { scriptWithMethodToInvoke.Invoke(methodToInvoke, delay); } } base.OnInput(ref ptr); }
private void decodeTouches(uint msg, IntPtr wParam, IntPtr lParam) { lock ( tracking ) { int xPos = LOWORD(lParam.ToInt32()); int yPos = HIWORD(lParam.ToInt32()); int pointerId = LOWORD(wParam.ToInt32()); POINTER_INFO pointerInfo = new POINTER_INFO(); if (!GetPointerInfo(pointerId, ref pointerInfo)) { return; } POINT p = new POINT() { X = xPos, Y = yPos }; ScreenToClient(hMainWindow, ref p); int existingId; switch (msg) { case WM_POINTERDOWN: winToInternalId.Add(pointerId, beginTouch(new Vector2(p.X, Screen.height - p.Y))); break; case WM_POINTERUP: if (winToInternalId.TryGetValue(pointerId, out existingId)) { winToInternalId.Remove(pointerId); endTouch(existingId); } break; case WM_POINTERUPDATE: if (winToInternalId.TryGetValue(pointerId, out existingId)) { moveTouch(existingId, new Vector2(p.X, Screen.height - p.Y)); } break; } } }
public void OnFillButton(ref POINTER_INFO eventPointer) { if (eventPointer.evt == POINTER_INFO.INPUT_EVENT.TAP) { VesselCrewManifest manifest = CMAssignmentDialog.Instance.GetManifest(); Logging.Debug("Attempting to fill..."); foreach (PartCrewManifest partManifest in manifest.GetCrewableParts()) { Logging.Debug("Attempting to fill part - " + partManifest.PartInfo.name); bool vets = (partManifest == manifest.GetCrewableParts()[0]) ? true : false; partManifest.AddCrewToOpenSeats(CrewQueue.Instance.GetCrewForPart(partManifest.PartInfo.partPrefab, manifest.GetAllCrew(false), vets)); } CMAssignmentDialog.Instance.RefreshCrewLists(manifest, true, true); } }
bool DragCamera(POINTER_INFO ptr) { if (Input.touchCount > 1) { return(false); } Vector3 worldPos = Vector3.zero; if (!CalcluateGroundPos(ptr.ray, ref worldPos, "Water")) { return(false); } switch (ptr.evt) { case POINTER_INFO.INPUT_EVENT.PRESS: ClickWorldPos = worldPos; break; case POINTER_INFO.INPUT_EVENT.DRAG: if (DragState == TOUCH_STATE.DRAG) { ClickWorldPos = worldPos; DragState = TOUCH_STATE.NONE; break; } worldPos.y = ClickWorldPos.y; DragWorldPos = worldPos; if (!ReversAction) { DragMovement = ClickWorldPos - DragWorldPos; } else { ClickWorldPos += (DragWorldPos - ClickWorldPos) * 2f; } break; } return(true); }
void scrollListInputDelegate(ref POINTER_INFO ptr) { if (ptr.evt == POINTER_INFO.INPUT_EVENT.MOVE) { if (!panelIsShowing) { panel.BringIn(); panelIsShowing = true; } } else if (ptr.evt == POINTER_INFO.INPUT_EVENT.MOVE_OFF) { if (panelIsShowing) { panel.Dismiss(); panelIsShowing = false; } } }
public override void OnInput(ref POINTER_INFO ptr) { if (deleted) { return; } base.OnInput(ref ptr); if (!m_controlIsEnabled || IsHidden()) { return; } if (ptr.evt == whenToInvoke) { Invoke("DoURL", delay); } }
void OnGemCombineMatRelease(ref POINTER_INFO ptr) { if (ptr.evt == POINTER_INFO.INPUT_EVENT.TAP) { string parentName = ptr.targetObj.gameObject.name; if (mCombineGemMatsIndex.ContainsKey(parentName)) { int nIndex = mCombineGemMatsIndex[parentName]; int nId = mGemCombineSelectedIDs[nIndex]; CObject_Item gemItem = CDataPool.Instance.UserBag_GetItemById(nId); if (gemItem != null) { gemItem.isLocked = false; } mGemCombineSelectedIDs.RemoveAt(nIndex); UpdateGemMaterials(); } } }
void levelUpInputDelegate(ref POINTER_INFO ptr) { if (ptr.evt == POINTER_INFO.INPUT_EVENT.TAP) { Transform parent = ptr.targetObj.gameObject.transform.parent; ActionButton actionBtn = parent.FindChild("Icon").gameObject.GetComponent <ActionButton>(); if (actionBtn != null) { CActionItem_Skill skillAction = actionBtn.CurrActionItem as CActionItem_Skill; if (skillAction != null) { SCLIENT_SKILL skill = skillAction.GetImpl() as SCLIENT_SKILL; if (skill != null) { CDataPool.Instance._StudySkill.SendStudySkillEvent(skill.m_pDefine.m_nSkillClass, skill.m_pDefine.m_nMenPai, 1); } } } } }
public void ItemsInputDelegate(ref POINTER_INFO ptr) { if (itemInputDelegate != null) { switch (ptr.evt) { case POINTER_INFO.INPUT_EVENT.NO_CHANGE: break; case POINTER_INFO.INPUT_EVENT.PRESS: break; case POINTER_INFO.INPUT_EVENT.RELEASE: break; case POINTER_INFO.INPUT_EVENT.TAP: { if (ptr.hitInfo.collider.gameObject != null) { itemInputDelegate(ptr.hitInfo.collider.gameObject.name); } } break; case POINTER_INFO.INPUT_EVENT.MOVE: break; case POINTER_INFO.INPUT_EVENT.MOVE_OFF: break; case POINTER_INFO.INPUT_EVENT.RELEASE_OFF: break; case POINTER_INFO.INPUT_EVENT.DRAG: break; default: break; } } }
void OnEnchanseTakeOff(ref POINTER_INFO ptr) { if (ptr.evt == POINTER_INFO.INPUT_EVENT.TAP) { string name = ptr.targetObj.name; string index = name.Remove(0, 2); int nIndex = int.Parse(index) - 1; if (nIndex >= 0 && nIndex < mEnchanseGemInfo.Length) { if (mEnchanseGemInfo[nIndex].bFlag == GEM_ENCHANSE) { CObject_Item gem = CDataPool.Instance.UserBag_GetItemById(mEnchanseGemInfo[nIndex].nGemType); if (gem != null) { gem.isLocked = false; } // 直接清除显示 [5/3/2012 SUN] ActionButton gemAction = mEnchanseGemInfo[nIndex].enchanseGem; if (gemAction.CurrActionItem != null) { gemAction.CurrActionItem.DestroyImpl(); } gemAction.SetActionItem(-1); gemAction.SetMaskTexture(""); mEnchanseGemInfo[nIndex].bFlag = GEM_NONE; mEnchanseGemInfo[nIndex].nGemType = -1; } else if (mEnchanseGemInfo[nIndex].enchanseGem.CurrActionItem != null) { mEnchanseGemInfo[nIndex].bFlag = GEM_TAKEOFF; mEnchanseGemInfo[nIndex].nGemType = -1; } UpdateEnchanseGemStates(); } //todo update takeoff selected } }
public void handlerInput(ref POINTER_INFO ptr) { if (ptr.evt == POINTER_INFO.INPUT_EVENT.MOVE) { Transform parent = ptr.targetObj.gameObject.transform.parent; ActionButton actionBtn = parent.FindChild("Icon").gameObject.GetComponent <ActionButton>(); if (actionBtn != null && actionBtn.CurrActionItem != null) { actionBtn.CurrActionItem.NotifyTooltipsShow(); } } else if (ptr.evt == POINTER_INFO.INPUT_EVENT.MOVE_OFF) { Transform parent = ptr.targetObj.gameObject.transform.parent; ActionButton actionBtn = parent.FindChild("Icon").gameObject.GetComponent <ActionButton>(); if (actionBtn != null && actionBtn.CurrActionItem != null) { actionBtn.CurrActionItem.NotifyTooltipsHide(); } } }
public void Copy(POINTER_INFO ptr) { this.type = ptr.type; this.camera = ptr.camera; this.id = ptr.id; this.fingerID = ptr.fingerID; this.actionID = ptr.actionID; this.evt = ptr.evt; this.active = ptr.active; this.devicePos = ptr.devicePos; this.origPos = ptr.origPos; this.inputDelta = ptr.inputDelta; this.ray = ptr.ray; this.prevRay = ptr.prevRay; this.rayDepth = ptr.rayDepth; this.isTap = ptr.isTap; this.targetObj = ptr.targetObj; this.layerMask = ptr.layerMask; this.hitInfo = ptr.hitInfo; this.clickTime = ptr.clickTime; }
public override void OnInput(ref POINTER_INFO ptr) { if (this.deleted) { return; } if (!this.m_controlIsEnabled || base.IsHidden()) { base.OnInput(ref ptr); return; } if (this.repeat) { NrTSingleton <UIManager> .Instance.RayActive = ((base.controlState != UIButton.CONTROL_STATE.ACTIVE) ? UIManager.RAY_ACTIVE_STATE.Inactive : UIManager.RAY_ACTIVE_STATE.Constant); } else if (ptr.evt == this.whenToInvoke) { NrTSingleton <UIManager> .Instance.RayActive = UIManager.RAY_ACTIVE_STATE.Momentary; } base.OnInput(ref ptr); }
void OptionClick(ref POINTER_INFO ptr) { if (ptr.hitInfo.collider == null || ptr.hitInfo.collider.gameObject == null) { return; } switch (ptr.evt) { case POINTER_INFO.INPUT_EVENT.NO_CHANGE: break; case POINTER_INFO.INPUT_EVENT.PRESS: break; case POINTER_INFO.INPUT_EVENT.RELEASE: break; case POINTER_INFO.INPUT_EVENT.TAP: if (opInputDelegate != null) { opInputDelegate(ptr.hitInfo.collider.gameObject.name); } break; case POINTER_INFO.INPUT_EVENT.MOVE: break; case POINTER_INFO.INPUT_EVENT.MOVE_OFF: break; case POINTER_INFO.INPUT_EVENT.RELEASE_OFF: break; case POINTER_INFO.INPUT_EVENT.DRAG: break; default: break; } }
// Necessary input processing that is required // if the control is disabled: protected void DoNeccessaryInput(ref POINTER_INFO ptr) { switch (ptr.evt) { case POINTER_INFO.INPUT_EVENT.NO_CHANGE: if (list != null && ptr.active) { list.ListDragged(ptr); } break; case POINTER_INFO.INPUT_EVENT.DRAG: if (list != null && !ptr.isTap) { list.ListDragged(ptr); } break; case POINTER_INFO.INPUT_EVENT.TAP: case POINTER_INFO.INPUT_EVENT.RELEASE: case POINTER_INFO.INPUT_EVENT.RELEASE_OFF: if (list != null) { list.PointerReleased(); } break; } // Apply any mousewheel scrolling to our list: if (list != null && ptr.inputDelta.z != 0 && ptr.type != POINTER_INFO.POINTER_TYPE.RAY) { list.ScrollWheel(ptr.inputDelta.z); } if (Container != null) { ptr.callerIsControl = true; Container.OnInput(ptr); } }
public void InputDelegate(ref POINTER_INFO ptr, MechanismType mechanismType) { if (!_inputEnabled) { return; } switch (ptr.evt) { case POINTER_INFO.INPUT_EVENT.PRESS: LevelManager.instance.CreateMechanismForDragging(mechanismType); break; case POINTER_INFO.INPUT_EVENT.TAP: case POINTER_INFO.INPUT_EVENT.RELEASE: case POINTER_INFO.INPUT_EVENT.RELEASE_OFF: // GameManager.instance.UnSelecteMechanistIcon(); break; } BackgroundInputCatcher.Catcher.InputDelegate(ref ptr); }
// Necessary input processing that is required // if the control is disabled: protected void DoNeccessaryInput(ref POINTER_INFO ptr) { switch (ptr.evt) { case POINTER_INFO.INPUT_EVENT.NO_CHANGE: case POINTER_INFO.INPUT_EVENT.DRAG: list.ListDragged(ptr); break; case POINTER_INFO.INPUT_EVENT.TAP: case POINTER_INFO.INPUT_EVENT.RELEASE: case POINTER_INFO.INPUT_EVENT.RELEASE_OFF: list.PointerReleased(); break; } if (Container != null) { ptr.callerIsControl = true; Container.OnInput(ptr); } }
internal void OnInput(ref POINTER_INFO ptr) { switch (ptr.evt) { case POINTER_INFO.INPUT_EVENT.PRESS: if (Input.GetMouseButtonDown(0)) { // Left button press // If the player left clicks then we assume they are placing a part (We don't bother to figure out if its valid or not) // so we unlock our window TestFlightEditorWindow.Instance.UnlockPart(); } else if (Input.GetMouseButtonDown(1)) { // Right button press // On a right click we have one of three things to do // 1. If the window is unlocked, lock it on the current item // 2. If the window is curently locked, and this is the same item it was locked on, unlock it // 3. If the window is currently locked and this is a different item, lock it to that one instead TestFlightEditorWindow.Instance.LockPart(selectedPart.partPrefab); } break; case POINTER_INFO.INPUT_EVENT.MOVE: if (!mouseFlag) { mouseFlag = true; TestFlightEditorWindow.Instance.SelectedPart = selectedPart.partPrefab; // TestFlightEditorWindow.Instance.Visible = true; } break; case POINTER_INFO.INPUT_EVENT.MOVE_OFF: mouseFlag = false; TestFlightEditorWindow.Instance.SelectedPart = null; // TestFlightEditorWindow.Instance.Visible = false; break; } }
public override void OnInput(ref POINTER_INFO ptr) { base.OnInput(ref ptr); if (knob != null) { if (ptr.evt != POINTER_INFO.INPUT_EVENT.PRESS) { return; } Vector3 newPos = knob.GetLocalInputPoint(ptr.ray); float scrollPos = (newPos.x - knob.GetstartPos().x) / knob.GetMaxScroll(); Value = scrollPos; UIManager.instance.Retarget(this, knob); knob.OnInput(ref ptr); } }
public bool PreFilterMessage(ref Message m) { switch (m.Msg) { case WM_POINTERDOWN: case WM_POINTERUP: case WM_POINTERUPDATE: case WM_POINTERCAPTURECHANGED: int pointerID = GET_POINTER_ID(m.WParam); POINTER_INFO pi = new POINTER_INFO(); if (GetPointerInfo(pointerID, ref pi)) { // Not a primary pointer => filter ! if ((pi.PointerFlags & POINTER_FLAGS.PRIMARY) == 0) { return true; } } break; } return false; }
public void InputDelegate(POINTER_INFO ptr) { switch (ptr.evt) { case POINTER_INFO.INPUT_EVENT.NO_CHANGE: break; case POINTER_INFO.INPUT_EVENT.RELEASE: break; //case POINTER_INFO.INPUT_EVENT.DRAG: case POINTER_INFO.INPUT_EVENT.PRESS: case POINTER_INFO.INPUT_EVENT.TAP: { if (ptr.hitInfo.collider != null) { GameObject hitGo = ptr.hitInfo.collider.gameObject.transform.root.gameObject; UIWindowMng.Instance.BringWindowForward(hitGo.name); } } break; case POINTER_INFO.INPUT_EVENT.MOVE: { // 检测是否有超链接点击到 CurrHyperlink = CheckHyperHover(ptr.hitInfo); } break; case POINTER_INFO.INPUT_EVENT.MOVE_OFF: break; case POINTER_INFO.INPUT_EVENT.RELEASE_OFF: break; default: break; } }
//--------------------------------------------------- // Input handling: //--------------------------------------------------- public override void OnInput(ref POINTER_INFO ptr) { if (deleted) { return; } if (!m_controlIsEnabled || IsHidden()) { base.OnInput(ref ptr); return; } if (inputDelegate != null) { inputDelegate(ref ptr); } // Check to see if we're disabled or hidden again in case // we were disabled by an input delegate: if (!m_controlIsEnabled || IsHidden()) { base.OnInput(ref ptr); return; } // See if we got the focus if (ptr.evt == customFocusEvent) { // Call our focus delegate if (focusDelegate != null) { focusDelegate(this); } } base.OnInput(ref ptr); }
public override void OnInput(ref POINTER_INFO ptr) { if (deleted) { return; } base.OnInput(ref ptr); if (!m_controlIsEnabled || IsHidden()) { return; } if (ptr.evt == whenToInvoke) { if (loadingPanel != null) { UIPanelManager mgr = (UIPanelManager)loadingPanel.Container; // Let us know when the panel is finished coming in: loadingPanel.AddTempTransitionDelegate(LoadSceneDelegate); if (mgr is UIPanelManager && mgr != null) { mgr.BringIn(loadingPanel); } else { loadingPanel.StartTransition(UIPanelManager.SHOW_MODE.BringInForward); } } else { Invoke("DoLoadScene", delay); } } }
public override void OnInput(ref POINTER_INFO ptr) { if (this.deleted) { return; } this.internalCall = true; base.OnInput(ref ptr); if (!this.m_controlIsEnabled || base.IsHidden()) { return; } if (this.panel == null) { return; } if (ptr.evt == this.whenToInvoke) { this.DoPanelStuff(); MsgHandler.Handle("ToolbarSound", new object[0]); } this.internalCall = false; }
protected void PanelClicked(POINTER_INFO ptr) { // If this is the same action to which we've // already responded, ignore: if (ptr.actionID == lastActionID) { return; } else { lastActionID = ptr.actionID; } // Is this a click from a child? if (ptr.callerIsControl) { // If we're hideAtStart, see if we should show: if (m_panelState == STATE.HIDDEN && showOnChildClick) { SetPanelState(STATE.SHOWING); } // If we're showing, see if we should dismiss: else if (m_panelState == STATE.SHOWING && dismissOnChildClick) { SetPanelState(STATE.HIDDEN); } return; } if (alwaysShowOnClick) { SetPanelState(STATE.SHOWING); } else { ToggleState(); } }
void OnMouseLevelUpEquipt(ref POINTER_INFO ptr) { switch (ptr.evt) { case POINTER_INFO.INPUT_EVENT.TAP: { if (ptr.hitInfo.collider != null && ptr.hitInfo.collider.gameObject != null) { if (ptr.hitInfo.collider.gameObject.name == "BodyLevelUp") { OpenLevelUpEquipt(mCurrentRoleType, PET_EQUIP.PEQUIP_KNOCKER); } else if (ptr.hitInfo.collider.gameObject.name == "ClawLevelUp") { OpenLevelUpEquipt(mCurrentRoleType, PET_EQUIP.PEQUIP_CLAW); } else if (ptr.hitInfo.collider.gameObject.name == "HeadLevelUp") { OpenLevelUpEquipt(mCurrentRoleType, PET_EQUIP.PEQUIP_HORN); } else if (ptr.hitInfo.collider.gameObject.name == "SpurLevelUp") { OpenLevelUpEquipt(mCurrentRoleType, PET_EQUIP.PEQUIP_SPUR); } else if (ptr.hitInfo.collider.gameObject.name == "TattooLevelUp") { OpenLevelUpEquipt(mCurrentRoleType, PET_EQUIP.PEQUIP_VEINS); } else if (ptr.hitInfo.collider.gameObject.name == "RingLevelUp") { OpenLevelUpEquipt(mCurrentRoleType, PET_EQUIP.PEQUIP_KNOCKER); } } } break; } }
public override void OnInput(ref POINTER_INFO ptr) { base.OnInput(ref ptr); if (!this.m_controlIsEnabled) { return; } switch (ptr.evt) { case POINTER_INFO.INPUT_EVENT.MOVE_OFF: if (null != this.list) { this.list.overList = false; } break; case POINTER_INFO.INPUT_EVENT.MOUSE_WHEEL: if (null != this.list) { this.list.overList = true; } break; } }
void ItemDragDelegate(ref POINTER_INFO ptr) { switch (ptr.evt) { case POINTER_INFO.INPUT_EVENT.TAP: { ItemClick(ptr.hitInfo.collider.gameObject); HideTooltip(); } break; case POINTER_INFO.INPUT_EVENT.MOVE: { ShowTooltip(ptr.hitInfo.collider.gameObject); } break; case POINTER_INFO.INPUT_EVENT.DRAG: { HideTooltip(); } break; case POINTER_INFO.INPUT_EVENT.MOVE_OFF: { if (ptr.hitInfo.collider == null || ptr.hitInfo.collider.gameObject.name != lastWinName) { HideTooltip(); } } break; default: break; } }
protected void ClickListener(POINTER_INFO ptr) { if (ptr.evt != POINTER_INFO.INPUT_EVENT.PRESS) { return; } if (ptr.targetObj == null && this.dismissOnOutsideClick) { this.SetPanelState(UIBistateInteractivePanel.STATE.HIDDEN); return; } if (!this.dismissOnPeerClick) { return; } if (ptr.targetObj is Component && ((Component)ptr.targetObj).transform.IsChildOf(base.transform)) { return; } if (this.dismissOnPeerClick) { this.SetPanelState(UIBistateInteractivePanel.STATE.HIDDEN); } }
public override void OnInput(ref POINTER_INFO ptr) { if (this.deleted) { return; } if (!this.m_controlIsEnabled || base.IsHidden()) { base.OnInput(ref ptr); return; } if (this.inputDelegate != null) { this.inputDelegate(ref ptr); } if (!this.m_controlIsEnabled || base.IsHidden()) { base.OnInput(ref ptr); return; } if (ptr.evt == this.customFocusEvent) { Color color = this.color; color.a = 1f; this.SetColor(color); if (this.focusDelegate != null) { this.focusDelegate(this); } } if (ptr.evt == POINTER_INFO.INPUT_EVENT.PRESS) { this.PositionInsertionPoint(ptr.hitInfo.point); } base.OnInput(ref ptr); }