From f2c78eecd49edc328225b77492e7f45e157bad02 Mon Sep 17 00:00:00 2001
From: hch <305670599@qq.com>
Date: 星期日, 28 九月 2025 23:25:25 +0800
Subject: [PATCH] 197 子 【内政】淘金系统 / 【内政】淘金系统-客户端

---
 Main/System/InternalAffairs/GoldRushAutoWin.cs.meta    |   11 +
 Main/System/InternalAffairs/AffairBaseWin.cs           |    2 
 Main/Utility/TimeUtility.cs                            |   28 ++
 Main/Component/UI/Common/CountControler.cs             |    7 
 Main/System/InternalAffairs/GoldRushAutoWin.cs         |  166 ++++++++++++++++
 Main/System/Setting/QuickSetting.cs                    |    4 
 Main/System/InternalAffairs/GoldRushLeader.cs          |    2 
 Main/Config/PartialConfigs/OrderInfoConfig.cs          |    2 
 Main/System/InternalAffairs/GoldRushAutoCell.cs.meta   |   11 +
 Main/System/InternalAffairs/GoldRushAutoBuyWin.cs.meta |   11 +
 Main/System/InternalAffairs/GoldRushAutoBuyWin.cs      |   53 +++++
 Main/Config/PartialConfigs/GoldRushItemConfig.cs       |   52 +++++
 Main/System/InternalAffairs/GoldRushAutoCell.cs        |  112 +++++++++++
 Main/Config/PartialConfigs/GoldRushItemConfig.cs.meta  |   11 +
 Main/System/InternalAffairs/GoldRushManager.cs         |   72 ++++++
 Main/Config/Configs/OrderInfoConfig.cs                 |    2 
 16 files changed, 530 insertions(+), 16 deletions(-)

diff --git a/Main/Component/UI/Common/CountControler.cs b/Main/Component/UI/Common/CountControler.cs
index b5e69aa..fee49d9 100644
--- a/Main/Component/UI/Common/CountControler.cs
+++ b/Main/Component/UI/Common/CountControler.cs
@@ -15,6 +15,7 @@
 
     int count;  //褰撳墠鏁伴噺
     int maxCount;   //鏈�澶ф暟閲�
+    string format;
 
     Action<int> OnChangeEvent;
     Func<int, bool> CanAddEvent;
@@ -60,13 +61,15 @@
 
     }
 
-    public void Init(Action<int> _OnChangeEvent, int _maxCount, int _count = 1, Func<int, bool> _CanAddEvent = null, Func<int, bool> _CanDecEvent = null)
+    public void Init(Action<int> _OnChangeEvent, int _maxCount, int _count = 1,
+    Func<int, bool> _CanAddEvent = null, Func<int, bool> _CanDecEvent = null, string _format="{0}/{1}")
     {
         count = _count;
         maxCount = _maxCount;
         OnChangeEvent = _OnChangeEvent;
         CanAddEvent = _CanAddEvent;
         CanDecEvent = _CanDecEvent;
+        format = _format;
 
         Refresh();
 
@@ -99,7 +102,7 @@
             decBtn.SetColorful(null, true);
         }
 
-        countText.text = count + "/" + maxCount;
+        countText.text = string.Format(format, count, maxCount);
         OnChangeEvent?.Invoke(count);
     }
 
diff --git a/Main/Config/Configs/OrderInfoConfig.cs b/Main/Config/Configs/OrderInfoConfig.cs
index 143e00a..e5e10b3 100644
--- a/Main/Config/Configs/OrderInfoConfig.cs
+++ b/Main/Config/Configs/OrderInfoConfig.cs
@@ -19,7 +19,7 @@
     public int id;
 	public string OrderInfo;
 	public string AppId;
-	public float PayRMBNum;
+	public float PayRMBNum; //鎵撴姌璇蜂娇鐢� PayRMBNumOnSale锛�0.1鎶橈級
 	public int CTGID;
 	public float UsdMoney;
 	public string StoreOrderInfo;
