From b847c06d8617efb2cbbad6f11b0344b779138e92 Mon Sep 17 00:00:00 2001
From: wxr <wxr@hdlchina.com.cn>
Date: 星期一, 14 十月 2024 18:03:45 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/wjc' into feature/v2.7_迭代

---
 HDL_ON/Entity/Function/Scene.cs |   45 ++++++++++++++++++++++++++++++++-------------
 1 files changed, 32 insertions(+), 13 deletions(-)

diff --git a/HDL_ON/Entity/Function/Scene.cs b/HDL_ON/Entity/Function/Scene.cs
index 9065ef5..51e984f 100644
--- a/HDL_ON/Entity/Function/Scene.cs
+++ b/HDL_ON/Entity/Function/Scene.cs
@@ -87,6 +87,14 @@
         /// 鏄惁鍏佽鍒犻櫎
         /// </summary>
         public bool can_delete = true;
+        /// <summary>
+        /// 鏄惁鍏佽缂栬緫
+        /// </summary>
+        public bool can_edit = true;
+        /// <summary>
+        /// 鏄惁鏄綉鍏虫湰鍦板満鏅�
+        /// </summary>
+        public bool local = false;
 
         /// <summary>
         /// 鍒涘缓璇ュ満鏅殑鐢ㄦ埛ID
@@ -404,14 +412,24 @@
                 {
                     result = ApiUtlis.Ins.HttpRequest.CancelCollectScene(userSceneId);
                 }
-                //鎻愮ず閿欒
                 if (result != StateCode.SUCCESS)
                 {
-                    Application.RunOnMainThread(() =>
+                    if (!Common.ApiUtlis.Ins.hadInternet)
                     {
-                        collect = !collect;
-                        IMessageCommon.Current.ShowErrorInfoAlter(result);
-                    });
+                        this.SaveSceneFile();
+                    }
+                    else
+                    {
+                        Application.RunOnMainThread(() =>
+                        {
+                            collect = !collect;
+                            IMessageCommon.Current.ShowErrorInfoAlter(result);
+                        });
+                    }
+                }
+                else
+                {
+                    this.SaveSceneFile();
                 }
             })
             { IsBackground = true }.Start();
@@ -562,25 +580,24 @@
         /// <returns></returns>
         private Function ConvertFunctionObject()
         {
+            Function temp = null;
             if (type == "7")
             {
                 var logic = Logic.LogicList.Find((obj) => obj.sid == sid);
                 if (logic != null) {
-                    _localFunction = new Function()
-                    {
-                        name = logic.name
-                    };
+                    temp = new Function();
+                    temp.name = logic.name;
                 }
             }
             else
             {
-                var localFunction = FunctionList.List.GetDeviceFunctionList().Find((obj) => obj.sid == sid);
-                if (localFunction == null)
+                temp = FunctionList.List.GetDeviceFunctionList().Find((obj) => obj.sid == sid);
+                if (temp == null)
                 {
-                    localFunction = FunctionList.List.groupControls.Find((obj) => obj.sid == sid);
+                    temp = FunctionList.List.groupControls.Find((obj) => obj.sid == sid);
                 }
             }
-            return localFunction;
+            return temp;
         }
 
 
@@ -722,6 +739,7 @@
         /// <summary>
         /// 灞炴�х殑鍊煎垪琛�
         /// </summary>
+        [Newtonsoft.Json.JsonIgnore]
         public List<string> valueList = new List<string>();
         /// <summary>
         /// 灞炴�у悕绉版樉绀烘枃鏈�
@@ -787,6 +805,7 @@
             return text;
         }
 
+        [Newtonsoft.Json.JsonIgnore]
         public string UintString = "";
 
         /// <summary>

--
Gitblit v1.8.0