| | |
| | | scene = new Scene (); |
| | | } |
| | | |
| | | if (string.IsNullOrEmpty (scene.Sid)) { |
| | | scene.Sid = HDLLinkUtlis.NewSceneSid (); |
| | | } |
| | | |
| | | #region Load |
| | | Dialog dialog = new Dialog (); |
| | | |
| | |
| | | |
| | | //增加或者修改场景 |
| | | btnSave.MouseUpEventHandler += (sender, e) => { |
| | | string newScenFilePath = "GlobalScene_" + sceneTextBox.Text.Trim ()+"_"+DateTime.Now.Ticks; |
| | | string newScenFilePath = "GlobalScene_" + sceneTextBox.Text.Trim (); |
| | | |
| | | if (string.IsNullOrEmpty (sceneTextBox.Text.Trim ())) { |
| | | new Alert ("", Language.StringByID (R.MyInternationalizationString.PleaseEnterSceneName), Language.StringByID (R.MyInternationalizationString.Close)).Show (); |
| | |
| | | } |
| | | } |
| | | // 更新修改后的数据 |
| | | IO.FileUtils.WriteFileByBytes (newScenFilePath, CommonPage.MyEncodingUTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (scene))); |
| | | scene.Save (newScenFilePath);//2021-02-24 |
| | | //IO.FileUtils.WriteFileByBytes (newScenFilePath, CommonPage.MyEncodingUTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (scene))); |
| | | IO.FileUtils.WriteFileByBytes (Scene.GlobalSceneFilePath, CommonPage.MyEncodingUTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (sceneFileList))); |
| | | if (action != null) { |
| | | action (newScenFilePath); |
| | |
| | | |
| | | //增加或者修改场景 |
| | | btnSave.MouseUpEventHandler += (sender, e) => { |
| | | string newScenFilePath = "RoomScene_" + room.Name + "_" + sceneTextBox.Text.Trim () + "_" + DateTime.Now.Ticks; |
| | | string newScenFilePath = "RoomScene_" + room.Name + "_" + sceneTextBox.Text.Trim (); |
| | | |
| | | if (string.IsNullOrEmpty (sceneTextBox.Text.Trim ())) { |
| | | new Alert ("", Language.StringByID (R.MyInternationalizationString.PleaseEnterSceneName), Language.StringByID (R.MyInternationalizationString.Close)).Show (); |
| | |
| | | } |
| | | } |
| | | // 更新修改后的数据 |
| | | IO.FileUtils.WriteFileByBytes (newScenFilePath, CommonPage.MyEncodingUTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (scene))); |
| | | scene.Save (newScenFilePath);//2021-02-24 |
| | | |
| | | //IO.FileUtils.WriteFileByBytes (newScenFilePath, CommonPage.MyEncodingUTF8.GetBytes (Newtonsoft.Json.JsonConvert.SerializeObject (scene))); |
| | | room.Save (roomFilePath); |
| | | |
| | | Room.UpdateMemorry (roomFilePath); |