Exemple #1
0
 private void Event_PlayerJoin(IClientPlayer byPlayer)
 {
     if (!didSelect && byPlayer.PlayerUID == capi.World.Player.PlayerUID)
     {
         dlg = new GuiDialogCreateCharacter(capi, this);
         dlg.PrepAndOpen();
     }
 }
Exemple #2
0
        private void onCharSelCmd(int groupId, CmdArgs args)
        {
            if (dlg == null)
            {
                dlg = new GuiDialogCreateCharacter(capi, this);
                dlg.PrepAndOpen();
            }

            if (!dlg.IsOpened())
            {
                dlg.TryOpen();
            }
        }
Exemple #3
0
        internal void ClientSelectionDone(IInventory characterInv, string characterClass, bool didSelect)
        {
            List <ClothStack> clothesPacket = new List <ClothStack>();

            for (int i = 0; i < characterInv.Count; i++)
            {
                ItemSlot slot = characterInv[i];
                if (slot.Itemstack == null)
                {
                    continue;
                }

                clothesPacket.Add(new ClothStack()
                {
                    Code    = slot.Itemstack.Collectible.Code.ToShortString(),
                    SlotNum = i,
                    Class   = slot.Itemstack.Class
                });
            }

            Dictionary <string, string> skinParts = new Dictionary <string, string>();
            var bh = capi.World.Player.Entity.GetBehavior <EntityBehaviorExtraSkinnable>();

            var applied = bh.AppliedSkinParts;

            foreach (var val in applied)
            {
                skinParts[val.PartCode] = val.Code;
            }

            capi.Network.GetChannel("charselection").SendPacket(new CharacterSelectionPacket()
            {
                Clothes        = clothesPacket.ToArray(),
                DidSelect      = didSelect,
                SkinParts      = skinParts,
                CharacterClass = characterClass,
                VoicePitch     = bh.VoicePitch,
                VoiceType      = bh.VoiceType
            });

            capi.Network.SendPlayerNowReady();

            createCharDlg = null;
        }