Exemplo n.º 1
0
 public void PlayerSendMessageEvent(PlayerSendMessageEvent evt)
 {
     Console.WriteLine(EventUtil.EventToString(evt));
 }
Exemplo n.º 2
0
 public void ClientClose(UserToken token, string error)
 {
     Leave(token);                              //先调用离开然后消除房间
     Brocast(SelectProtocol.DESTROY_BRO, null); //通知客户端所有人 房间解散 回主界面
     EventUtil.destroySelect(GetArea());        //调用销毁房间
 }
Exemplo n.º 3
0
 protected virtual void OnApplyDatas(ApplyDataEventArgs e)
 {
     EventUtil.ExecuteEventHandler(EventHandlers, EventConst.ApplyDataEvent, this, e);
 }
Exemplo n.º 4
0
 protected virtual void OnFilledUpdateTables(FilledUpdateEventArgs e)
 {
     EventUtil.ExecuteEventHandler(EventHandlers, EventConst.FilledUpdateEvent, this, e);
 }
Exemplo n.º 5
0
 public void OnStartButtonClicked()
 {
     EventUtil.SendMessage(BallonEventType.StartGame);
 }
Exemplo n.º 6
0
 public void OnNoButtonClicked()
 {
     EventUtil.SendMessage(BallonEventType.BackToMainMenu);
 }
 public UIAccessClass()
 {
     Fields = new BackingFieldsStore(this, OnPropertyChanged);
     Fields[nameof(Window)].ValueChanged += (s, e) => EventUtil.Raise(WindowChanged, this, new ValueChangedEventArgs <Window>((Window)e.PreviousValue, (Window)e.NewValue), "{5AC93EA1-BB23-49CE-86F4-7DA533825945}");
 }
Exemplo n.º 8
0
 public void WorldObjectDestroyedEvent(WorldObjectDestroyedEvent evt)
 {
     Console.WriteLine(EventUtil.EventToString(evt));
 }
Exemplo n.º 9
0
 public void WorldObjectOperatingChangedEvent(WorldObjectOperatingChangedEvent evt)
 {
     Console.WriteLine(EventUtil.EventToString(evt));
 }
Exemplo n.º 10
0
 public void InventoryChangeSelectedSlotEvent(InventoryChangeSelectedSlotEvent evt)
 {
     Console.WriteLine(EventUtil.EventToString(evt));
 }
Exemplo n.º 11
0
 public void WorldObjectChangeTextEvent(WorldObjectChangeTextEvent evt)
 {
     Console.WriteLine(EventUtil.EventToString(evt));
 }
Exemplo n.º 12
0
 public void TreeChopEvent(TreeChopEvent evt)
 {
     Console.WriteLine(EventUtil.EventToString(evt));
 }
Exemplo n.º 13
0
 public void RubbleSpawnEvent(RubbleSpawnEvent evt)
 {
     Console.WriteLine(EventUtil.EventToString(evt));
 }
Exemplo n.º 14
0
 public void WorldPolluteEvent(WorldPolluteEvent evt)
 {
     Console.WriteLine(EventUtil.EventToString(evt)); // avoid spam
 }
