|
@@ -19,8 +19,8 @@ namespace GFGGame
|
|
private bool _actionIsPic;
|
|
private bool _actionIsPic;
|
|
|
|
|
|
private List<int> _suitIds;//已解锁套装列表
|
|
private List<int> _suitIds;//已解锁套装列表
|
|
- private SortedList _propertyList;
|
|
|
|
- private SortedList _addPropertyList;
|
|
|
|
|
|
+ private SortedList _propertyList = new SortedList();
|
|
|
|
+ private SortedList _addPropertyList = new SortedList();
|
|
private int _suitId;
|
|
private int _suitId;
|
|
private int _index;
|
|
private int _index;
|
|
|
|
|
|
@@ -39,10 +39,9 @@ namespace GFGGame
|
|
packageName = UI_SuitUI.PACKAGE_NAME;
|
|
packageName = UI_SuitUI.PACKAGE_NAME;
|
|
_ui = UI_SuitUI.Create();
|
|
_ui = UI_SuitUI.Create();
|
|
this.viewCom = _ui.target;
|
|
this.viewCom = _ui.target;
|
|
- this.viewCom.Center();
|
|
|
|
-
|
|
|
|
|
|
+ // this.viewCom.Center();
|
|
isfullScreen = true;
|
|
isfullScreen = true;
|
|
- this.clickBlankToClose = false;
|
|
|
|
|
|
+ // this.clickBlankToClose = false;
|
|
|
|
|
|
_scenePrefab = GFGAsset.Load<GameObject>(ResPathUtil.GetPrefabPath("SceneDressUp"));
|
|
_scenePrefab = GFGAsset.Load<GameObject>(ResPathUtil.GetPrefabPath("SceneDressUp"));
|
|
_dressUpObjDataCache = new DressUpObjDataCache();
|
|
_dressUpObjDataCache = new DressUpObjDataCache();
|
|
@@ -85,8 +84,12 @@ namespace GFGGame
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ _index = SuitFosterDataManager.Instance.GetSuitFosterData(_suitId).maintainStep;
|
|
|
|
+ _ui.m_c1.selectedIndex = 0;
|
|
UpdateView();
|
|
UpdateView();
|
|
|
|
|
|
|
|
+ Debug.Log("养护奖励:" + ItemDataManager.GetItemNum(100169));
|
|
|
|
+ Debug.Log("换新奖励:" + ItemDataManager.GetItemNum(10370));
|
|
}
|
|
}
|
|
|
|
|
|
protected override void OnHide()
|
|
protected override void OnHide()
|
|
@@ -160,6 +163,7 @@ namespace GFGGame
|
|
if (targetIndex >= 0 && direction == -1 || targetIndex < _suitIds.Count && direction == 1)
|
|
if (targetIndex >= 0 && direction == -1 || targetIndex < _suitIds.Count && direction == 1)
|
|
{
|
|
{
|
|
_suitId = _suitIds[targetIndex];
|
|
_suitId = _suitIds[targetIndex];
|
|
|
|
+ _index = SuitFosterDataManager.Instance.GetSuitFosterData(_suitId).maintainStep;
|
|
UpdateView();
|
|
UpdateView();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -168,9 +172,12 @@ namespace GFGGame
|
|
private void UpdateFoster()
|
|
private void UpdateFoster()
|
|
{
|
|
{
|
|
UpdateFosterReward();
|
|
UpdateFosterReward();
|
|
|
|
+ _propertyList.Clear();
|
|
|
|
+ _addPropertyList.Clear();
|
|
|
|
+ _ui.m_listFoster.numItems = SuitFosterCfgArray.Instance.GetCfgs(_suitId).Length;
|
|
|
|
+
|
|
SuitFosterDataManager.Instance.GetPropertyData(_suitId, _index, out _propertyList, out _addPropertyList);
|
|
SuitFosterDataManager.Instance.GetPropertyData(_suitId, _index, out _propertyList, out _addPropertyList);
|
|
_ui.m_listProperty.numItems = _propertyList.Count;
|
|
_ui.m_listProperty.numItems = _propertyList.Count;
|
|
- _ui.m_listFoster.numItems = SuitFosterCfgArray.Instance.GetCfgs(_suitId).Length;
|
|
|
|
}
|
|
}
|
|
private void UpdateFosterReward()
|
|
private void UpdateFosterReward()
|
|
{
|
|
{
|
|
@@ -186,10 +193,7 @@ namespace GFGGame
|
|
UI_ListFosterItem item = UI_ListFosterItem.Proxy(obj);
|
|
UI_ListFosterItem item = UI_ListFosterItem.Proxy(obj);
|
|
item.target.data = index;
|
|
item.target.data = index;
|
|
item.m_finish.selectedIndex = SuitFosterDataManager.Instance.GetFosterState(_suitId, index);
|
|
item.m_finish.selectedIndex = SuitFosterDataManager.Instance.GetFosterState(_suitId, index);
|
|
- if (SuitFosterDataManager.Instance.GetSuitFosterData(_suitId).maintainStep == index)
|
|
|
|
- {
|
|
|
|
- _index = index;
|
|
|
|
- }
|
|
|
|
|
|
+ item.m_txtName.text = SuitFosterDataManager.Instance.stepNames[index];
|
|
}
|
|
}
|
|
|
|
|
|
private void ListPropertyItemRender(int index, GObject obj)
|
|
private void ListPropertyItemRender(int index, GObject obj)
|
|
@@ -216,7 +220,6 @@ namespace GFGGame
|
|
{
|
|
{
|
|
PromptController.Instance.ShowFloatTextPrompt(string.Format("请完成{0}阶段", SuitFosterDataManager.Instance.stepNames[_index]));
|
|
PromptController.Instance.ShowFloatTextPrompt(string.Format("请完成{0}阶段", SuitFosterDataManager.Instance.stepNames[_index]));
|
|
}
|
|
}
|
|
- SuitFosterHelper.SendMaintainSuit(_suitId, index + 1).Coroutine();
|
|
|
|
}
|
|
}
|
|
private void OnClickComFosterReward()
|
|
private void OnClickComFosterReward()
|
|
{
|
|
{
|
|
@@ -238,11 +241,12 @@ namespace GFGGame
|
|
private void OnListenerFoster()
|
|
private void OnListenerFoster()
|
|
{
|
|
{
|
|
_ui.m_comFosterAni.target.visible = true;
|
|
_ui.m_comFosterAni.target.visible = true;
|
|
|
|
+ _ui.m_comFosterAni.m_txtContent.text = string.Format("服装{0}中......", SuitFosterDataManager.Instance.stepNames[_index]);
|
|
_ui.m_comFosterAni.m_proFoster.value = 0;
|
|
_ui.m_comFosterAni.m_proFoster.value = 0;
|
|
_ui.m_comFosterAni.m_proFoster.TweenValue(100, 2f).OnComplete(() =>
|
|
_ui.m_comFosterAni.m_proFoster.TweenValue(100, 2f).OnComplete(() =>
|
|
{
|
|
{
|
|
_ui.m_comFosterAni.target.visible = false;
|
|
_ui.m_comFosterAni.target.visible = false;
|
|
- ViewManager.Show<SuitFosterFinishView>(_propertyList);
|
|
|
|
|
|
+ ViewManager.Show<SuitFosterFinishView>(new object[] { _suitId, _index, _propertyList });
|
|
UpdateFoster();
|
|
UpdateFoster();
|
|
});
|
|
});
|
|
|
|
|
|
@@ -252,6 +256,8 @@ namespace GFGGame
|
|
SuitFosterCfg cfg = SuitFosterCfgArray.Instance.GetCfgs(_suitId)[(int)(context.data) - 1];
|
|
SuitFosterCfg cfg = SuitFosterCfgArray.Instance.GetCfgs(_suitId)[(int)(context.data) - 1];
|
|
ViewManager.Show<RewardView>(ItemUtil.CreateItemDataList(cfg.rewardsArr));
|
|
ViewManager.Show<RewardView>(ItemUtil.CreateItemDataList(cfg.rewardsArr));
|
|
UpdateFosterReward();
|
|
UpdateFosterReward();
|
|
|
|
+ Debug.Log("养护奖励:" + ItemDataManager.GetItemNum(100169));
|
|
|
|
+
|
|
}
|
|
}
|
|
/*************************************************换新************************************************/
|
|
/*************************************************换新************************************************/
|
|
private void UpdateRenew()
|
|
private void UpdateRenew()
|
|
@@ -273,10 +279,10 @@ namespace GFGGame
|
|
int suitrarity = SuitCfgArray.Instance.GetCfg(_suitId).rarity;
|
|
int suitrarity = SuitCfgArray.Instance.GetCfg(_suitId).rarity;
|
|
SuitRenewCfg renewCfg = SuitRenewCfgArray.Instance.GetCfg(suitrarity);
|
|
SuitRenewCfg renewCfg = SuitRenewCfgArray.Instance.GetCfg(suitrarity);
|
|
SuitFosterListCfg cfg = SuitFosterListCfgArray.Instance.GetCfg(_suitId);
|
|
SuitFosterListCfg cfg = SuitFosterListCfgArray.Instance.GetCfg(_suitId);
|
|
- _ui.m_comRenewReward.m_loaReward.visible = false;
|
|
|
|
|
|
+ _ui.m_comRenewReward.target.visible = false;
|
|
if (cfg.renewRewardsArr.Length > 0)
|
|
if (cfg.renewRewardsArr.Length > 0)
|
|
{
|
|
{
|
|
- _ui.m_comRenewReward.m_loaReward.visible = true;
|
|
|
|
|
|
+ _ui.m_comRenewReward.target.visible = true;
|
|
ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(cfg.renewRewardsArr[0][0]);
|
|
ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(cfg.renewRewardsArr[0][0]);
|
|
_ui.m_comRenewReward.m_loaReward.url = ResPathUtil.GetIconPath(itemCfg);
|
|
_ui.m_comRenewReward.m_loaReward.url = ResPathUtil.GetIconPath(itemCfg);
|
|
}
|
|
}
|
|
@@ -288,8 +294,8 @@ namespace GFGGame
|
|
UI_ComConsumeCurrency comConsumeCurrency = UI_ComConsumeCurrency.Proxy(_ui.m_comRenewCost);
|
|
UI_ComConsumeCurrency comConsumeCurrency = UI_ComConsumeCurrency.Proxy(_ui.m_comRenewCost);
|
|
int has = ItemDataManager.GetItemNum(renewCfg.costId);
|
|
int has = ItemDataManager.GetItemNum(renewCfg.costId);
|
|
int need = renewCfg.costNum;
|
|
int need = renewCfg.costNum;
|
|
- // comConsumeCurrency.m_txtHas.text = has.ToString();
|
|
|
|
- comConsumeCurrency.m_txtNeed.text = need.ToString();
|
|
|
|
|
|
+ comConsumeCurrency.m_txtNeed.text = StringUtil.GetColorText(need.ToString(), has >= need ? "#FFF8EA" : "#C9F1A5");
|
|
|
|
+ comConsumeCurrency.m_txtLine.text = "";
|
|
if (_canRenew && has < need) _canRenew = false;
|
|
if (_canRenew && has < need) _canRenew = false;
|
|
}
|
|
}
|
|
private void UpdateRenewFinish()
|
|
private void UpdateRenewFinish()
|
|
@@ -310,16 +316,17 @@ namespace GFGGame
|
|
ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(materialsArr[index][0]);
|
|
ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(materialsArr[index][0]);
|
|
item.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
|
|
item.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
|
|
int has = ItemDataManager.GetItemNum(itemCfg.id);
|
|
int has = ItemDataManager.GetItemNum(itemCfg.id);
|
|
- item.m_txtHas.text = has.ToString();
|
|
|
|
int need = materialsArr[index][1];
|
|
int need = materialsArr[index][1];
|
|
- item.m_txtNeed.text = StringUtil.GetColorText(need.ToString(), has >= need ? "#DD994A" : "#DD994A");
|
|
|
|
|
|
+ item.m_txtHas.text = StringUtil.GetColorText(has.ToString(), has >= need ? "#F2DB96" : "#C9F1A5");
|
|
|
|
+ item.m_txtNeed.text = need.ToString();
|
|
if (_canRenew && has < need) _canRenew = false;
|
|
if (_canRenew && has < need) _canRenew = false;
|
|
item.target.data = materialsArr[index][0];
|
|
item.target.data = materialsArr[index][0];
|
|
}
|
|
}
|
|
private void OnListRenewMaterialsItem(EventContext context)
|
|
private void OnListRenewMaterialsItem(EventContext context)
|
|
{
|
|
{
|
|
int itemId = (int)(context.data as GComponent).data;
|
|
int itemId = (int)(context.data as GComponent).data;
|
|
- GoodsItemTipsController.ShowItemTips(itemId);
|
|
|
|
|
|
+ // GoodsItemTipsController.ShowItemTips(itemId);
|
|
|
|
+ ViewManager.Show(ViewName.APPROACH_OF_ITEM_VIEW, new object[] { itemId, new object[] { typeof(SuitView).FullName, this.viewData } });
|
|
}
|
|
}
|
|
|
|
|
|
private void OnClickBtnRenew()
|
|
private void OnClickBtnRenew()
|
|
@@ -330,11 +337,21 @@ namespace GFGGame
|
|
PromptController.Instance.ShowFloatTextPrompt("材料不足");
|
|
PromptController.Instance.ShowFloatTextPrompt("材料不足");
|
|
return;
|
|
return;
|
|
}
|
|
}
|
|
|
|
+ SuitFosterData data = SuitFosterDataManager.Instance.GetSuitFosterData(_suitId);
|
|
|
|
+ SuitFosterListCfg cfg = SuitFosterListCfgArray.Instance.GetCfg(_suitId);
|
|
|
|
+ if (data.maintainStep < cfg.renewOpenLv)
|
|
|
|
+ {
|
|
|
|
+ PromptController.Instance.ShowFloatTextPrompt(string.Format("完成{0}开启换新", SuitFosterDataManager.Instance.stepNames[cfg.renewOpenLv - 1]));
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
|
|
+ SuitFosterHelper.SendMakeNewSuit(_suitId).Coroutine();
|
|
}
|
|
}
|
|
private void OnListenerRenew()
|
|
private void OnListenerRenew()
|
|
{
|
|
{
|
|
ViewManager.Show<SuitRenewFinishView>(_suitId);
|
|
ViewManager.Show<SuitRenewFinishView>(_suitId);
|
|
UpdateRenew();
|
|
UpdateRenew();
|
|
|
|
+ Debug.Log("换新奖励:" + ItemDataManager.GetItemNum(10370));
|
|
|
|
+
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|