From 51b0f6ed9f4e1d3bb6f8144470b46908c7699a96 Mon Sep 17 00:00:00 2001
From: yyl <yyl>
Date: 星期一, 11 五月 2026 16:20:37 +0800
Subject: [PATCH] Merge branch 'master' into h5version
---
Main/System/Store/StoreModel.cs | 87 +++++++++++++++++++++++++++++++++++--------
1 files changed, 70 insertions(+), 17 deletions(-)
diff --git a/Main/System/Store/StoreModel.cs b/Main/System/Store/StoreModel.cs
index 56e6eb9..5cee567 100644
--- a/Main/System/Store/StoreModel.cs
+++ b/Main/System/Store/StoreModel.cs
@@ -1,7 +1,7 @@
锘縰sing System;
using System.Collections.Generic;
using System.Linq;
-
+using Cysharp.Threading.Tasks;
using UnityEngine;
using LitJson;
using System.Collections;
@@ -29,7 +29,7 @@
public event Action RefreshShopEvent;
public StoreFunc selectStoreFuncType = StoreFunc.Normal;
-
+ public int jumpShopID;
public int buyShopID;
@@ -40,6 +40,8 @@
public Dictionary<int, List<int>> freeShopDict = new Dictionary<int, List<int>>(); //鍏嶈垂鍟嗗搧 鍟嗗簵绫诲瀷锛氬晢鍝佸垪琛�
public Dictionary<int, int> shopMoneyTypeDict = new Dictionary<int, int>();
+
+
public override void Init()
{
@@ -362,14 +364,28 @@
public void SendBuyShopItem(StoreConfig model, int count)
{
- if (UIHelper.CheckMoneyCount(model.MoneyType, model.MoneyNum * count, 2))
+ if (model.MoneyType <= 0)
{
- CA310_tagCSBuyItem buyShop = new CA310_tagCSBuyItem();
- buyShop.ShopID = (ushort)model.ID;
- buyShop.BuyCount = (uint)count;
- GameNetSystem.Instance.SendInfo(buyShop);
+ if (UIHelper.CheckItemCount(model.CostItemID, model.MoneyNum * count, 2))
+ {
+ SendBuyItem(model.ID, count);
+ }
}
+ else
+ {
+ if (UIHelper.CheckMoneyCount(model.MoneyType, model.MoneyNum * count, 2))
+ {
+ SendBuyItem(model.ID, count);
+ }
+ }
+ }
+ public void SendBuyItem(int shopID, int count)
+ {
+ CA310_tagCSBuyItem buyShop = new CA310_tagCSBuyItem();
+ buyShop.ShopID = (ushort)shopID;
+ buyShop.BuyCount = (uint)count;
+ GameNetSystem.Instance.SendInfo(buyShop);
}
//璐у竵璐拱鐨勪簩娆$‘璁ゆ鐨勭‘璁よ褰�
@@ -392,16 +408,21 @@
return;
}
- ConfirmCancel.ToggleConfirmCancel(Language.Get("Mail101"), Language.Get("BuyStoreItem", model.MoneyNum, model.MoneyType, model.Name),
- Language.Get("ConfirmCancel102"), (bool isOk, bool isToggle) =>
- {
- if (isOk)
+ ConfirmCancel.ToggleConfirmCancel(
+ Language.Get("Mail101"),
+ model.MoneyType <= 0 ?
+ Language.Get("BuyStoreItem1", model.MoneyNum, ItemConfig.Get(model.CostItemID).ItemName, model.Name) :
+ Language.Get("BuyStoreItem", model.MoneyNum, model.MoneyType, model.Name),
+ Language.Get("ConfirmCancel102"),
+ (isOk, isToggle) =>
{
- SendBuyShopItem(model, count);
- buyItemCheckDict[eventType] = isToggle;
- }
-
- });
+ if (isOk)
+ {
+ SendBuyShopItem(model, count);
+ buyItemCheckDict[eventType] = isToggle;
+ }
+
+ });
}
//鑺变粰鐜夎喘涔扮殑浜屾纭妗�(鏈鐧诲綍)
@@ -562,6 +583,30 @@
}
return true;
}
+
+ // 寮瑰嚭璐拱妗嗭紝涓嶈冻鍒欐彁绀哄凡鍞絼
+ public void ShowBuyItem(int shopID, int tipType = 0)
+ {
+ var cfg = StoreConfig.Get(shopID);
+ if (!TryGetIsSellOut(cfg, out var cnt))
+ {
+ buyShopID = shopID;
+ UIManager.Instance.OpenWindowAsync<BuyItemWin>().Forget();
+ }
+ else
+ {
+ if (tipType == 0)
+ {
+ //鍞絼
+ SysNotifyMgr.Instance.ShowTip("StoreTip1");
+ }
+ else if (tipType == 1)
+ {
+ //鐗╁搧涓嶈冻鎻愮ず
+ SysNotifyMgr.Instance.ShowTip("ItemNotEnough", ItemConfig.Get(cfg.ItemID).ItemName);
+ }
+ }
+ }
}
public enum StoreFunc
@@ -572,7 +617,15 @@
OSHeroCall = 4, //4锛氬紑鏈嶆嫑鍕熺ぜ鍖�
OSGalaChange = 5, //5锛氬紑鏈嶅簡鍏稿厬鎹�
OSGalaGift = 6, //6锛氬紑鏈嶅簡鍏哥ぜ鍖�
-
+ SpecialStore = 7, //7锛氱壒鎯犲晢鍩�
+ DailySpecialsFree = 8, //8: 姣忔棩鐗规儬-姣忔棩鐗规儬鍏嶈垂
+ DailyGiftFree = 9, //9: 姣忔棩鐗规儬-姣忔棩绀煎寘鍏嶈垂
+ WeeklyGiftFree = 10, //10: 姣忔棩鐗规儬-姣忓懆绀煎寘鍏嶈垂
+ HeroSkin = 16, //16: 鏃惰鍟嗗簵
+ OSBeautyMM = 17, //17: 绾㈤鍐叉绀煎寘
+ OSHeroTrain = 18, //18: 姝﹀皢鍐叉绀煎寘
+ OSMingge = 19, //19: 鍛芥牸鍐叉绀煎寘
+ Qunying = 20, //20: 缇よ嫳绉垎鍟嗗簵
}
--
Gitblit v1.8.0