|
@@ -8,6 +8,7 @@ namespace GFGGame
|
|
{
|
|
{
|
|
public class DressUpView : BaseView
|
|
public class DressUpView : BaseView
|
|
{
|
|
{
|
|
|
|
+ public const int MAX_MEMORY_STEP = 20;//最大记录步数
|
|
public const int BOTTOM_BLANK = 20;
|
|
public const int BOTTOM_BLANK = 20;
|
|
public const int RIGHT_BLANK = 36;
|
|
public const int RIGHT_BLANK = 36;
|
|
private const int SORT_BY_HIGH_RARITY = 0;
|
|
private const int SORT_BY_HIGH_RARITY = 0;
|
|
@@ -32,6 +33,8 @@ namespace GFGGame
|
|
private UI_TypeItem listTypeItem_FreedomDress;
|
|
private UI_TypeItem listTypeItem_FreedomDress;
|
|
private List<LongPressGesture> _listLongPress = new List<LongPressGesture>();
|
|
private List<LongPressGesture> _listLongPress = new List<LongPressGesture>();
|
|
|
|
|
|
|
|
+ private int _stepIndex = 0;
|
|
|
|
+ private List<CustomSuitData> _dressMemory = new List<CustomSuitData>();
|
|
public override void Dispose()
|
|
public override void Dispose()
|
|
{
|
|
{
|
|
if (_sceneObject != null)
|
|
if (_sceneObject != null)
|
|
@@ -75,12 +78,13 @@ namespace GFGGame
|
|
InitLists();
|
|
InitLists();
|
|
_ui.m_btnBack.onClick.Add(OnClickBtnBack);
|
|
_ui.m_btnBack.onClick.Add(OnClickBtnBack);
|
|
_ui.m_btnHome.onClick.Add(OnClickBtnHome);
|
|
_ui.m_btnHome.onClick.Add(OnClickBtnHome);
|
|
|
|
+ _ui.m_btnLastStep.onClick.Add(OnClickBtnLastStep);
|
|
|
|
+ _ui.m_btnNextStep.onClick.Add(OnClickBtnNextStep);
|
|
_ui.m_comboBox.onChanged.Add(OnComboBoxChanged);
|
|
_ui.m_comboBox.onChanged.Add(OnComboBoxChanged);
|
|
_ui.m_comListType1.m_listType.onClickItem.Add(OnClickListType1Item);
|
|
_ui.m_comListType1.m_listType.onClickItem.Add(OnClickListType1Item);
|
|
_ui.m_comListType2.m_listType.onClickItem.Add(OnClickListType2Item);
|
|
_ui.m_comListType2.m_listType.onClickItem.Add(OnClickListType2Item);
|
|
// _ui.m_partsList.m_list.SetVirtual();
|
|
// _ui.m_partsList.m_list.SetVirtual();
|
|
_ui.m_partsList.m_list.onClickItem.Add(OnClickPartsListItem);
|
|
_ui.m_partsList.m_list.onClickItem.Add(OnClickPartsListItem);
|
|
- // _ui.m_partsList2.m_list.SetVirtual();
|
|
|
|
_ui.m_partsList2.m_list.onClickItem.Add(OnClickSuitPartsListItem);
|
|
_ui.m_partsList2.m_list.onClickItem.Add(OnClickSuitPartsListItem);
|
|
_ui.m_touchPad.onClick.Add(OnTouchPad);
|
|
_ui.m_touchPad.onClick.Add(OnTouchPad);
|
|
_ui.m_btnDelete.onClick.Add(OnClickBtnDelete);
|
|
_ui.m_btnDelete.onClick.Add(OnClickBtnDelete);
|
|
@@ -122,6 +126,7 @@ namespace GFGGame
|
|
}
|
|
}
|
|
_ui.m_comboBox.selectedIndex = CustomSuitDataManager.currentIndex;
|
|
_ui.m_comboBox.selectedIndex = CustomSuitDataManager.currentIndex;
|
|
EquipDataCache.cacher.PutOnCurrentSuitSaved();
|
|
EquipDataCache.cacher.PutOnCurrentSuitSaved();
|
|
|
|
+ UpdateStepBtn();
|
|
|
|
|
|
Timers.inst.AddUpdate(CheckGuide);
|
|
Timers.inst.AddUpdate(CheckGuide);
|
|
}
|
|
}
|
|
@@ -165,6 +170,24 @@ namespace GFGGame
|
|
DressUpMenuItemDataManager.dressFilterType = DressFilterType.None;
|
|
DressUpMenuItemDataManager.dressFilterType = DressFilterType.None;
|
|
DressUpMenuItemDataManager.Clear();
|
|
DressUpMenuItemDataManager.Clear();
|
|
DressUpMenuItemDataManager.dressSearchTxt = "";
|
|
DressUpMenuItemDataManager.dressSearchTxt = "";
|
|
|
|
+ _stepIndex = 0;
|
|
|
|
+ _dressMemory.Clear();
|
|
|
|
+ }
|
|
|
|
+ private void OnClickBtnLastStep()
|
|
|
|
+ {
|
|
|
|
+ if (_stepIndex - 1 < 0) return;
|
|
|
|
+ _stepIndex--;
|
|
|
|
+ EquipDataCache.cacher.PutOnSuitMemory(_dressMemory[_stepIndex]);
|
|
|
|
+ UpdateStepBtn();
|
|
|
|
+
|
|
|
|
+ }
|
|
|
|
+ private void OnClickBtnNextStep()
|
|
|
|
+ {
|
|
|
|
+ if (_stepIndex + 1 >= MAX_MEMORY_STEP) return;
|
|
|
|
+ _stepIndex++;
|
|
|
|
+ EquipDataCache.cacher.PutOnSuitMemory(_dressMemory[_stepIndex]);
|
|
|
|
+ UpdateStepBtn();
|
|
|
|
+
|
|
}
|
|
}
|
|
private void OnComboBoxChanged()
|
|
private void OnComboBoxChanged()
|
|
{
|
|
{
|
|
@@ -224,7 +247,8 @@ namespace GFGGame
|
|
}
|
|
}
|
|
GObject listItem = (GObject)context.data as GObject;
|
|
GObject listItem = (GObject)context.data as GObject;
|
|
int id = (int)listItem.data;
|
|
int id = (int)listItem.data;
|
|
- if (_currentMenuType == (int)ConstDressUpItemType.TAO_ZHUANG)
|
|
|
|
|
|
+ bool isSuit = SuitCfgManager.Instance.GetTotalCountOfOneSuit(id) > 0;
|
|
|
|
+ if (isSuit)
|
|
{
|
|
{
|
|
this.showListParts2(id);
|
|
this.showListParts2(id);
|
|
this.hideListParts();
|
|
this.hideListParts();
|
|
@@ -237,10 +261,11 @@ namespace GFGGame
|
|
EquipDataCache.cacher.AddOrRemove(id, true);
|
|
EquipDataCache.cacher.AddOrRemove(id, true);
|
|
}
|
|
}
|
|
UpdateListPartsSelected();
|
|
UpdateListPartsSelected();
|
|
- UpdateListSuitPartsSelected();
|
|
|
|
-
|
|
|
|
|
|
+ UpdateListSuitPartsSelected(); ;
|
|
|
|
+ // AddMemoryDressup();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+
|
|
private void OnClickSuitPartsListItem(EventContext context)
|
|
private void OnClickSuitPartsListItem(EventContext context)
|
|
{
|
|
{
|
|
if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
|
|
if (ViewManager.isViewOpen(typeof(DressUpItemTipsView).FullName))
|
|
@@ -255,7 +280,31 @@ namespace GFGGame
|
|
|
|
|
|
UpdateListSuitPartsSelected();
|
|
UpdateListSuitPartsSelected();
|
|
UpdateBtnAction();
|
|
UpdateBtnAction();
|
|
|
|
+ // AddMemoryDressup();
|
|
}
|
|
}
|
|
|
|
+ private void AddMemoryDressup()
|
|
|
|
+ {
|
|
|
|
+ _stepIndex++;
|
|
|
|
+ if (_stepIndex == MAX_MEMORY_STEP)
|
|
|
|
+ {
|
|
|
|
+ _stepIndex = MAX_MEMORY_STEP - 1;
|
|
|
|
+ _dressMemory.RemoveAt(0);
|
|
|
|
+ }
|
|
|
|
+ ET.Log.Debug("_stepIndex:" + _stepIndex + " _dressMemory.Count:" + _dressMemory.Count);
|
|
|
|
+ if (_dressMemory.Count > _stepIndex)
|
|
|
|
+ {
|
|
|
|
+ _dressMemory.RemoveRange(_stepIndex, _dressMemory.Count - _stepIndex);
|
|
|
|
+ }
|
|
|
|
+ CustomSuitData suitSavedData = EquipDataCache.cacher.GetCurSuitData(_ui.m_comboBox.selectedIndex);
|
|
|
|
+ _dressMemory.Add(suitSavedData);
|
|
|
|
+ UpdateStepBtn();
|
|
|
|
+ }
|
|
|
|
+ private void UpdateStepBtn()
|
|
|
|
+ {
|
|
|
|
+ _ui.m_btnLastStep.enabled = _stepIndex > 0;
|
|
|
|
+ _ui.m_btnNextStep.enabled = _stepIndex < _dressMemory.Count - 1;
|
|
|
|
+ }
|
|
|
|
+
|
|
private void OnLongPress(EventContext context)
|
|
private void OnLongPress(EventContext context)
|
|
{
|
|
{
|
|
LongPressGesture gesture = (LongPressGesture)context.sender;
|
|
LongPressGesture gesture = (LongPressGesture)context.sender;
|