Ejemplo n.º 1
0
    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);
    }
Ejemplo n.º 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);
     }
 }
Ejemplo n.º 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);
        }
Ejemplo n.º 4
0
    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;
        }
    }
Ejemplo n.º 5
0
    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;
        }
    }
Ejemplo n.º 6
0
 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)) };
 }
Ejemplo n.º 7
0
 public PartyRequest(PartyAction action, uint playerUID)
     : base(Build(action, playerUID))
 {
     this.action = action;
     this.playerUID = playerUID;
 }
Ejemplo n.º 8
0
 // Methods
 public PartyRequest(byte[] data)
     : base(data)
 {
     this.action = (PartyAction) data[1];
     this.playerUID = BitConverter.ToUInt32(data, 2);
 }
Ejemplo n.º 9
0
 public static byte[] PartyAction(int playerId, PartyAction action)
 {
     return(BuildPacket(0x5E, Byte(action), BitConverter.GetBytes(playerId)));
 }
Ejemplo n.º 10
0
 private void OnPartyUpdateEvent(int owner, PartyAction action)
 {
     if (action == PartyAction.ServerInvite)
     {
     }
 }