Exemplo n.º 1
0
 public void SetToSpell(SpellObject Spell)
 {
     buttonType    = ActionButtonType.Spell;
     name          = Spell.Name;
     Data          = Spell;
     numOfSameName = 0;
 }
Exemplo n.º 2
0
        public void ActionButtonPress(ActionButtonType buttonType)
        {
            var actionType = buttonType.ToActionType();

            calculatorManager.ExecuteAction(actionType);
            Display = calculatorManager.Display;
        }
Exemplo n.º 3
0
 public void SetToItem(InventoryObject Item)
 {
     buttonType    = ActionButtonType.Item;
     name          = Item.Name;
     Data          = Item;
     numOfSameName = Item.NumOfSameName;
 }
Exemplo n.º 4
0
 public void SetToAction(AvatarAction Action)
 {
     buttonType    = ActionButtonType.Action;
     name          = Action.ToString();
     Data          = Action;
     numOfSameName = 0;
 }
Exemplo n.º 5
0
 public void SetToUnset()
 {
     buttonType    = ActionButtonType.Unset;
     name          = String.Empty;
     Data          = null;
     numOfSameName = 0;
 }
Exemplo n.º 6
0
 public void SetToUnset()
 {
     RemoveListener();
     buttonType    = ActionButtonType.Unset;
     name          = String.Empty;
     numOfSameName = 0;
     Data          = null;
 }
Exemplo n.º 7
0
 public void SetToAction(AvatarAction Action)
 {
     RemoveListener();
     buttonType    = ActionButtonType.Action;
     name          = Action.ToString();
     numOfSameName = 0;
     Data          = Action;
 }
Exemplo n.º 8
0
        public PCSetActionButton(byte[] data) : base(data)
        {
            Button = ReadByte();
            var packedData = ReadUInt32();

            Action = packedData & 0x00FFFFFF;
            Type   = (ActionButtonType)((packedData & 0xFF000000) >> 24);
        }
Exemplo n.º 9
0
        public string GetCommand(Race race, Class clss, int action, int button, ActionButtonType type)
        {
            var builder = new CommandBuilder("playercreateinfo_action");

            builder.AddColumnValue("race", (int)race);
            builder.AddColumnValue("class", (int)clss);
            builder.AddColumnValue("button", button);
            builder.AddColumnValue("action", action);
            builder.AddColumnValue("type", (int)type);

            return builder.BuildInsert(true);
        }
Exemplo n.º 10
0
        public string GetCommand(Race race, Class clss, int action, int button, ActionButtonType type)
        {
            var builder = new SQLCommandBuilder("playercreateinfo_action");

            builder.AddColumnValue("race", (int)race);
            builder.AddColumnValue("class", (int)clss);
            builder.AddColumnValue("button", button);
            builder.AddColumnValue("action", action);
            builder.AddColumnValue("type", (int)type);

            return(builder.BuildInsert());
        }
Exemplo n.º 11
0
        public void SetActionAndType(ulong action, ActionButtonType type)
        {
            ulong newData = action | ((ulong)type << 56);

            if (newData != packedData || uState == ActionButtonUpdateState.Deleted)
            {
                packedData = newData;
                if (uState != ActionButtonUpdateState.New)
                {
                    uState = ActionButtonUpdateState.Changed;
                }
            }
        }
Exemplo n.º 12
0
        public void SetToAlias(KeyValuePairString Item)
        {
            if (Item == null)
            {
                return;
            }

            RemoveListener();
            buttonType    = ActionButtonType.Alias;
            name          = Item.Key;
            numOfSameName = 0;
            Data          = Item;
        }
Exemplo n.º 13
0
        public void SetToItem(InventoryObject Item)
        {
            if (Item == null)
            {
                return;
            }

            RemoveListener();

            buttonType    = ActionButtonType.Item;
            name          = Item.Name;
            numOfSameName = Item.NumOfSameName;

            Data = Item;
            Item.PropertyChanged += OnObjectPropertyChanged;
        }