Exemplo n.º 15
0
        protected override void ResetItems()
        {
            CItemRender item;
            bool        isSameHeight    = true;
            float       realTotalHeight = 0;

            for (int i = 0; i < _allItem.Count; i++)
            {
                item      = _allItem[i];
                item.name = "Item" + i;
                CItemRender w = item;
                if (_dataCondition != null)
                {
                    w.SetCondition(_dataCondition);
                }
                w.Data = _dataProvider[i];
                //默认为itemHeight(等高情况)
                //不等高情况,请自行设置CItemRender的height属性
                float realItemHeight = 0;
                if (w.height == 0)
                {
                    realItemHeight = _itemHeight;
                }
                else
                {
                    realItemHeight = w.height;
                    isSameHeight   = false;
                }
                int   offX = i / RowNum;
                int   offY = i / ColNum;
                float itemX, itemY;
                if (horizon)
                {
                    itemY = -(itemHeight + 5) * (i % RowNum);  //一列一列的顺序?
                    itemX = offX * itemWidth;
                }
                else
                {
                    if (isSameHeight)
                    {
                        itemY = (offY * _itemHeight * -1);
                    }
                    else
                    {
                        itemY = (realTotalHeight * -1);
                    }
                    itemX = (itemWidth + 5) * (i % ColNum);
                }
                item.tran.localPosition = new Vector3(PaddingLeft + itemX, -PaddingTop + itemY, 0);

                realTotalHeight += realItemHeight;

                UIEventListener listener = UIEventListener.Get(item.go);
                //listener.onHover = OnItemHover;
                EventUtil.AddHover(item.go, OnItemHover, item.go);
                listener.onClick = OnItemPress;
            }
            if (_dataProvider == null)
            {
                TotalWidth  = 0;
                TotalHeight = 0;
            }
            else
            {
                if (horizon)
                {
                    var itemW = _itemWidth * _dataProvider.Count / (float)RowNum;
                    TotalWidth = PaddingLeft * 2 + Mathf.CeilToInt(itemW);
                }
                else
                {
                    float itemH = 0;
                    if (isSameHeight)
                    {
                        itemH = _itemHeight * _dataProvider.Count / float.Parse(ColNum.ToString());
                    }
                    else
                    {
                        itemH = realTotalHeight;
                    }
                    TotalHeight = PaddingTop + Mathf.CeilToInt(itemH) + PaddingBottom;
                }
            }
            if (keepCurPos == false)
            {
                UpdateScrollBar();
            }
            else
            {
                if (ShowBar)
                {
                    bool needShowBar = TotalHeight > height || TotalWidth > width;
                    Bar.gameObject.SetActive(needShowBar);
                }
                else
                {
                    Bar.gameObject.SetActive(false);
                }
            }
        }
Exemplo n.º 16
0
 public void WorldObjectPickupEvent(WorldObjectPickupEvent evt)
 {
     Console.WriteLine(EventUtil.EventToString(evt));
 }
Exemplo n.º 17
0
 public void OnAdsSuccess()
 {
     EventUtil.SendMessage(BallonEventType.AdSuccess);
 }
Exemplo n.º 18
0
 public void InventoryMoveItemEvent(InventoryMoveItemEvent evt)
 {
     Console.WriteLine(EventUtil.EventToString(evt));
 }
 public IActionResult GetLatestEvents()
 {
     return(Content(EventUtil.GetLatestEvents(), "text/html"));
 }
Exemplo n.º 20
0
 public void PlayerClaimPropertyEvent(PlayerClaimPropertyEvent evt)
 {
     Console.WriteLine(EventUtil.EventToString(evt));
 }
 public static void RaiseTreeChangedEventWithHelper()
 {
     EventUtil.Raise(TreeChanged, null, null, "{07434A30-743D-4BB8-8F49-1161BA900183}");
 }
Exemplo n.º 22
0
 public void PlayerCompleteContractEvent(PlayerCompleteContractEvent evt)
 {
     Console.WriteLine(EventUtil.EventToString(evt));
 }
Exemplo n.º 23
0
        FireLayoutRequired()
        {
            AssertValid();

            EventUtil.FireEvent(this, this.LayoutRequired);
        }
Exemplo n.º 24
0
 public void PlayerGainSkillEvent(PlayerGainSkillEvent evt)
 {
     Console.WriteLine(EventUtil.EventToString(evt));
 }
Exemplo n.º 25
0
 protected void OnPropertyChanged(string propertyName)
 {
     EventUtil.Raise(PropertyChanged, this, new PropertyChangedEventArgs(propertyName), "{D8D0E6E6-4ADA-4828-BF1A-80E538170B48}");
 }
Exemplo n.º 26
0
 public void PlayerGetElectedEvent(PlayerGetElectedEvent evt)
 {
     Console.WriteLine(EventUtil.EventToString(evt));
 }