diff --git a/Main/Config/PartialConfigs/GoldRushItemConfig.cs b/Main/Config/PartialConfigs/GoldRushItemConfig.cs
new file mode 100644
index 0000000..184e00c
--- /dev/null
+++ b/Main/Config/PartialConfigs/GoldRushItemConfig.cs
@@ -0,0 +1,52 @@
+using System.Collections.Generic;
+using UnityEngine;
+
+public partial class GoldRushItemConfig : ConfigBase<int, GoldRushItemConfig>
+{
+    //鐗╁搧ID:绛夌骇锛氶厤缃�
+    public static Dictionary<int, Dictionary<int, GoldRushItemConfig>> configDics = new Dictionary<int, Dictionary<int, GoldRushItemConfig>>();
+
+    public static Dictionary<int, int> maxLVDic = new Dictionary<int, int>();
+
+    protected override void OnConfigParseCompleted()
+    {
+        Dictionary<int, GoldRushItemConfig> tempDic = null;
+        if (!configDics.TryGetValue(ItemID, out tempDic))
+        {
+            tempDic = new Dictionary<int, GoldRushItemConfig>();
+            configDics.Add(ItemID, tempDic);
+        }
+
+        tempDic[ItemLV] = this;
+
+        if (!maxLVDic.ContainsKey(ItemID))
+        {
+            maxLVDic.Add(ItemID, ItemLV);
+        }
+        else if (maxLVDic[ItemID] < ItemLV)
+        {
+            maxLVDic[ItemID] = ItemLV;
+        }
+    }
+
+    public static GoldRushItemConfig GetConfig(int itemID, int itemLV)
+    {
+        if (configDics.ContainsKey(itemID))
+        {
+            if (configDics[itemID].ContainsKey(itemLV))
+            {
+                return configDics[itemID][itemLV];
+            }
+        }
+        return null;
+    }
+
+    public static int GetMaxLV(int itemID)
+    {
+        if (maxLVDic.ContainsKey(itemID))
+        {
+            return maxLVDic[itemID];
+        }
+        return 0;
+    }
+}
\ No newline at end of file
diff --git a/Main/Config/PartialConfigs/GoldRushItemConfig.cs.meta b/Main/Config/PartialConfigs/GoldRushItemConfig.cs.meta
new file mode 100644
index 0000000..5b6d316
--- /dev/null
+++ b/Main/Config/PartialConfigs/GoldRushItemConfig.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 80844d617cff2f641abc9e1b1ed3af1d
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/Config/PartialConfigs/OrderInfoConfig.cs b/Main/Config/PartialConfigs/OrderInfoConfig.cs
index a769af4..c42d540 100644
--- a/Main/Config/PartialConfigs/OrderInfoConfig.cs
+++ b/Main/Config/PartialConfigs/OrderInfoConfig.cs
@@ -7,7 +7,7 @@
     {
         get
         {
-            return PayRMBNum * 0.01f;
+            return PayRMBNum * 1f;
         }
     }
 
diff --git a/Main/System/InternalAffairs/AffairBaseWin.cs b/Main/System/InternalAffairs/AffairBaseWin.cs
index e206583..d9b82a9 100644
--- a/Main/System/InternalAffairs/AffairBaseWin.cs
+++ b/Main/System/InternalAffairs/AffairBaseWin.cs
@@ -36,7 +36,7 @@
         );
         autoBtn.AddListener(() =>
             {
-                // UIManager.Instance.OpenWindow<RolePackWin>();
+                UIManager.Instance.OpenWindow<GoldRushAutoWin>();
             }
         );
     }