Exemplo n.º 14
0
 public void Clear(bool RaiseChangedEvent)
 {
     if (RaiseChangedEvent)
     {
         Num        = 1;
         ButtonType = ActionButtonType.Unset;
         Name       = String.Empty;
         Data       = null;
     }
     else
     {
         num        = 1;
         buttonType = ActionButtonType.Unset;
         name       = String.Empty;
         data       = null;
     }
 }
Exemplo n.º 15
0
        public ActionButton(ActionButtonType type)
        {
            //this.DoubleBuffered = true;
            m_IsSelected  = false;
            m_IsExclusive = true;

            CSelect           = NONSELECT_COLOR;
            PBoarder          = new Pen(new SolidBrush(CSelect));
            PBoarder.Width    = BOARDER_WIDTH;
            BBack             = new SolidBrush(BACK_COLOR);
            BText             = new SolidBrush(TEXT_COLOR);
            BackGraphicsImage = new Bitmap(this.Width, this.Height);
            BackGraphics      = Graphics.FromImage(BackGraphicsImage);
            ThisGraphics      = this.CreateGraphics();
            m_Font            = new Font(this.Font.Name, 8f);
            m_ActionType      = type;
        }
Exemplo n.º 16
0
        public static ActionType ToActionType(this ActionButtonType buttonType)
        {
            switch (buttonType)
            {
            case ActionButtonType.CLEAR:
                return(ActionType.CLEAR);

            case ActionButtonType.DELETE:
                return(ActionType.DELETE);

            case ActionButtonType.POINT:
                return(ActionType.POINT);

            default:
                throw new CalculatorException("Unknown action type: " + buttonType);
            }
        }
Exemplo n.º 17
0
        public void SetToSkill(SkillObject Skill)
        {
            if (Skill == null)
            {
                return;
            }

            // remove attached listener
            RemoveListener();

            buttonType    = ActionButtonType.Skill;
            name          = Skill.Name;
            numOfSameName = 0;

            Data = Skill;
            Skill.PropertyChanged += OnObjectPropertyChanged;
        }
Exemplo n.º 18
0
        public ActionButtonConfig(int Num, ActionButtonType ButtonType, string Name, object Data = null, string Label = null)
        {
            num        = Num;
            buttonType = ButtonType;

            if (Label == null)
            {
                Label = String.Empty;
            }

            label = Label;

            if (ButtonType == ActionButtonType.Action)
            {
                data = GetAction(Name);
                name = ((AvatarAction)data).ToString();
            }
            else
            {
                name = Name;
                data = Data;
            }
        }
Exemplo n.º 19
0
 public void SetToUnset()
 {
     buttonType = ActionButtonType.Unset;
     name = String.Empty;
     Data = null;
     numOfSameName = 0;
 }
Exemplo n.º 20
0
        public ActionButtonConfig(int Num, ActionButtonType ButtonType, string Name, object Data = null, string Label = null, uint NumOfSameName = 0)
        {
            num = Num;
            buttonType = ButtonType;
            numOfSameName = NumOfSameName;

            if (Label == null)
                Label = String.Empty;

            label = Label;

            if (ButtonType == ActionButtonType.Action)
            {
                data = GetAction(Name);
                name = ((AvatarAction)data).ToString();
            }
            else
            {              
                name = Name;
                data = Data;
            }
        }
Exemplo n.º 21
0
 public void SetToSpell(SpellObject Spell)
 {
     buttonType = ActionButtonType.Spell;
     name = Spell.Name;
     Data = Spell;
     numOfSameName = 0;
 }
Exemplo n.º 22
0
 public void SetToAction(AvatarAction Action)
 {
     buttonType = ActionButtonType.Action;
     name = Action.ToString();
     Data = Action;
     numOfSameName = 0;
 }