Exemplo n.º 27
0
        /// <summary>
        /// 需要改变选项卡的值及其响应时使用
        /// </summary>
        /// <param name="labelStrs">选项卡的字符串列表</param>
        /// <param name="datas">选项卡携带的值,changeIndex时,优先响应携带值,否则响应index</param>
        /// <param name="isHorizon">排布水平,否则垂直排列</param>
        public void UpdateLabels(List <string> labelStrs, List <int> datas = null, bool isHorizon = true)
        {
            this.isHorizon = isHorizon;
            this.datas     = datas;
            this.labelStrs = labelStrs;
            if (!isInit)
            {
                return;
            }
            var           needLen  = labelStrs.Count;
            var           len      = _nowUseList.Count;
            var           count    = Math.Min(needLen, len);
            var           needData = datas != null && datas.Count == labelStrs.Count;
            CButtonToggle box      = null;

            if (len > 1)
            {
                if (isHorizon)
                {
                    dist = (int)(_nowUseList[1].transform.localPosition.x - _nowUseList[0].transform.localPosition.x);
                }
                else
                {
                    dist = (int)(_nowUseList[1].transform.localPosition.y - _nowUseList[0].transform.localPosition.y);
                }
            }
            else if (dist == 0)
            {
                dist = isHorizon ? _nowUseList[0].width : -_nowUseList[0].height;
            }
            for (var i = 0; i < count; i++)
            {
                _nowUseList[i].Text = labelStrs[i];
                if (needData)
                {
                    _nowUseList[i].gameObject.SetData(datas[i]);
                    EventUtil.RemoveClick(_nowUseList[i].gameObject, OnClick);
                    EventUtil.AddClick(_nowUseList[i].gameObject, OnClick, (datas[i]));
                }
            }
            if (len < needLen)
            {
                for (var i = len; i < needLen; i++)
                {
                    if (_unUseList.Count > 0)
                    {
                        box = _unUseList[0];
                        _unUseList.RemoveAt(0);
                        box.Text = labelStrs[i];
                    }
                    else
                    {
                        var boxObj = Instantiate(_nowUseList[0].gameObject) as GameObject;
                        if (boxObj != null)
                        {
                            boxObj.name      = "Tab" + i;
                            box              = boxObj.GetComponent <CButtonToggle>();
                            box.normalSprite = normalSp;
                            box.Text         = labelStrs[i];
                        }
                    }
                    if (box != null)
                    {
                        if (needData)
                        {
                            box.gameObject.SetData(datas[i]);
                        }
                        box.transform.parent = transform;
                        if (_nowUseList.Count > 0)
                        {
                            if (isHorizon)
                            {
                                box.transform.localPosition = new Vector2(_nowUseList[0].transform.localPosition.x + dist * i,
                                                                          _nowUseList[0].transform.localPosition.y);
                            }
                            else
                            {
                                box.transform.localPosition = new Vector2(_nowUseList[0].transform.localPosition.x,
                                                                          _nowUseList[0].transform.localPosition.y + dist * i);
                            }
                        }
                        else
                        {
                            box.transform.localPosition = Vector2.zero;
                        }
                        box.transform.localScale = Vector2.one;
                        box.gameObject.SetActive(true);
                        if (needData)
                        {
                            EventUtil.RemoveClick(box.gameObject, OnClick);
                            EventUtil.AddClick(box.gameObject, OnClick, (datas[i]));
                        }
                        _nowUseList.Add(box);
                    }
                }
            }
            else
            {
                for (var i = 0; i < len; i++)
                {
                    box = _nowUseList[i];
                    box.gameObject.SetActive(true);
                }
                for (var i = len - 1; i >= needLen; i--)
                {
                    box = _nowUseList[i];
                    box.gameObject.SetActive(false);
                    _nowUseList.RemoveAt(i);
                    //_unUseList.Add(box);
                    _unUseList.Insert(0, box);
                }
            }
        }
Exemplo n.º 28
0
 public void PlayerLogoutEvent(PlayerLogoutEvent evt)
 {
     Console.WriteLine(EventUtil.EventToString(evt));
 }
Exemplo n.º 29
0
 protected virtual void OnCommittingData(CommittingDataEventArgs e)
 {
     EventUtil.ExecuteEventHandler(EventHandlers, EventConst.CommittingDataEvent, this, e);
 }
Exemplo n.º 30
0
 public void PlayerRunForElectionEvent(PlayerRunForElectionEvent evt)
 {
     Console.WriteLine(EventUtil.EventToString(evt));
 }