private void _InitializeSlotitems()
 {
     if (this._all_items == null)
     {
         Api_Result <Dictionary <int, Mem_slotitem> > api_Result = new Api_get_Member().Slotitem();
         if (api_Result.state != Api_Result_State.Success)
         {
             this._all_items = new List <Mem_slotitem>();
         }
         else
         {
             this._all_items = new List <Mem_slotitem>(api_Result.data.get_Values());
         }
     }
     if (this._items == null)
     {
         this._items = new Dictionary <int, List <SlotitemModel> >();
     }
     else
     {
         this._items.Clear();
     }
     for (int i = 0; i < this._recipes.get_Count(); i++)
     {
         RevampRecipeModel   recipe = this._recipes.get_Item(i);
         List <Mem_slotitem> list   = this._all_items.FindAll((Mem_slotitem item) => item.Slotitem_id == recipe.Slotitem.MstId);
         list = list.FindAll((Mem_slotitem item) => item.Equip_flag == Mem_slotitem.enumEquipSts.Unset);
         list.Sort((Mem_slotitem a, Mem_slotitem b) => (a.Level >= b.Level) ? -1 : 1);
         this._items.set_Item(recipe.RecipeId, list.ConvertAll <SlotitemModel>((Mem_slotitem item) => new SlotitemModel(item)));
     }
 }
Exemple #2
0
 private void _InitializeSlotitems()
 {
     if (_all_items == null)
     {
         Api_Result <Dictionary <int, Mem_slotitem> > api_Result = new Api_get_Member().Slotitem();
         if (api_Result.state != 0)
         {
             _all_items = new List <Mem_slotitem>();
         }
         else
         {
             _all_items = new List <Mem_slotitem>(api_Result.data.Values);
         }
     }
     if (_items == null)
     {
         _items = new Dictionary <int, List <SlotitemModel> >();
     }
     else
     {
         _items.Clear();
     }
     for (int i = 0; i < _recipes.Count; i++)
     {
         RevampRecipeModel   recipe = _recipes[i];
         List <Mem_slotitem> list   = _all_items.FindAll((Mem_slotitem item) => item.Slotitem_id == recipe.Slotitem.MstId);
         list = list.FindAll((Mem_slotitem item) => item.Equip_flag == Mem_slotitem.enumEquipSts.Unset);
         list.Sort((Mem_slotitem a, Mem_slotitem b) => (a.Level < b.Level) ? 1 : (-1));
         _items[recipe.RecipeId] = list.ConvertAll((Mem_slotitem item) => new SlotitemModel(item));
     }
 }
        public void Initialize(int realIndex, RevampRecipeScrollUIModel model)
        {
            this.mRealIndex = realIndex;
            this.mRevampRecipeScrollUIModel = model;
            RevampRecipeModel model2   = this.mRevampRecipeScrollUIModel.Model;
            SlotitemModel_Mst slotitem = model2.Slotitem;

            this.mTexture_WeaponThumbnail.mainTexture = (Resources.Load("Textures/SlotItems/" + slotitem.MstId + "/2") as Texture);
            this.mLabel_WeaponName.text            = slotitem.Name;
            this.mSprite_WeaponTypeIcon.spriteName = "icon_slot" + slotitem.Type4;
            this.mLabel_Fuel.text      = model2.Fuel.ToString();
            this.mLabel_Steel.text     = model2.Steel.ToString();
            this.mLabel_DevKit.text    = model2.DevKit.ToString();
            this.mLabel_Ammo.text      = model2.Ammo.ToString();
            this.mLabel_Bauxite.text   = model2.Baux.ToString();
            this.mLabel_RevampKit.text = model2.RevKit.ToString();
            this.mWidgetThis.alpha     = 1f;
            bool clickable = this.mRevampRecipeScrollUIModel.Clickable;

            if (clickable)
            {
                this.mSprite_ButtonState.spriteName = "btn_select";
            }
            else
            {
                this.mSprite_ButtonState.spriteName = "btn_select_off";
            }
        }
Exemple #4
0
        public void Initialize(RevampManager revampManager)
        {
            base.ChangeImmediateContentPosition(UIScrollList <RevampRecipeScrollUIModel, UIRevampRecipeScrollChildNew> .ContentDirection.Hell);
            this.mRevampManager = revampManager;
            RevampRecipeModel[] array             = Enumerable.ToArray <RevampRecipeModel>(this.mRevampManager.GetRecipes());
            List <RevampRecipeScrollUIModel> list = new List <RevampRecipeScrollUIModel>();

            RevampRecipeModel[] array2 = array;
            for (int i = 0; i < array2.Length; i++)
            {
                RevampRecipeModel revampRecipeModel = array2[i];
                bool clickable = 0 < this.mRevampManager.GetSlotitemList(revampRecipeModel.RecipeId).Length;
                RevampRecipeScrollUIModel revampRecipeScrollUIModel = new RevampRecipeScrollUIModel(revampRecipeModel, clickable);
                list.Add(revampRecipeScrollUIModel);
            }
            base.Initialize(list.ToArray());
        }
        public RevampRecipeDetailModel GetDetail(int recipe_id, int slotitem_mem_id)
        {
            Api_Result <Mst_slotitem_remodel_detail> slotitemRemodelListDetail = this._req.getSlotitemRemodelListDetail(recipe_id, slotitem_mem_id);

            if (slotitemRemodelListDetail.state != Api_Result_State.Success)
            {
                return(null);
            }
            RevampRecipeModel revampRecipeModel = this._recipes.Find((RevampRecipeModel r) => r.RecipeId == recipe_id);

            if (revampRecipeModel == null)
            {
                return(null);
            }
            SlotitemModel slotitemModel = this._items.get_Item(recipe_id).Find((SlotitemModel slotiitem) => slotiitem.MemId == slotitem_mem_id);

            if (slotitemModel == null)
            {
                return(null);
            }
            return(new RevampRecipeDetailModel(revampRecipeModel.__mst__, slotitemRemodelListDetail.data, slotitemModel));
        }
Exemple #6
0
        private void OnSelectedRecipeListener(UIRevampRecipeScrollChildNew child)
        {
            mRevampRecipeScrollParentNew.LockControl();
            int num = UnityEngine.Random.Range(0, 100);

            if (30 < num)
            {
                PlayAkashiVoice(mAudioClip_303);
            }
            else
            {
                PlayAkashiVoice(mAudioClip_304);
            }
            RevampRecipeModel model = child.GetModel().Model;

            mRevampContext.SetRevampRecipe(model);
            SoundUtils.PlaySE(mAudioClip_SE_002);
            mRevampRecipeScrollParentNew.SetActive(isActive: false);
            KeyControl keyController = ShowUIRevampSlotItemGrid(mRevampContext);

            ChangeFocusKeyController(keyController);
        }
Exemple #7
0
 public void Initialize(SlotitemModel[] models, RevampRecipeModel revampRecipe)
 {
     base.Initialize(models);
     mRevampRecipeModel = revampRecipe;
 }
 public void Initialize(RevampRecipeModel recipeModel, SlotitemModel[] slotItemModels)
 {
     this.mRevampRecipeModel = recipeModel;
     base.Initialize(slotItemModels);
 }
Exemple #9
0
 public void SetRevampRecipe(RevampRecipeModel revampRecipeModel)
 {
     mRevampRecipe = revampRecipeModel;
 }
Exemple #10
0
 public RevampRecipeScrollUIModel(RevampRecipeModel model, bool clickable)
 {
     this.Model     = model;
     this.Clickable = clickable;
 }