| | |
| | | namespace Snxxz.UI |
| | | { |
| | | [XLua.LuaCallCSharp] |
| | | public class EquipTrainModel : Model, IBeforePlayerDataInitialize |
| | | public class EquipTrainModel : Model, IBeforePlayerDataInitialize, IAfterPlayerDataInitialize |
| | | { |
| | | public readonly LogicInt selectedLevel = new LogicInt(); |
| | | public readonly LogicInt selectedPlace = new LogicInt(); |
| | |
| | | static Dictionary<int, int> trainTypes = new Dictionary<int, int>(); |
| | | Dictionary<int, EquipTrainSet> equipTrains = new Dictionary<int, EquipTrainSet>(); |
| | | |
| | | Redpoint redpoint = new Redpoint(106,910000); |
| | | Redpoint redpoint = new Redpoint(106, 910000); |
| | | bool redpointDirty = false; |
| | | LogicUpdate logicUpdate = new LogicUpdate(1); |
| | | |
| | |
| | | { |
| | | train.Reset(); |
| | | } |
| | | } |
| | | |
| | | public void OnAfterPlayerDataInitialize() |
| | | { |
| | | redpointDirty = true; |
| | | } |
| | | |
| | | public void ResetOperateParams() |
| | |
| | | GameNetSystem.Instance.SendInfo(equipWash); |
| | | }; |
| | | |
| | | if (inevitableCount > 0) |
| | | if (inevitableCount == 0) |
| | | { |
| | | var trainLevel = GetTrainLevel(equipPosition); |
| | | var trainType = GetTrainType(equipPosition.y); |
| | | var config = EquipWashConfig.Get(trainType, trainLevel); |
| | | processTrain(); |
| | | return; |
| | | } |
| | | |
| | | var inevitableNeed = config != null ? config.mustCosts[inevitableCount - 1] : 0; |
| | | var inevitableOwn = packModel.GetItemCountByID(PackType.Item, GeneralDefine.equipTrainMustItemId); |
| | | var trainLevel = GetTrainLevel(equipPosition); |
| | | var trainType = GetTrainType(equipPosition.y); |
| | | var config = EquipWashConfig.Get(trainType, trainLevel); |
| | | |
| | | var diamondNeed = (inevitableNeed - inevitableOwn) * GetInevitableMaterialPrice(); |
| | | var diamondOwn = PlayerDatas.Instance.baseData.diamond; |
| | | var inevitableNeed = config != null ? config.mustCosts[inevitableCount - 1] : 0; |
| | | var inevitableOwn = packModel.GetItemCountByID(PackType.Item, GeneralDefine.equipTrainMustItemId); |
| | | |
| | | if (diamondNeed > diamondOwn) |
| | | if (inevitableOwn >= inevitableNeed) |
| | | { |
| | | processTrain(); |
| | | return; |
| | | } |
| | | |
| | | var diamondNeed = (inevitableNeed - inevitableOwn) * GetInevitableMaterialPrice(); |
| | | var diamondOwn = PlayerDatas.Instance.baseData.diamond; |
| | | if (diamondNeed > diamondOwn) |
| | | { |
| | | WindowCenter.Instance.Open<RechargeTipWin>(); |
| | | return; |
| | | } |
| | | |
| | | if (DayRemind.Instance.GetDayRemind(DayRemind.EQUIPTRAIN_COSTDIAMOND)) |
| | | { |
| | | processTrain(); |
| | | return; |
| | | } |
| | | |
| | | ConfirmCancel.ToggleConfirmCancel(Language.Get("Mail101"), |
| | | Language.Get("EquipWash103", inevitableNeed - inevitableOwn, diamondNeed), |
| | | Language.Get("TodayNoNotify"), (bool ok, bool isToggle) => |
| | | { |
| | | WindowCenter.Instance.Open<RechargeTipWin>(); |
| | | return; |
| | | } |
| | | |
| | | if (diamondNeed > 0) |
| | | { |
| | | if (!DayRemind.Instance.GetDayRemind(DayRemind.EQUIPTRAIN_COSTDIAMOND)) |
| | | if (isToggle) |
| | | { |
| | | ConfirmCancel.ToggleConfirmCancel(Language.Get("Mail101"), |
| | | Language.Get("EquipWash103", inevitableNeed - inevitableOwn, diamondNeed), |
| | | Language.Get("TodayNoNotify"), (bool ok, bool isToggle) => |
| | | { |
| | | if (isToggle) |
| | | { |
| | | DayRemind.Instance.SetDayRemind(DayRemind.EQUIPTRAIN_COSTDIAMOND, true); |
| | | } |
| | | |
| | | if (ok) |
| | | { |
| | | processTrain(); |
| | | } |
| | | }); |
| | | DayRemind.Instance.SetDayRemind(DayRemind.EQUIPTRAIN_COSTDIAMOND, true); |
| | | } |
| | | else |
| | | |
| | | if (ok) |
| | | { |
| | | processTrain(); |
| | | } |
| | | } |
| | | } |
| | | else |
| | | { |
| | | processTrain(); |
| | | } |
| | | }); |
| | | |
| | | } |
| | | |