Exemple #1
0
 protected void OnDeselectRole(UIGuildRole ui)
 {
     if (uiRoleDialog != null)
     {
         uiRoleDialog.Hide();
     }
 }
Exemple #2
0
 protected void OnDeselectRole(UIGuildRole ui)
 {
     if (uiRoleDialog != null)
     {
         uiRoleDialog.onHide.RemoveListener(OnRoleDialogHide);
         uiRoleDialog.Hide();
         uiRoleDialog.onHide.AddListener(OnRoleDialogHide);
     }
 }
Exemple #3
0
 protected void OnSelectRole(UIGuildRole ui)
 {
     if (uiRoleDialog != null)
     {
         uiRoleDialog.selectionManager = RoleSelectionManager;
         uiRoleDialog.Data             = ui.Data;
         uiRoleDialog.Show();
     }
 }
Exemple #4
0
        private void UpdateGuildUIs(GuildData guild)
        {
            if (guild == null)
            {
                return;
            }

            memberAmount = guild.CountMember();
            UpdateUIs();

            int selectedIdx = MemberSelectionManager.SelectedUI != null?MemberSelectionManager.IndexOf(MemberSelectionManager.SelectedUI) : -1;

            MemberSelectionManager.DeselectSelectedUI();
            MemberSelectionManager.Clear();

            SocialCharacterData[] members;
            byte[] memberRoles;
            guild.GetSortedMembers(out members, out memberRoles);
            MemberList.Generate(members, (index, guildMember, ui) =>
            {
                SocialCharacterEntityTuple guildMemberEntity = new SocialCharacterEntityTuple();
                guildMemberEntity.socialCharacter            = guildMember;

                UIGuildCharacter uiGuildMember = ui.GetComponent <UIGuildCharacter>();
                uiGuildMember.uiSocialGroup    = this;
                uiGuildMember.Setup(guildMemberEntity, memberRoles[index], guild.GetRole(memberRoles[index]));
                uiGuildMember.Show();
                MemberSelectionManager.Add(uiGuildMember);
                if (selectedIdx == index)
                {
                    uiGuildMember.OnClickSelect();
                }
            });

            selectedIdx = RoleSelectionManager.SelectedUI != null?RoleSelectionManager.IndexOf(RoleSelectionManager.SelectedUI) : -1;

            RoleSelectionManager.DeselectSelectedUI();
            RoleSelectionManager.Clear();

            RoleList.Generate(guild.GetRoles(), (index, guildRole, ui) =>
            {
                UIGuildRole uiGuildRole = ui.GetComponent <UIGuildRole>();
                uiGuildRole.Data        = guildRole;
                uiGuildRole.Show();
                RoleSelectionManager.Add(uiGuildRole);
                if (selectedIdx == index)
                {
                    uiGuildRole.OnClickSelect();
                }
            });

            selectedIdx = SkillSelectionManager.SelectedUI != null?SkillSelectionManager.IndexOf(SkillSelectionManager.SelectedUI) : -1;

            SkillSelectionManager.DeselectSelectedUI();
            SkillSelectionManager.Clear();

            SkillList.Generate(GameInstance.GuildSkills.Values, (index, guildSkill, ui) =>
            {
                UIGuildSkill uiGuildSkill = ui.GetComponent <UIGuildSkill>();
                uiGuildSkill.Data         = new GuildSkillTuple(guildSkill, guild.GetSkillLevel(guildSkill.DataId));
                uiGuildSkill.Show();
                SkillSelectionManager.Add(uiGuildSkill);
                if (selectedIdx == index)
                {
                    uiGuildSkill.OnClickSelect();
                }
            });
        }