public async Task CreatedWithCorrectButtonType() { var imageButton = new ImageButton(); UIButtonType buttonType = await GetControlProperty(imageButton, uiButton => uiButton.ButtonType); Assert.AreNotEqual(UIButtonType.Custom, buttonType); }
public void OnPointerDown(PointerEventData eventData) { if (nIndex < (int)ENACHIEVE.ENACHIEVE_ADDVALUE) { UIUtil.ShowSystemMessage(EMChatTipID.CHAT_TIP_PLAYER_ADDVALUE_HAS_NO_SINGLE_WAR); return; } if (lWarID == 0) { UIUtil.ShowSystemMessage(EMChatTipID.CHAT_TIP_PLAYER_VALUE_HAS_NO_SOURCE); return; } UIButtonType ButtonType = new UIButtonType((int)PlayerSubWndType.WND_WAR); ButtonType.bIsRequestSelf = LogicDataCenter.playerSystemDataManager.bRequestSelf; ButtonType.nRequestPDBID = LogicDataCenter.playerSystemDataManager.nRequestPDBID; UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_PLAYERBUTTONFRAME_OPENFRAME, ButtonType); WarStatisticViewSingleWarData data = new WarStatisticViewSingleWarData(); data.msgID = (int)WndMsgID.WND_MSG_PLAYERWARSTATISTIC_VIEWSINGLEWAR; data.nEntryType = (int)ViewSingleWarType.VSWT_HONORWND; data.lWarID = lWarID; UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_PLAYERWARSTATISTIC_VIEWSINGLEWAR, data); }
// 战队提示 private void UpdateKinButton() { if (EntityFactory.MainHeroView == null) { return; } int playerLv = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_LEVEL); bool bHasKin = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_KIN) == 0 ? false : true; SSchemeSideButtonInfo config = SideButtonConfig.Instance.GetSideButtonConfig((int)ESideButtonItemType.ESBT_JoinKin); if (!bHasKin && playerLv >= config.nLowLv && playerLv <= config.nHighLv) { SideButtonListAddData addMsg = new SideButtonListAddData(); addMsg.nItemID = (int)ESideButtonItemType.ESBT_JoinKin; addMsg.nButtonIconID = config.nIconID; addMsg.strButtonText = config.strName; addMsg.strTooltip = config.strHint; addMsg.sCustomData = null; addMsg.callBack = (customData) => { UIButtonType ButtonType = new UIButtonType((int)SocialFrameButtonType.BTN_KIN); UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_SOCIALTOPSIDEBUTTON_OPEN, ButtonType); }; LogicDataCenter.sideButtonDataManager.AddItem(addMsg); } else { SideButtonListRemoveData removeMsg = new SideButtonListRemoveData(); removeMsg.nItemID = (int)ESideButtonItemType.ESBT_JoinKin; LogicDataCenter.sideButtonDataManager.RemoveItem(removeMsg); } }
// 符文提示 private void UpdateRuneButton() { if (EntityFactory.MainHeroView == null) { return; } int playerLv = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_LEVEL); bool bRuneShow = IsNeedShowRuneAddTip(); SSchemeSideButtonInfo config = SideButtonConfig.Instance.GetSideButtonConfig((int)ESideButtonItemType.ESBT_SetRune); if (bRuneShow && playerLv >= config.nLowLv && playerLv <= config.nHighLv) { SideButtonListAddData addMsg = new SideButtonListAddData(); addMsg.nItemID = (int)ESideButtonItemType.ESBT_SetRune; addMsg.nButtonIconID = config.nIconID; addMsg.strButtonText = config.strName; addMsg.strTooltip = config.strHint; addMsg.sCustomData = null; addMsg.callBack = (customData) => { UIButtonType ButtonType = new UIButtonType((int)PlayerSubWndType.WND_RUNE); ButtonType.bIsRequestSelf = true; ButtonType.nRequestPDBID = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID); UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_PLAYERBUTTONFRAME_OPENFRAME, ButtonType); }; LogicDataCenter.sideButtonDataManager.AddItem(addMsg); } else { SideButtonListRemoveData removeMsg = new SideButtonListRemoveData(); removeMsg.nItemID = (int)ESideButtonItemType.ESBT_SetRune; LogicDataCenter.sideButtonDataManager.RemoveItem(removeMsg); } }
public void SimulateOpenView(ESimulateOpenViewType eSimulateOpenViewType) { switch (eSimulateOpenViewType) { case ESimulateOpenViewType.ESOP_SHOP: { PointShopOpenData uiData = new PointShopOpenData(); uiData.nPageType = (int)PointShopPageBtnType.PageBtn_Chest; UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_POINTSHOP_OPEN, uiData); } break; case ESimulateOpenViewType.ESOP_PLAYER_HERO: { UIButtonType ButtonType = new UIButtonType((int)PlayerSubWndType.WND_PLAYER); ButtonType.bIsRequestSelf = true; ButtonType.nRequestPDBID = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID); UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_PLAYERBUTTONFRAME_OPENFRAME, ButtonType); } break; case ESimulateOpenViewType.ESOP_WAR_MAIN: { onWarHillPressDwon(); } break; default: break; } return; }
// 联盟提示 public void UpdateClanButton() { if (EntityFactory.MainHeroView == null) { return; } int playerLv = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_LEVEL); bool bHasClan = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_CLAN) == 0 ? false : true; cmd_kin_self_hero_member info = LogicDataCenter.kinDataManager.SelfMemberInfo; bool bIsShaikh = info.nIdentity == (int)TKinIdentity.emKinIdentity_Shaikh ? true : false; SSchemeSideButtonInfo config = SideButtonConfig.Instance.GetSideButtonConfig((int)ESideButtonItemType.ESBT_JoinClan); if (bIsShaikh && !bHasClan && playerLv >= config.nLowLv && playerLv <= config.nHighLv) { SideButtonListAddData addMsg = new SideButtonListAddData(); addMsg.nItemID = (int)ESideButtonItemType.ESBT_JoinClan; addMsg.nButtonIconID = config.nIconID; addMsg.strButtonText = config.strName; addMsg.strTooltip = config.strHint; addMsg.sCustomData = null; addMsg.callBack = (customData) => { UIButtonType ButtonType = new UIButtonType((int)SocialFrameButtonType.BTN_CLAN); UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_SOCIALTOPSIDEBUTTON_OPEN, ButtonType); }; LogicDataCenter.sideButtonDataManager.AddItem(addMsg); } else { SideButtonListRemoveData removeMsg = new SideButtonListRemoveData(); removeMsg.nItemID = (int)ESideButtonItemType.ESBT_JoinClan; LogicDataCenter.sideButtonDataManager.RemoveItem(removeMsg); } }
static UIButton FromType(UIButtonType buttonType) { var b = UIButton.FromType(buttonType); //additional customization here return(b); }
public void onGenstoneClick() { UIButtonType ButtonType = new UIButtonType((int)PlayerSubWndType.WND_CROWN); ButtonType.bIsRequestSelf = true; ButtonType.nRequestPDBID = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID); UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_PLAYERBUTTONFRAME_OPENFRAME, ButtonType); }
public void OnScreenshortBtnClick() { Debug.LogFormat("OnScreenshortBtnClick"); UIButtonType buttonType = new UIButtonType((int)PlayerFrame.PlayerSubWndType.WND_MOMENT); UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_PLAYERBUTTONFRAME_OPENFRAME, buttonType); m_masterVeiw.SetVisible(false); }
static MyButton FromType(UIButtonType buttonType) { var b = new MyButton(new RectangleF(0, 0, 200, 40)); b.SetTitle("My Button", UIControlState.Normal); //additional customization here return(b); }
private void OnCallBack() { // 观察角色功能 UIButtonType ButtonType = new UIButtonType((int)PlayerSubWndType.WND_PLAYER); int nSelfID = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID); ButtonType.bIsRequestSelf = (nSelfID == m_nActorID); ButtonType.nRequestPDBID = m_nActorID; UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_PLAYERBUTTONFRAME_OPENFRAME, ButtonType); }
// 战绩链接 public void OnClickWarRecordRT(string eventName) { if (eventName == "WarRecord") { UIButtonType ButtonType = new UIButtonType((int)PlayerSubWndType.WND_WAR); int nActorID = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID); ButtonType.bIsRequestSelf = (nActorID == m_unfoldTask.nPublishPDBID); ButtonType.nRequestPDBID = m_unfoldTask.nPublishPDBID; UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_PLAYERBUTTONFRAME_OPENFRAME, ButtonType); WarStatisticViewSingleWarData uiData = new WarStatisticViewSingleWarData(); uiData.nEntryType = (int)ViewSingleWarType.VSWT_CHATWND; uiData.lWarID = m_unfoldTask.llTagID; UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_PLAYERWARSTATISTIC_VIEWSINGLEWAR, uiData); } }
public void JumpToPlayerWarView(Int64 nDBWarID) { if (EntityFactory.MainHeroView == null || EntityFactory.MainHeroView.Property == null) { return; } UIButtonType ButtonType = new UIButtonType((int)PlayerSubWndType.WND_WAR); int nActorID = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID); ButtonType.bIsRequestSelf = true; ButtonType.nRequestPDBID = nActorID; UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_PLAYERBUTTONFRAME_OPENFRAME, ButtonType); WarStatisticViewActorWarData data = new WarStatisticViewActorWarData(); data.msgID = (int)WndMsgID.WND_MSG_PLAYERWARSTATISTIC_VIEWACTORWAR; data.nActorID = nActorID; data.lWarID = nDBWarID; UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_PLAYERWARSTATISTIC_VIEWACTORWAR, data); }
private void OnMsgOpenFrame(UIMsgData data) { UIButtonType buttonType = (UIButtonType)data; LogicDataCenter.playerSystemDataManager.bRequestSelf = buttonType.bIsRequestSelf; LogicDataCenter.playerSystemDataManager.nRequestPDBID = buttonType.nRequestPDBID; LogicDataCenter.playerSystemDataManager.bFake = buttonType.bFake; // 造假数据 if (buttonType.bFake) { LogicDataCenter.playerSystemDataManager.strCurFakeName = buttonType.strFakeName; } m_wndView.SetRuneBtnState(); if (buttonType.nType == (int)PlayerSubWndType.WND_CROWN) { m_wndView.OnRuneBtnClick(true); } else { m_wndView.SwitchWndPage((PlayerFrameBtnType)buttonType.nType); } }
public DisiplayAlertButton(UIButtonType type) : base(type) { }
public UIButton(UIButtonType type) : base(ObjCRuntime.Messaging.IntPtr_objc_msgSend_int(class_ptr, Selector.GetHandle("buttonWithType:"), (int)type)) { VerifyIsUIButton(); }
public ButtonSolve(UIButtonType type) : base(type) { Initialize(); }
public static UIButton CreateButton(this object _, UIButtonType type = UIButtonType.Custom) => new(type);
public NWButton(UIButtonType type) : base(type) { Initialize(); }
public void checkAllHeroIsHaveCanUpStar(int nCurGold = 0) { if (EntityFactory.MainHeroView == null) { return; } int dwPDBID = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID); ActorHeroInfo heroInfo = null; if (!actorHero.TryGetValue(dwPDBID, out heroInfo)) { return; } int nHaveGold = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_GOLD); nHaveGold = nCurGold > 0 ? nCurGold : nHaveGold; bool bCanUpstar = false; foreach (var item in heroInfo.dicEntityHeroInfo) { if (item.Value.bIsBuy <= 0) { continue; } SHeroStarSchemeInfo pStarScheme = new SHeroStarSchemeInfo(); if (!GameLogicAPI.getHeroStarConfig(item.Value.nHeroID, item.Value.byStarLv, ref pStarScheme)) { continue; } if (item.Value.byStarLv >= pStarScheme.nLimitLV) { continue; } bool bIsLifeHero = LogicDataCenter.lifeHeroDataManager.AllLifeHero.ContainsKey(item.Value.nHeroID); int nNeedCard = bIsLifeHero && pStarScheme.nCardDiscount > 0 ? pStarScheme.nCardDiscount : pStarScheme.nNeedCount; int nNeedGold = bIsLifeHero && pStarScheme.nGoldDiscount > 0 ? pStarScheme.nGoldDiscount : pStarScheme.nExpendGold; if (nNeedCard > item.Value.nCardCount || nNeedGold > nHaveGold) { continue; } bCanUpstar = true; break; } int playerLv = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_LEVEL); SSchemeSideButtonInfo config = SideButtonConfig.Instance.GetSideButtonConfig((int)ESideButtonItemType.ESBT_HeroStar); if (bCanUpstar && playerLv >= config.nLowLv && playerLv <= config.nHighLv) { // 满足升星条件,显示升星提示 SideButtonListAddData msg = new SideButtonListAddData(); msg.nItemID = (int)ESideButtonItemType.ESBT_HeroStar; msg.nButtonIconID = config.nIconID; msg.strButtonText = config.strName; msg.strTooltip = config.strHint; msg.callBack = (customData) => { UIButtonType ButtonType = new UIButtonType((int)PlayerSubWndType.WND_HERO); ButtonType.bIsRequestSelf = true; ButtonType.nRequestPDBID = dwPDBID; UISystem.Instance.SendWndMessage(WndMsgID.WND_MSG_PLAYERBUTTONFRAME_OPENFRAME, ButtonType); }; LogicDataCenter.sideButtonDataManager.AddItem(msg); } else { // 不满足升星条件, 隐藏升星提示 SideButtonListRemoveData msg = new SideButtonListRemoveData(); msg.nItemID = (int)ESideButtonItemType.ESBT_HeroStar; LogicDataCenter.sideButtonDataManager.RemoveItem(msg); } }
public MyButton(UIButtonType type) : base(type) { }
public ThemedUIButton(UIButtonType type) : base(type) { Initialize(); }
public UIButton(UIButtonType type) #if NET : base(ObjCRuntime.Messaging.NativeHandle_objc_msgSend_int(class_ptr, Selector.GetHandle("buttonWithType:"), (int)type)) #else : base(ObjCRuntime.Messaging.IntPtr_objc_msgSend_int(class_ptr, Selector.GetHandle("buttonWithType:"), (int)type))
public UIButtonEx(UIButtonType buttonType) : base(buttonType) { }
public UIButton(UIButtonType type) : base(XamCore.ObjCRuntime.Messaging.IntPtr_objc_msgSend_int (class_ptr, Selector.GetHandle ("buttonWithType:"), (int)type)) { VerifyIsUIButton (); }
public static new UIButtonEx FromType(UIButtonType buttonType) { return new UIButtonEx(buttonType); }
private void OnButtonClicked(UIButtonType type) { EventBus.Instance.Post <EventOnButtonClicked>(this, new EventOnButtonClicked(type)); }
public override void OnMessage(WndMsgID msgID, UIMsgData data) { switch (msgID) { case WndMsgID.WND_MSG_PLAYERBUTTONFRAME_OPENFRAME: { //UISystem.Instance.ShowWnd(WndID.WND_ID_SOCIALCONTACT, false); //UISystem.Instance.ShowWnd(WndID.WND_ID_CHART, false); SetVisible(true); if (m_wndView != null) { OnMsgOpenFrame(data); } } break; case WndMsgID.WND_MSG_COMMOM_STATICGAMESTATE_ENTER: { LoadView(); } break; case WndMsgID.WND_MSG_COMMOM_STATICGAMESTATE_LEAVE: { //SetVisible(false); UnloadView(); } break; case WndMsgID.WND_MSG_PLAYERINFO_INITINFO: { IUISubWnd playerInfoWnd = GetSubWnd(PlayerSubWndType.WND_PLAYER); if (playerInfoWnd != null) { playerInfoWnd.OnMessage(msgID, data); } } break; case WndMsgID.WND_MSG_PLAYERWARSTATISTIC_UPDATEWAR: case WndMsgID.WND_MSG_PLAYERWARSTATISTIC_VIEWSINGLEWAR: { IUISubWnd playerWarWnd = GetSubWnd(PlayerSubWndType.WND_WAR); if (playerWarWnd != null) { playerWarWnd.OnMessage(msgID, data); } } break; case WndMsgID.WND_MSG_HEROPREVIEWFRAME_GETHEROINFO: case WndMsgID.WND_MSG_HERODETAIL_UPDATEGOLD: { IUISubWnd playerHeroWnd = GetSubWnd(PlayerSubWndType.WND_HERO); if (playerHeroWnd != null) { playerHeroWnd.OnMessage(msgID, data); } } break; case WndMsgID.WND_MSG_RUNEPAGE_INITRUNEDATA: case WndMsgID.WND_MSG_RUNEPAGE_INITOTHERRUNEDATA: case WndMsgID.WND_MSG_RUNEPAGE_PUTRUNE: case WndMsgID.WND_MSG_RUNEPAGE_CHANGEPAGE: case WndMsgID.WND_MSG_WAR_MAIN_OPEN: { IUISubWnd playerRuneWnd = GetSubWnd(PlayerSubWndType.WND_RUNE); if (playerRuneWnd != null) { playerRuneWnd.OnMessage(msgID, data); } } break; case WndMsgID.WND_MSG_PLAYERWARSTATISTIC_UPDATETOTAL: { IUISubWnd playerInfoWnd = GetSubWnd(PlayerSubWndType.WND_PLAYER); if (playerInfoWnd != null) { playerInfoWnd.OnMessage(msgID, data); } IUISubWnd playerWarWnd = GetSubWnd(PlayerSubWndType.WND_WAR); if (playerWarWnd != null) { playerWarWnd.OnMessage(msgID, data); } } break; case WndMsgID.WND_MSG_PLAYERWARSTATISTIC_VIEWACTORWAR: { IUISubWnd playerWarWnd = GetSubWnd(PlayerSubWndType.WND_WAR); if (playerWarWnd != null) { playerWarWnd.OnMessage(msgID, data); } } break; case WndMsgID.WND_MSG_PLAYERINFO_REANMERESULT: { IUISubWnd playerInfoWnd = GetSubWnd(PlayerSubWndType.WND_PLAYER); if (playerInfoWnd != null) { playerInfoWnd.OnMessage(msgID, data); } } break; case WndMsgID.WND_MSG_CROWNPAGE_UPDATEVIEW: case WndMsgID.WND_MSG_CROWNPAGE_OTHERUPDATEVIEW: case WndMsgID.WND_MSG_CROWNPAGE_OTHERPAGESINGLESHOW: case WndMsgID.WND_MSG_CROWNPAGE_SELFPAGESINGLESHOW: case WndMsgID.WND_MSG_CROWNPAGE_APPRAISALRET: case WndMsgID.WND_MSG_CROWNPAGE_ACTIVEGEMMODEL: { //IUISubWnd crownInfoWnd = GetSubWnd(PlayerSubWndType.WND_CROWN); IUIWnd crownInfoWnd = GetSubUIWnd(PlayerSubWndType.WND_CROWN); if (crownInfoWnd != null) { crownInfoWnd.OnMessage(msgID, data); } } break; case WndMsgID.WND_MSG_OPEN_SOCIALSHARE_FRAME: case WndMsgID.WND_MSG_OPEN_GLORYMOMENT_VIDEO_FRAME: case WndMsgID.WND_MSG_OPEN_GLORYMOMENT_WARDATA: { if (m_wndView != null && m_wndView.GetCurSubWnd() != PlayerSubWndType.WND_MOMENT) { if (EntityFactory.MainHeroView != null) { UIButtonType ButtonType = new UIButtonType((int)PlayerSubWndType.WND_MOMENT); ButtonType.bIsRequestSelf = true; ButtonType.nRequestPDBID = EntityFactory.MainHeroView.Property.GetNumProp(ENTITY_PROPERTY.PROPERTY_ID); OnMsgOpenFrame(ButtonType); } } IUISubWnd playerMomentWnd = GetSubWnd(PlayerSubWndType.WND_MOMENT); if (playerMomentWnd != null) { playerMomentWnd.OnMessage(msgID, data); } } break; default: break; } }
public EventOnButtonClicked(UIButtonType type) { this.Type = type; }
public UIBouncyButton(UIButtonType type) : base(type) { this.TouchUpInside += this.OnTouch; }
public ButtonNumberPad(UIButtonType type) : base(type) { Initialize(); }
public UIRadioButton(UIButtonType type) : base(type) { }
public CustomBtn(UIButtonType Type) : base(Type) { }