Exemplo n.º 23
0
 public void CmdExecuteButtonAction(ActionButtonType actionButtonType, NetworkIdentity actingUnitNetworkIdentity)
 {
     ActionButtons.Instance.buttons.Find(item => item.ButtonType == actionButtonType).Act(actingUnitNetworkIdentity.gameObject);
 }
Exemplo n.º 24
0
 public void SetToItem(InventoryObject Item)
 {
     buttonType = ActionButtonType.Item;
     name = Item.Name;
     Data = Item;
     numOfSameName = Item.NumOfSameName;
 }
Exemplo n.º 25
0
 public void Clear(bool RaiseChangedEvent)
 {
     if (RaiseChangedEvent)
     {
         Num = 1;
         ButtonType = ActionButtonType.Unset;
         Name = String.Empty;
         Data = null;
         NumOfSameName = 0;
     }
     else
     {
         num = 1;
         buttonType = ActionButtonType.Unset;
         name = String.Empty;
         data = null;
         numOfSameName = 0;
     }
 }
Exemplo n.º 26
0
        public void HandleActionButton(ActionButtonType buttonType)
        {
            switch (buttonType)
            {
            case ActionButtonType.Join:
            case ActionButtonType.MayBe:
                GroupsService.Current.Join(this._gid, buttonType == ActionButtonType.MayBe, (Action <BackendResult <OwnCounters, ResultCode> >)(res =>
                {
                    if (res.ResultCode != ResultCode.Succeeded)
                    {
                        return;
                    }
                    CountersManager.Current.Counters = res.ResultData;
                    if (this._group.MembershipType == GroupMembershipType.NotAMember && this._group.Privacy == GroupPrivacy.Public)
                    {
                        EventAggregator.Current.Publish(new GroupMembershipStatusUpdated(this._group.id, true));
                    }
                    else if (this._group.MembershipType == GroupMembershipType.InvitationReceived)
                    {
                        EventAggregator.Current.Publish(new GroupMembershipStatusUpdated(this._group.id, true));
                    }
                    this.LoadGroupData(true, false);
                }), null);
                break;

            case ActionButtonType.Leave:
                GroupsService.Current.Leave(this._gid, (Action <BackendResult <OwnCounters, ResultCode> >)(res =>
                {
                    if (res.ResultCode != ResultCode.Succeeded)
                    {
                        return;
                    }
                    CountersManager.Current.Counters = res.ResultData;
                    if (this._group.MembershipType == GroupMembershipType.Member)
                    {
                        EventAggregator.Current.Publish(new GroupMembershipStatusUpdated(this._group.id, false));
                    }
                    else if (this._group.MembershipType == GroupMembershipType.InvitationReceived)
                    {
                        EventAggregator.Current.Publish(new GroupMembershipStatusUpdated(this._group.id, false));
                    }
                    this.LoadGroupData(true, false);
                }));
                break;

            case ActionButtonType.WriteOnWall:
                Navigator.Current.NavigateToNewWallPost(this._gid, true, this._group.admin_level, this._group.GroupType == GroupType.PublicPage, false, false);
                break;

            case ActionButtonType.Map:
                Navigator.Current.NavigateToMap(false, this._group.place.latitude, this._group.place.longitude);
                break;

            case ActionButtonType.Suggested:
                Navigator.Current.NavigateToSuggestedPostponedPostsPage(this._gid, true, 0);
                break;

            case ActionButtonType.Postponed:
                Navigator.Current.NavigateToSuggestedPostponedPostsPage(this._gid, true, 1);
                break;
            }
        }
 public ButtonBuilder Type(ActionButtonType type)
 {
     _type = type;
     return(this);
 }
Exemplo n.º 28
0
 public ActionButton(string text, ActionButtonType buttonType)
 {
     this.ActionButtonText = text;
     this.ButtonType       = buttonType;
 }
Exemplo n.º 29
0
 private bool CanActionButtonPress(ActionButtonType buttonType)
 {
     return(calculatorManager.CanActionBeExecuted());
 }