public override void SetParams(bool is_new, object[] parms)
    {
        base.SetParams(is_new, parms);

        m_Info   = parms[0] as pd_GuildRequestedInfo;
        m_Detail = parms[1] as pd_GuildRequestedInfoDetail;

        m_SpriteLeader.spriteName = m_Info.leader_creature.GetProfileName();

        m_LabelLevel.text    = m_Info.player_level.ToString();
        m_LabelNickname.text = m_Info.nickname;

        if (m_Info.is_connected)
        {
            m_LabelLoginAt.text = Localization.Get("UserConnected");
        }
        else
        {
            m_LabelLoginAt.text = Network.GetConnectedTimeString(m_Info.last_login_at);
        }

        foreach (var creature in m_Detail.creatures)
        {
            var item = HeroPrefabManager.GetNewObject <EnchantHero>(HeroPrefabManager.transform, Vector3.zero);
            item.Init(new Creature(creature));
            item.m_label_in_team.text = "";
        }
        HeroPrefabManager.GetComponent <UIGrid>().Reposition();
    }
Exemple #2
0
    private void UpdateHottime()
    {
        EventIconPrefab.Clear();
        foreach (var event_info in EventHottimeManager.Instance.Events.Where(e => e.OnGoing))
        {
            if (event_info.end_date < Network.Instance.ServerTime)
            {
                continue;
            }
            var item = EventIconPrefab.GetNewObject <HottimeEventIcon>(EventIconPrefab.transform, Vector3.zero);
            item.Init(event_info, OnItemDisable);
        }

        EventIconPrefab.GetComponent <UIGrid>().Reposition();
    }
Exemple #3
0
    private void ResetPosition()
    {
        EventItemPrefab.GetComponent <UIGrid>().Reposition();
        var scroll = EventItemPrefab.GetComponentInParent <UIScrollView>();

        if (scroll != null)
        {
            scroll.ResetPosition();
        }
    }
Exemple #4
0
 //////////////////////////////////////////////////////////////////////////
 private void InitGuildMember()
 {
     GuildMemberPrefabManager.Clear();
     foreach (var member in GuildManager.Instance.GuildMembers)
     {
         var item = GuildMemberPrefabManager.GetNewObject <GuildMemberItem>(GuildMemberPrefabManager.transform, Vector3.zero);
         item.Init(member);
     }
     GuildMemberPrefabManager.GetComponent <UIGrid>().Reposition();
     GuildMemberPrefabManager.GetComponentInParent <UIScrollView>().ResetPosition();
     m_LabelMemberCount.text = Localization.Format("GuildMemberFormat", GuildManager.Instance.GuildMembers.Count, GuildManager.Instance.GuildMemberMax);
 }
Exemple #5
0
    private void InitGuildRequest()
    {
        GuildRequestPrefabManager.Clear();
        foreach (var request in Requested)
        {
            var item = GuildRequestPrefabManager.GetNewObject <GuildRequestItem>(GuildRequestPrefabManager.transform, Vector3.zero);
            item.Init(request, OnSelect);
        }
        GuildRequestPrefabManager.GetComponent <UIGrid>().Reposition();
        GuildRequestPrefabManager.GetComponentInParent <UIScrollView>().ResetPosition();

        m_LabelRequestCount.text = Localization.Format("GuildMemberFormat", Requested.Count, GuildInfoManager.Config.GuildRequestCount);
    }
    private void Init()
    {
        m_SpriteLeader.spriteName = m_Info.leader_creature.GetProfileName();

        m_LabelLevel.text    = m_Info.player_level.ToString();
        m_LabelNickname.text = m_Info.nickname;

        m_LabelJoinAt.text = Localization.Format("GuildJoinTime", (Network.Instance.ServerTime - m_Info.created_at).TotalDays);
        if (m_Info.is_connected)
        {
            m_LabelLoginAt.text = Localization.Get("UserConnected");
        }
        else
        {
            m_LabelLoginAt.text = Network.GetConnectedTimeString(m_Info.last_login_at);
        }

        m_LabelState.text     = Localization.Get(string.Format("GuildMemberState{0}", m_Info.member_state));
        m_LabelGivePoint.text = Localization.Format("GoodsFormat", m_Info.give);

        HeroPrefabManager.Clear();
        foreach (var creature in m_Info.creatures)
        {
            var item = HeroPrefabManager.GetNewObject <EnchantHero>(HeroPrefabManager.transform, Vector3.zero);
            item.Init(new Creature(creature));
            item.m_label_in_team.text = "";
        }
        HeroPrefabManager.GetComponent <UIGrid>().Reposition();

        m_BtnChangeState.SetActive(GuildManager.Instance.AvailableGuildManagement == true && GuildManager.Instance.GuildInfo.info.member_count > 1 &&
                                   m_Info.member_state != 0);
        m_BtnLeave.SetActive(SHSavedData.AccountIdx == m_Info.account_idx &&
                             (m_Info.member_state == 0 ? GuildManager.Instance.GuildInfo.info.member_count == 1 : true));
        m_BtnExpulsion.SetActive(SHSavedData.AccountIdx != m_Info.account_idx &&
                                 (m_Info.member_state == 0 ? (Network.Instance.ServerTime - m_Info.last_login_at).TotalSeconds >= 60 * 60 * 24 * 7 : GuildManager.Instance.AvailableGuildManagement == true));
        m_GridBtns.Reposition();
    }