diff --git a/Main/System/InternalAffairs/GoldRushAutoBuyWin.cs b/Main/System/InternalAffairs/GoldRushAutoBuyWin.cs
new file mode 100644
index 0000000..7dba811
--- /dev/null
+++ b/Main/System/InternalAffairs/GoldRushAutoBuyWin.cs
@@ -0,0 +1,53 @@
+using UnityEngine;
+using UnityEngine.UI;
+
+
+/// <summary>
+/// 娣橀噾鑷姩缁垂
+/// </summary>
+public class GoldRushAutoBuyWin : UIBase
+{
+    [SerializeField] Text timeText;
+
+    [SerializeField] Button closeBtn;
+    [SerializeField] Button buyBtn;
+    [SerializeField] Text buyText;
+    [SerializeField] Text buyTipsText;
+
+
+
+    protected override void InitComponent()
+    {
+        closeBtn.AddListener(CloseWindow);
+        buyBtn.AddListener(Buy);
+    }
+
+
+
+    protected override void OnPreOpen()
+    {
+        Display();
+    }
+
+
+    void Display()
+    { 
+        var endTime = GoldRushManager.Instance.housekeeperEndTime;
+        if (endTime > 0 && TimeUtility.AllSeconds < endTime)
+        {
+            //缁垂
+            buyTipsText.text = Language.Get("GoldRush45", GoldRushManager.Instance.buyAutoDaysList[0]);
+            RechargeManager.Instance.TryGetOrderInfo(GoldRushManager.Instance.buyAutoCTGIDList[0], out var orderInfo);
+            buyText.text = Language.Get("PayMoneyNum", orderInfo.PayRMBNumOnSale);
+            timeText.text = Language.Get("GoldRush48") + TimeUtility.SecondsToShortDHMS(endTime - TimeUtility.AllSeconds);
+        }
+    }
+
+
+
+    void Buy()
+    {
+        RechargeManager.Instance.CTG(GoldRushManager.Instance.buyAutoCTGIDList[0]);
+    }
+
+}
\ No newline at end of file
diff --git a/Main/System/InternalAffairs/GoldRushAutoBuyWin.cs.meta b/Main/System/InternalAffairs/GoldRushAutoBuyWin.cs.meta
new file mode 100644
index 0000000..94a726d
--- /dev/null
+++ b/Main/System/InternalAffairs/GoldRushAutoBuyWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 33ba65a3f56d8f34b8691205856bd689
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/InternalAffairs/GoldRushAutoCell.cs b/Main/System/InternalAffairs/GoldRushAutoCell.cs
new file mode 100644
index 0000000..ce3d088
--- /dev/null
+++ b/Main/System/InternalAffairs/GoldRushAutoCell.cs
@@ -0,0 +1,112 @@
+锘縰sing System;
+using System.Collections.Generic;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+//鑷姩娣橀噾閫夐」
+public class GoldRushAutoCell : CellView
+{
+    [SerializeField] Toggle autoToggle;
+    [SerializeField] ItemCell itemCell;
+    [SerializeField] Text nameText;
+    [SerializeField] CountControler countControler;
+
+    [SerializeField] Transform lockGo;
+    [SerializeField] Text lockText;
+
+    int arrIndex;
+    int itemLV;
+    public void Display(int _index)
+    {
+        arrIndex = _index;
+        int itemID = GoldRushManager.Instance.autoRefreshItemIDs[arrIndex];
+        itemLV = GoldRushManager.Instance.GetAutoItemLV(arrIndex);
+        bool isOn = itemLV > 0;
+        itemLV = itemLV > 0 ? itemLV : 1;
+        if (IsLock(itemID, out int funcID))
+        {
+            lockGo.SetActive(true);
+            lockText.text = Language.Get("L1038", FuncOpenLVConfig.Get(funcID).Name);
+            countControler.SetActive(false);
+            autoToggle.SetActive(false);
+        }
+        else
+        {
+            lockGo.SetActive(false);
+            countControler.SetActive(true);
+            autoToggle.SetActive(true);
+            autoToggle.onValueChanged.AddListener((value) =>
+            {
+                autoToggle.isOn = value;
+                GoldRushManager.Instance.SetAutoItemLV(arrIndex, value ? itemLV : 0);
+            });
+            autoToggle.isOn = isOn;
+            countControler.Init(ChangeWorkerCount, GoldRushItemConfig.maxLVDic[itemID], itemLV,
+            AddWorker, DecWorker, Language.Get("L1113"));
+        }
+
+        var config = GoldRushItemConfig.GetConfig(itemID, itemLV);
+        if (config == null)
+        {
+            return;
+        }
+        itemCell.Init(new ItemCellModel(itemID, false, config.ItemCount));
+        itemCell.button.AddListener(() =>
+        {
+            ItemTipUtility.Show(itemID);
+        });
+
+        nameText.text = GoldRushManager.Instance.GetCampItemName(config);
+
+
+    }
+
+
+    bool IsLock(int itemID, out int funcID)
+    {
+        funcID = 0;
+        if (GoldRushManager.Instance.itemIDUnLockFuncIDDict.ContainsKey(itemID))
+        {
+            funcID = GoldRushManager.Instance.itemIDUnLockFuncIDDict[itemID];
+            if (!FuncOpen.Instance.IsFuncOpen(funcID))
+            {
+                return true;
+            }
+
+            return false;
+        }
+        return false;
+    }
+
+    void ChangeWorkerCount(int lv)
+    {
+        itemLV = lv;
+        if (!autoToggle.isOn)
+        {
+            return;
+        }
+        if (lv == GoldRushManager.Instance.GetAutoItemLV(arrIndex))
+        {
+            return;
+        }
+        GoldRushManager.Instance.SetAutoItemLV(arrIndex, lv);
+    }
+
+    bool AddWorker(int lv)
+    {
+        return true;
+    }
+
+    bool DecWorker(int count)
+    {
+        if (count <= 1)
+        { 
+            return false;
+        }
+        return true;
+    }
+
+
+}
+
diff --git a/Main/System/InternalAffairs/GoldRushAutoCell.cs.meta b/Main/System/InternalAffairs/GoldRushAutoCell.cs.meta
new file mode 100644
index 0000000..110bb87
--- /dev/null
+++ b/Main/System/InternalAffairs/GoldRushAutoCell.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 3f0259002f47d514696f222259447f74
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/InternalAffairs/GoldRushAutoWin.cs b/Main/System/InternalAffairs/GoldRushAutoWin.cs
new file mode 100644
index 0000000..9aa1f73
--- /dev/null
+++ b/Main/System/InternalAffairs/GoldRushAutoWin.cs
@@ -0,0 +1,166 @@
+using System.Linq;
+using UnityEngine;
+using UnityEngine.UI;
+
+
+/// <summary>
+/// 娣橀噾鑷姩
+/// </summary>
+public class GoldRushAutoWin : UIBase
+{
+    [SerializeField] ScrollerController autoScroller;
+    [SerializeField] Toggle autoRefreshToggle;
+
+    [SerializeField] Button freeBtn;
+    [SerializeField] Transform notFreeGo;
+
+    [SerializeField] Button buyBtn;
+    [SerializeField] Text buyText;
+    [SerializeField] Text buyTipsText;
+    [SerializeField] Button autoBtn;
+    [SerializeField] Text autoText;
+    [SerializeField] Text timeText;
+
+
+
+    protected override void InitComponent()
+    {
+        freeBtn.AddListener(UseFree);
+        buyBtn.AddListener(Buy);
+        autoBtn.AddListener(Auto);
+        autoRefreshToggle.onValueChanged.AddListener((value)=>
+        { 
+            autoRefreshToggle.isOn = value;
+            GoldRushManager.Instance.isAutoRefreshItem = autoRefreshToggle.isOn;
+        });
+    }
+
+
+
+    protected override void OnPreOpen()
+    {
+        GlobalTimeEvent.Instance.secondEvent += OnSecondEvent;
+        GoldRushManager.Instance.OnGoldRushInfoEvent += OnGoldRushInfoEvent;
+        autoScroller.OnRefreshCell += OnRefreshCell;
+        Display();
+    }
+
+    protected override void OnPreClose()
+    {
+        GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent;
+        GoldRushManager.Instance.OnGoldRushInfoEvent -= OnGoldRushInfoEvent;
+        autoScroller.OnRefreshCell -= OnRefreshCell;
+    }
+
+    void Display()
+    {
+        CreateScroller();
+        autoRefreshToggle.isOn = GoldRushManager.Instance.isAutoRefreshItem;
+        DisplayBtns();
+    }
+
+    void CreateScroller()
+    {
+        autoScroller.Refresh();
+        for (int i = 0; i < GoldRushManager.Instance.autoRefreshItemIDs.Length; i++)
+        {
+            autoScroller.AddCell(ScrollerDataType.Header, i);
+
+        }
+        autoScroller.Restart();
+    }
+
+
+    void OnRefreshCell(ScrollerDataType type, CellView cell)
+    {
+        var _cell = cell as GoldRushAutoCell;
+        _cell.Display(cell.index);
+    }
+
+    void DisplayBtns()
+    {
+        var endTime = GoldRushManager.Instance.housekeeperEndTime;
+        if (endTime == 0)
+        {
+            freeBtn.SetActive(true);
+            notFreeGo.SetActive(false);
+        }
+        else if (TimeUtility.AllSeconds >= endTime)
+        {
+            //宸茶繃鏈�
+            freeBtn.SetActive(false);
+            notFreeGo.SetActive(true);
+            //璐拱
+            buyBtn.SetActive(true);
+            buyTipsText.text = Language.Get("GoldRush45", GoldRushManager.Instance.buyAutoDaysList[0]);
+            RechargeManager.Instance.TryGetOrderInfo(GoldRushManager.Instance.buyAutoCTGIDList[0], out var orderInfo);
+            buyText.text = Language.Get("PayMoneyNum", orderInfo.PayRMBNumOnSale);
+            autoBtn.SetActive(false);
+        }
+        else
+        {
+            freeBtn.SetActive(false);
+            notFreeGo.SetActive(true);
+            //缁垂
+            buyBtn.SetActive(true);
+            buyTipsText.text = "";
+            buyText.text = Language.Get("GoldRush27");
+            autoBtn.SetActive(true);
+            autoText.text = Language.Get(GoldRushManager.Instance.isOpenAuto ? "GoldRush46" : "GoldRush28");
+            timeText.text = Language.Get("GoldRush29") + TimeUtility.SecondsToShortDHMS(endTime - TimeUtility.AllSeconds);
+        }
+    }
+
+    void OnSecondEvent()
+    {
+        var endTime = GoldRushManager.Instance.housekeeperEndTime;
+        if (endTime > 0 && TimeUtility.AllSeconds < endTime)
+        {
+            timeText.text = Language.Get("GoldRush29") + TimeUtility.SecondsToShortDHMS(endTime - TimeUtility.AllSeconds);
+        }
+    }
+
+    void UseFree()
+    {
+        if (GoldRushManager.Instance.housekeeperEndTime != 0)
+            return;
+
+        ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"),
+        Language.Get("GoldRush47"), (bool isOK) =>
+            {
+                if (isOK)
+                {
+                    var pack = new CB039_tagCSGoldRushAutoFreeUse();
+                    GameNetSystem.Instance.SendInfo(pack);
+                }
+            });
+    }
+
+    void Buy()
+    {
+        var endTime = GoldRushManager.Instance.housekeeperEndTime;
+        if (endTime > 0 && TimeUtility.AllSeconds < endTime)
+        {
+            //缁垂
+            UIManager.Instance.OpenWindow<GoldRushAutoBuyWin>();
+        }
+        else
+        {
+            //璐拱
+            RechargeManager.Instance.CTG(GoldRushManager.Instance.buyAutoCTGIDList[0]);
+        }
+    }
+
+    void Auto()
+    {
+        GoldRushManager.Instance.isOpenAuto = !GoldRushManager.Instance.isOpenAuto;
+        autoText.text = Language.Get(GoldRushManager.Instance.isOpenAuto ? "GoldRush46" : "GoldRush28");
+        SysNotifyMgr.Instance.ShowTip(GoldRushManager.Instance.isOpenAuto ? "GoldRush11" : "GoldRush12");
+        CloseWindow();
+    }
+
+    void OnGoldRushInfoEvent()
+    { 
+        DisplayBtns();
+    }
+}
\ No newline at end of file
diff --git a/Main/System/InternalAffairs/GoldRushAutoWin.cs.meta b/Main/System/InternalAffairs/GoldRushAutoWin.cs.meta
new file mode 100644
index 0000000..5b65e48
--- /dev/null
+++ b/Main/System/InternalAffairs/GoldRushAutoWin.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: a9a45adebbe8cb548ac2647013890283
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Main/System/InternalAffairs/GoldRushLeader.cs b/Main/System/InternalAffairs/GoldRushLeader.cs
index f2b7f40..396bee5 100644
--- a/Main/System/InternalAffairs/GoldRushLeader.cs
+++ b/Main/System/InternalAffairs/GoldRushLeader.cs
@@ -12,7 +12,7 @@
     [SerializeField] RectTransform leaderGo;
     [SerializeField] UIAlphaTween leaderWord;
     [SerializeField] Text leaderText;
