Exemplo n.º 1
0
    //界面打开
    protected override void OnOpen(object param = null)
    {
        mDataModule = ModuleManager.Instance.FindModule <PlayerDataModule>();
        UpdateEquips();
        UpdateBags();
        UpdatePlayerData();
        OnWingUpdate(null);
        EventSystem.Instance.addEventListener(ItemEvent.UPDATE_CHANGE, ItemUpdateHandler);
        EventSystem.Instance.addEventListener(PropertyEvent.PLAYER_DATA_PROPERTY_CHANGED, OnDataPropertyChanged);
        EventSystem.Instance.addEventListener(WingUIEvent.Wing_UI_UPDATE, OnWingUpdate);
        EventSystem.Instance.addEventListener(ItemEvent.BAG_OP_UNLOCK, OnBagUnlock);

        Player player = PlayerController.Instance.GetControlObj() as Player;

        if (player != null)
        {
            PlayerPropertyModule module = ModuleManager.Instance.FindModule <PlayerPropertyModule>();

            mPreview.SetupCharacter(player.ModelID, module.GetEquipConfigs(), player.GetEquipWing(), uint.MaxValue);

            mPreview.ChangeWeapon(mDataModule.GetMainWeaponId());
            //mPreview.SetupParticle("ui_heiying");
        }
        onOpenBag();

        TitleModule tm = ModuleManager.Instance.FindModule <TitleModule>();

        mTitleRedPoint.SetActive(tm.IsShowRedPoint);
    }
Exemplo n.º 2
0
    public void GetNewTitle(int titleId)
    {
        string text = StringHelper.GetString("get_new_title") + TitleModule.GetTitleNameById(titleId);

        PopTipManager.Instance.AddNewTip(text);

        //AddUnlockQueue(i + 1);

        OnGetNewTitle();
    }
Exemplo n.º 3
0
    private void onTitleBtnClick()
    {
        WindowManager.Instance.OpenUI("title");

        TitleModule tm = ModuleManager.Instance.FindModule <TitleModule>();

        tm.IsShowRedPoint = false;
        mTitleRedPoint.SetActive(false);
        CityFormManager.SetRedPointActive("beibao", false);
    }
Exemplo n.º 4
0
    protected override void OnLoad()
    {
        mButton = this.FindComponent <UIButton>("Sprite");
        mLabel  = this.FindComponent <UILabel>("Sprite/Label");
        mIcon   = this.FindComponent <UISprite>("Sprite/Icon");

        mSrcPos = mIcon.gameObject.transform.position;

        EventDelegate.Add(mButton.onClick, OnButtonClick);
        mModule = ModuleManager.Instance.FindModule <TitleModule>();
    }
Exemplo n.º 5
0
    void setCurTitle(int titleId)
    {
        TitleItemTableItem item = TitleModule.GetTitleItemById(titleId);

        if (item == null)
        {
            return;
        }

        UIAtlasHelper.SetSpriteImage(mIconSp, item.picName, true);

        mAttrisLb[0].text = item.detail1;
        mAttrisLb[1].text = item.detail2;
        mAttrisLb[2].text = item.detail3;
        mAttrisLb[3].text = item.detail4;

        mGradeLb.text = item.grade.ToString();

        PlayerDataModule pdm = ModuleManager.Instance.FindModule <PlayerDataModule>();

        if (pdm == null)
        {
            return;
        }

        bool ishave = pdm.IsHasTitleByID(titleId);

        string detail = "";

        switch (item.contentId)
        {
        case 0:
            FontColor fc  = ishave ? FontColor.Green : FontColor.Red;
            string    tmp = StringHelper.StringWithColor(fc, pdm.GetLevel() + "/" + item.conditionVal);
            detail = string.Format(item.contentDetail, tmp);
            break;

        default:
            detail = item.contentDetail;
            break;
        }

        mConditionLb.text = detail;

        UISprite btnBg = mEquipBtn.GetComponent <UISprite>();

        if (btnBg != null)
        {
            UIAtlasHelper.SetSpriteShaderGrey(btnBg, !ishave);
        }

        mEquipBtnLb.text = pdm.GetCurTitle() == titleId ? "卸下" : "穿戴";
    }
Exemplo n.º 6
0
    private void OnStart()
    {
        if (!DataManager.TitleItemTable.ContainsKey(mCurTitleID))
        {
            return;
        }
        TitleItemTableItem item = TitleModule.GetTitleItemById(mCurTitleID);

        UIAtlasHelper.SetSpriteImage(mIcon, item.picName, true);
        mLabel.text  = StringHelper.GetString("get_new_title") + item.name;
        mWaitingTime = 3000;
        mWaiting     = true;
    }
Exemplo n.º 7
0
    void CreateGroupTitles()
    {
        BetterList <int> ids = TitleModule.GetAllTitleGroupId();

        if (ids == null || ids.size == 0)
        {
            return;
        }

        foreach (int id in ids)
        {
            CreateGroupTitle(id);
        }

        mGrid.repositionNow = true;
    }
Exemplo n.º 8
0
    void CreateGroupTitle(int id)
    {
        GameObject go = WindowManager.Instance.CloneGameObject(mGroupObj);

        if (go == null)
        {
            return;
        }

        go.name                 = id.ToString();
        go.transform.parent     = mGrid.transform;
        go.transform.localScale = Vector3.one;
        go.SetActive(true);

        TitleGroupUI ui = new TitleGroupUI(go);

        TitleGroupTableItem data = TitleModule.GetTitleGroupItemById(id);

        ui.SetData(data);

        mGroupUIs.Add(id, ui);

        UIEventListener.Get(go).onClick = onTitleGroupClick;
    }
Exemplo n.º 9
0
 public string GetTitleImg()
 {
     return(TitleModule.GetTitleImgById(mModule.GetCurTitle()));
 }