public void SetPartyViewState(int index)
    {
        int lastParty = (int)partyAction;

        if (index != lastParty)
        {
            partyAction = (PartyAction)index;
            if ((PartyAction)lastParty != PartyAction.Null)
            {
                PartyModeSelectButtons[lastParty].SetSelected(false);
            }
            if ((PartyAction)index != PartyAction.Null)
            {
                PartyModeSelectButtons[index].SetSelected(true);
            }
            EnablePartyViewState((PartyAction)index);
            DisablePartyViewState((PartyAction)lastParty);
        }
        else
        {
            partyAction = PartyAction.Null;
            if ((PartyAction)index != PartyAction.Null)
            {
                PartyModeSelectButtons[index].SetSelected(false);
            }
            DisablePartyViewState((PartyAction)lastParty);
        }
        ActionSwitchMode(-1);
        SetActionDescriptionText(null);
    }
Example #2
0
 private void OnPartyUpdateEvent(int owner, PartyAction action)
 {
     //todo check options for auto accept?
     Logger.Write($"{nameof(PartyStrategy)}.{nameof(OnPartyUpdateEvent)}: {owner}, {action}");
     if (action == PartyAction.ServerInvite)
     {
         var packet = Actions.PartyAction(owner, PartyAction.ClientAcceptInvite);
         Logger.Write("Party Accept Packet? " + BitConverter.ToString(packet));
         SendPacket(packet);
     }
 }
Example #3
0
        protected void PartyUpdate(byte type, List <byte> data)
        {
            byte[] packet = data.ToArray();

            //Logger.Write($"{nameof(PartyUpdate)}: [{type:X}] [{BitConverter.ToString(packet)}]");
            //Cancel: [8B-02-00-00-00-00]
            //Request: [8B-02-00-00-00-02]
            int         playerId = BitConverter.ToInt32(packet, 1);
            PartyAction action   = (PartyAction)packet.Skip(5).First();

            //Logger.Write($"{nameof(PartyUpdate)}: pid:{playerId}, action: {action}");
            PartyUpdateEvent?.Invoke(playerId, action);
        }
    public void DisablePartyViewState(PartyAction action)
    {
        switch (action)
        {
        default: break;

        case PartyAction.ViewStats:
            UICollections[(int)UIState.Party].SetPanelState("Lunen Info Panel", UITransition.State.Disable);
            PartyRenameLunen.SetMonster(null);
            break;

        case PartyAction.SwapMoves:
            UICollections[(int)UIState.Party].SetPanelState("Action Panel", UITransition.State.Disable);
            break;

        case PartyAction.UseItem:
            CloseInventoryWindow(sr.battleSetup.InBattle);
            break;
        }
    }
    public void EnablePartyViewState(PartyAction action)
    {
        switch (action)
        {
        default: break;

        case PartyAction.ViewStats:

            UICollections[(int)UIState.Party].SetPanelState("Lunen Info Panel", UITransition.State.Enable);
            if (PartySwapSelect == -1)
            {
                PartyAccess(0);
            }
            SetActionDescriptionText(null);
            PartyRenameLunen.SetMonster(sr.battleSetup.PlayerLunenTeam[PartySwapSelect].GetComponent <Monster>());
            PartyLunenDescription.text = GetLunenInfo(sr.battleSetup.PlayerLunenTeam[PartySwapSelect].GetComponent <Monster>());
            break;

        case PartyAction.SwapMoves:

            UICollections[(int)UIState.Party].SetPanelState("Action Panel", UITransition.State.Enable);
            if (PartySwapSelect == -1)
            {
                PartyAccess(0);
            }
            SetActionDescriptionText(null);
            break;

        case PartyAction.UseItem:
            OpenInventoryWindow();
            if (PartySwapSelect == -1)
            {
                PartyAccess(0);
            }
            break;
        }
    }
 public static byte[] Build(PartyAction action, uint playerUID)
 {
     return new byte[] { 0x5e, ((byte) action), ((byte) playerUID), ((byte) (playerUID >> 8)), ((byte) (playerUID >> 0x10)), ((byte) (playerUID >> 0x18)) };
 }
 public PartyRequest(PartyAction action, uint playerUID)
     : base(Build(action, playerUID))
 {
     this.action = action;
     this.playerUID = playerUID;
 }
 // Methods
 public PartyRequest(byte[] data)
     : base(data)
 {
     this.action = (PartyAction) data[1];
     this.playerUID = BitConverter.ToUInt32(data, 2);
 }
Example #9
0
 public static byte[] PartyAction(int playerId, PartyAction action)
 {
     return(BuildPacket(0x5E, Byte(action), BitConverter.GetBytes(playerId)));
 }
Example #10
0
 private void OnPartyUpdateEvent(int owner, PartyAction action)
 {
     if (action == PartyAction.ServerInvite)
     {
     }
 }