-    public float leaderScale = 0.6f;
+    public float leaderScale = 0.8f;
 
     public Tween leaderSequence;
     private int leaderPosIndex = -1; //鐩戝伐宸茶揪绉诲姩鐐�
diff --git a/Main/System/InternalAffairs/GoldRushManager.cs b/Main/System/InternalAffairs/GoldRushManager.cs
index 5ab2cfe..b2aad68 100644
--- a/Main/System/InternalAffairs/GoldRushManager.cs
+++ b/Main/System/InternalAffairs/GoldRushManager.cs
@@ -2,6 +2,7 @@
 using LitJson;
 
 using System.Collections.Generic;
+using System.Linq;
 
 //娣橀噾鍔熻兘
 public class GoldRushManager : GameSystemManager<GoldRushManager>
@@ -59,6 +60,24 @@
 
     public event Action OnAutoWorkingEvent;
 
+    //鑷姩鍒锋柊鐗╁搧锛屽垽鏂槸ture寮� false鍏筹紝 鍥犻粯璁ゅ紑鍚晠鍊肩浉鍙嶅瓨鍌�0鏄紑锛�1鏄叧
+    public bool isAutoRefreshItem
+    {
+        get
+        {
+            //绗崄涓暟鐢ㄤ簬瀛樺偍鏄惁寮�鍚嚜鍔ㄥ埛鏂帮紝鍏朵粬鏁扮敤浜庡瓨鍌ㄧ墿鍝佺瓑绾�
+            var value = QuickSetting.Instance.GetQuickSettingValue<int>(QuickSettingType.AutoGoldRush, 10);
+            return value == 0;
+        }
+        set
+        {
+            QuickSetting.Instance.SetQuickSetting<int>(QuickSettingType.AutoGoldRush, Convert.ToInt32(!value), 10);
+
+            QuickSetting.Instance.SendPackage();
+        }
+    }
+
+
 
     //閰嶇疆
     public int refreshMoneyType;
@@ -101,8 +120,11 @@
 
     public List<int> buyAutoDaysList = new List<int>();   //璐拱鑷姩绠″澶╂暟
     public List<int> buyAutoCTGIDList = new List<int>();   //璐拱鑷姩绠″CTGID
+    public int[] autoRefreshItemIDs;    //鑷姩鍒锋柊鐗╁搧ID鍒楄〃
+
 
     public PlayerDataType unLockMoneyType; //鍒锋柊鐢�
+
 
     public override void Init()
     {
@@ -149,6 +171,7 @@
             buyAutoCTGIDList.Add(tmpArr2[i][0]);
         }
 
+        autoRefreshItemIDs = JsonMapper.ToObject<int[]>(config.Numerical3);
     }
 
     void OnBeforePlayerDataInitialize()
@@ -163,7 +186,7 @@
         isOpenAuto = false;
     }
 
-    
+
 
     void OnPlayerDataRefresh(PlayerDataType type)
     {
@@ -201,7 +224,7 @@
     {
         campUnlockState = (int)netPack.CampState;
         if (workerUnlockState != netPack.WorkerState)
-        { 
+        {
             workerUnlockState = (int)netPack.WorkerState;
             RefreshUnLockSkinID();
         }
@@ -239,7 +262,7 @@
         foreach (var item in campInfoDict.Values)
         {
             if (item.GoldID != 0 && item.EndTime != 0)
-            { 
+            {
                 cnt++;
             }
         }
@@ -328,7 +351,7 @@
         pack.WorkerCnt = (byte)workerCnt;
         GameNetSystem.Instance.SendInfo(pack);
         if (opType <= 1)
-        { 
+        {
             OnRefreshItemEvent?.Invoke(campID);
         }
     }
@@ -343,7 +366,7 @@
     }
 
     public void SendGoldRushWarehouseAward(int index, int isAll)
-    { 
+    {
         var pack = new CB038_tagCSGoldRushWarehouseAward();
         pack.AwardIndex = (byte)index;
         pack.IsAll = (byte)isAll;
@@ -353,7 +376,7 @@
     public void GetAllAward()
     {
         if (CheckHasFinishGoldRush())
-        { 
+        {
             SendGoldRushWarehouseAward(0, 1);
         }
     }
@@ -377,7 +400,7 @@
 
     //鍙В閿佺殑鐩戝伐
     Redpoint workerRedpoint = new Redpoint(MainRedDot.BlessedLandRedpoint, MainRedDot.BlessedLandRedpoint * 10 + 1);
-    
+
     //鍙鍙栫殑濂栧姳
     Redpoint awardRedpoint = new Redpoint(MainRedDot.BlessedLandRedpoint, MainRedDot.BlessedLandRedpoint * 10 + 2);
     //钀ュ湴瑙i攣绾㈢偣
@@ -471,7 +494,7 @@
     }
 
     //妫�鏌ユ槸鍚︽湁鍙В閿佺殑钀ュ湴
-        bool CheckCanUnLockCamp()
+    bool CheckCanUnLockCamp()
     {
         foreach (var campID in GoldRushCampConfig.GetKeys())
         {
@@ -552,10 +575,41 @@
     //鑷姩娣橀噾 鍏堝~鍏呰惀鍦� 鍐嶅~鍏呭涓洃宸�
 
     void SetAutoWorking(bool _isOpenAuto, bool _isAutoWorking)
-    { 
+    {
         isOpenAuto = _isOpenAuto;
         m_IsAutoWorking = _isAutoWorking;
         OnAutoWorkingEvent?.Invoke();
     }
+
+
+    //鑷姩娣橀噾鐨勭墿鍝侊紝鎸夌墿鍝乮d閰嶇疆绱㈠紩瀛樺偍
+    // 杩斿洖鍊�0浠h〃涓嶅嬀閫夛紝鏁板�间唬琛ㄧ瓑绾э紝鍥犻粯璁ゆ槸0锛屾墍浠ュ瓨鍌ㄤ笂 9浠h〃涓嶅嬀閫夛紝0浠h〃绛夌骇1, 鍚庣画鍔�1
+    public int GetAutoItemLV(int index)
+    {
+        var value = QuickSetting.Instance.GetQuickSettingValue<int>(QuickSettingType.AutoGoldRush, index);
+        if (value == 9)
+        { 
+            return 0;
+        }
+        return value + 1;
+    }
+
+    //璁剧疆鑷姩娣橀噾鐨勭墿鍝侊紝鎸夌墿鍝乮d閰嶇疆绱㈠紩瀛樺偍
+    // 鍙傛暟0浠h〃涓嶅嬀閫夛紝鏁板�间唬琛ㄧ瓑绾э紝鍥犻粯璁ゆ槸0锛屾墍浠ュ瓨鍌ㄤ笂 9浠h〃涓嶅嬀閫夛紝0浠h〃绛夌骇1, 鍚庣画鍔�1
+    public void SetAutoItemLV(int index, int value)
+    {
+        if (value == 0)
+        { 
+            value = 9;
+        }
+        else
+        {
+            value--;
+        }
+        QuickSetting.Instance.SetQuickSetting<int>(QuickSettingType.AutoGoldRush, value, index);
+        QuickSetting.Instance.SendPackage();
+    }
+
+
 }
 
diff --git a/Main/System/Setting/QuickSetting.cs b/Main/System/Setting/QuickSetting.cs
index 99e836e..7fd38c4 100644
--- a/Main/System/Setting/QuickSetting.cs
+++ b/Main/System/Setting/QuickSetting.cs
@@ -17,6 +17,7 @@
         quickSettingDic.Add(QuickSettingType.AutoFight_Speed, new QuickSettingRange(QuickSettingType.AutoFight_Speed, 1, 1));
         quickSettingDic.Add(QuickSettingType.AutoFight_FightPower, new QuickSettingRange(QuickSettingType.AutoFight_FightPower, 2, 1));
         quickSettingDic.Add(QuickSettingType.AutoFight_Open, new QuickSettingRange(QuickSettingType.AutoFight_Open, 3, 1));
+        quickSettingDic.Add(QuickSettingType.AutoGoldRush, new QuickSettingRange(QuickSettingType.AutoGoldRush, 4, 10, 1));  //鑷姩娣橀噾锛�9涓墿鍝佸�硷紝1涓嚜鍔ㄥ埛鏂板紑鍏�
         setting = new string(UCharacter, 100);
         DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerDataInitializeEvent;
         DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk;
@@ -158,6 +159,7 @@
     AutoFight_Speed,    //鍑犲�嶉�熷害
     AutoFight_FightPower,   //鏄惁楂樻垬鍔涘仠姝�
     AutoFight_Open,    //鏄惁寮�鍚嚜鍔ㄦ垬鏂�
+    AutoGoldRush,   //鑷姩娣橀噾
 }
 
 public class QuickSettingRange
@@ -165,7 +167,7 @@
     public QuickSettingType type;
     public int index;
     public int length;
-    public int single;
+    public int single;  //鍏朵腑鐨勫崟涓暱搴︼紝榛樿鍜岄暱搴︿竴鏍�, 鐢ㄤ簬澶氫釜鍊煎悎骞�1涓被鍨嬩腑
 
     public QuickSettingRange(QuickSettingType type, int start, int length, int single = 0)
     {
diff --git a/Main/Utility/TimeUtility.cs b/Main/Utility/TimeUtility.cs
index c172af2..921fbb4 100644
--- a/Main/Utility/TimeUtility.cs
+++ b/Main/Utility/TimeUtility.cs
@@ -344,6 +344,34 @@
         return StringUtility.Contact(hours.ToString("D2"), ":", mins.ToString("D2"), ":", seconds.ToString("D2"));
     }
 
+    //鏋佺畝鏄剧ず
+    // x澶﹛灏忔椂
+    // x灏忔椂x鍒�
+    // x鍒�
+    // x绉�
+    public static string SecondsToShortDHMS(int _seconds)
+    {
+        int days = _seconds / 86400;
+        int hours = _seconds % 86400 / 3600;
+        int mins = _seconds % 3600 / 60;
+        int seconds = _seconds % 60;
+        if (days > 0)
+        {
+            return StringUtility.Contact(days, Language.Get("L1074"), hours, Language.Get("L1072"));
+        }
+        else if (hours > 0)
+        {
+            return StringUtility.Contact(hours, Language.Get("L1072"), mins, Language.Get("L1073"));
+        }
+        else if (mins > 0)
+        { 
+            return StringUtility.Contact(mins, Language.Get("L1073"));
+        }
+        return StringUtility.Contact(seconds, Language.Get("L1075"));
+    }
+
+
+
     //渚嬪瓙
     //澶т簬24灏忔椂鏄剧ず锛歺澶﹛x灏忔椂xx鍒�
     //灏忎簬24灏忔椂鏄剧ず锛歺x:xx:xx

--
Gitblit v1.8.0