|
@@ -47,7 +47,7 @@ namespace CM3D2.MultipleMaids.Plugin
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- GUIStyle style = GUI.skin.box;
|
|
|
+ GUIStyle style = new GUIStyle(GUI.skin.box);
|
|
|
style.fontSize = GetPix(11);
|
|
|
style.alignment = TextAnchor.UpperRight;
|
|
|
|
|
@@ -69,6 +69,12 @@ namespace CM3D2.MultipleMaids.Plugin
|
|
|
|
|
|
rectWin.x = Screen.width - rectWin.width;
|
|
|
rectWin.y = GetPix(65);
|
|
|
+
|
|
|
+ saveManagerRect.width = Screen.width * 0.9f;
|
|
|
+ saveManagerRect.height = Screen.height * 0.75f;
|
|
|
+
|
|
|
+ saveManagerRect.x = (float)(Screen.width * 0.5f - saveManagerRect.width * 0.5f);
|
|
|
+ saveManagerRect.y = (float)(Screen.height * 0.5f - saveManagerRect.height * 0.5f);
|
|
|
}
|
|
|
|
|
|
if (bGuiMessage)
|
|
@@ -121,6 +127,11 @@ namespace CM3D2.MultipleMaids.Plugin
|
|
|
else if (sceneFlg)
|
|
|
{
|
|
|
rectWin = GUI.Window(129, rectWin, SaveSceneWindow, "", style);
|
|
|
+
|
|
|
+ saveManagerRect = GUI.Window(131, saveManagerRect, SaveManagerWindow, "", style);
|
|
|
+
|
|
|
+ if (!saveManagerInitialize) InitializeSaveManager();
|
|
|
+
|
|
|
Rect rect = default;
|
|
|
dispNo = 0;
|
|
|
for (int index = 0; index < 10; ++index)
|
|
@@ -294,10 +305,10 @@ namespace CM3D2.MultipleMaids.Plugin
|
|
|
|
|
|
private void SaveSceneWindow(int winID)
|
|
|
{
|
|
|
- GUIStyle style1 = "label";
|
|
|
+ GUIStyle style1 = new GUIStyle("label");
|
|
|
style1.fontSize = GetPix(12);
|
|
|
style1.alignment = TextAnchor.UpperLeft;
|
|
|
- GUIStyle style2 = "button";
|
|
|
+ GUIStyle style2 = new GUIStyle("button");
|
|
|
style2.fontSize = GetPix(12);
|
|
|
style2.alignment = TextAnchor.MiddleCenter;
|
|
|
GUI.Label(new Rect(GetPix(50), GetPix(6), GetPix(100), GetPix(25)),
|
|
@@ -435,48 +446,8 @@ namespace CM3D2.MultipleMaids.Plugin
|
|
|
{
|
|
|
saveScene = page * 10 + index + 1;
|
|
|
saveScene2 = saveScene;
|
|
|
- GameMain.Instance.SoundMgr.PlaySe("se002.ogg", false);
|
|
|
- isScreen2 = true;
|
|
|
- if (!isMessage)
|
|
|
- {
|
|
|
- ui_cam_hide_list_.Clear();
|
|
|
- foreach (UICamera uiCamera in NGUITools.FindActive<UICamera>())
|
|
|
- {
|
|
|
- if (uiCamera.GetComponent<Camera>().enabled)
|
|
|
- {
|
|
|
- uiCamera.GetComponent<Camera>().enabled = false;
|
|
|
- ui_cam_hide_list_.Add(uiCamera);
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- editUI = GameObject.Find("/UI Root/Camera");
|
|
|
- if (editUI != null)
|
|
|
- {
|
|
|
- editUI.SetActive(false);
|
|
|
- }
|
|
|
-
|
|
|
- if (GameMain.Instance.CMSystem.ViewFps)
|
|
|
- {
|
|
|
- UTY.GetChildObject(GameMain.Instance.gameObject, "SystemUI Root/FpsCounter", false).SetActive(false);
|
|
|
- }
|
|
|
-
|
|
|
- GameObject childObject1 = UTY.GetChildObject(GameMain.Instance.gameObject, "SystemUI Root/SystemDialog", false);
|
|
|
- GameObject childObject2 = UTY.GetChildObject(GameMain.Instance.gameObject, "SystemUI Root/SystemShortcut", false);
|
|
|
- childObject1.SetActive(false);
|
|
|
- childObject2.SetActive(false);
|
|
|
- }
|
|
|
|
|
|
- isGui = bGui;
|
|
|
- bGui = false;
|
|
|
- try
|
|
|
- {
|
|
|
- thum_byte_to_base64_ = string.Empty;
|
|
|
- thum_file_path_ = Path.Combine(Path.GetTempPath(), "cm3d2_" + Guid.NewGuid().ToString() + ".png");
|
|
|
- GameMain.Instance.MainCamera.ScreenShot(thum_file_path_, 1, true);
|
|
|
- }
|
|
|
- catch { }
|
|
|
+ TakeScreenshot();
|
|
|
}
|
|
|
|
|
|
GUI.Label(new Rect(GetPix(25),
|
|
@@ -9173,5 +9144,262 @@ namespace CM3D2.MultipleMaids.Plugin
|
|
|
}
|
|
|
GUI.DragWindow();
|
|
|
}
|
|
|
+
|
|
|
+ private void SaveManagerWindow(int winID)
|
|
|
+ {
|
|
|
+ GUIStyle labelStyle = new GUIStyle("label");
|
|
|
+ labelStyle.fontSize = GetPix(12);
|
|
|
+ labelStyle.alignment = TextAnchor.MiddleCenter;
|
|
|
+ GUIStyle newSaveStyle = new GUIStyle("button");
|
|
|
+ newSaveStyle.fontSize = GetPix(50);
|
|
|
+ newSaveStyle.alignment = TextAnchor.MiddleCenter;
|
|
|
+ GUIStyle saveImageStyle = new GUIStyle("box");
|
|
|
+ saveImageStyle.fontSize = GetPix(12);
|
|
|
+ saveImageStyle.alignment = TextAnchor.MiddleCenter;
|
|
|
+ saveImageStyle.padding = new RectOffset(0, 0, 0, 0);
|
|
|
+ GUIStyle saveControlStyle = new GUIStyle("button");
|
|
|
+ saveControlStyle.fontSize = GetPix(18);
|
|
|
+
|
|
|
+ // Window variables
|
|
|
+ float windowPadding = GetPix(10);
|
|
|
+ float windowPaddingY = GetPix(20);
|
|
|
+
|
|
|
+ if (GUI.Button(new Rect(
|
|
|
+ windowPadding,
|
|
|
+ windowPadding,
|
|
|
+ GetPix(25),
|
|
|
+ GetPix(25)
|
|
|
+ ), "X", saveControlStyle))
|
|
|
+ {
|
|
|
+ faceFlg = false;
|
|
|
+ poseFlg = false;
|
|
|
+ sceneFlg = false;
|
|
|
+ kankyoFlg = true;
|
|
|
+ kankyo2Flg = false;
|
|
|
+ bGui = true;
|
|
|
+ copyIndex = 0;
|
|
|
+ }
|
|
|
+
|
|
|
+ if (GUI.Button(new Rect(
|
|
|
+ windowPaddingY + GetPix(25),
|
|
|
+ windowPadding,
|
|
|
+ GetPix(85),
|
|
|
+ GetPix(25)
|
|
|
+ ), "Refresh", saveControlStyle))
|
|
|
+ {
|
|
|
+ InitializeSaveList();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (createSaveFlag || loadSaveFlag)
|
|
|
+ {
|
|
|
+ GUI.enabled = false;
|
|
|
+ }
|
|
|
+
|
|
|
+ #region SAVE_GRID
|
|
|
+
|
|
|
+ float saveGridX = windowPadding + Mathf.Max(480, GetPix(480)) + windowPadding;
|
|
|
+ float saveGridY = windowPaddingY;
|
|
|
+ float saveGridWidth = saveManagerRect.width - saveGridX - windowPadding;
|
|
|
+ float saveGridHeight = saveManagerRect.height - windowPaddingY;
|
|
|
+
|
|
|
+ int numImages = saveScenes.Count;
|
|
|
+
|
|
|
+ float scale = 0.5f;
|
|
|
+ float imageWidth = Mathf.Min(480f * scale, GetPix(480) * scale);
|
|
|
+ float imageHeight = Mathf.Min(270f * scale, GetPix(270) * scale);
|
|
|
+ float imagePadding = GetPix(12);
|
|
|
+
|
|
|
+ int maxColumns = Mathf.Max(1, (int)(saveGridWidth / (imageWidth + imagePadding)));
|
|
|
+ float imageGridWidth = maxColumns * (imageWidth + imagePadding);
|
|
|
+
|
|
|
+ float imageGridX = saveGridX + (saveGridWidth / 2f - imageGridWidth / 2f) + windowPadding;
|
|
|
+
|
|
|
+ float imageGridOffset = (saveGridWidth - imageGridWidth) / 2f;
|
|
|
+
|
|
|
+ Rect saveGridScrollRect = new Rect(
|
|
|
+ saveGridX + windowPadding
|
|
|
+ , saveGridY
|
|
|
+ , saveGridWidth - windowPadding
|
|
|
+ , saveGridHeight - windowPadding
|
|
|
+ );
|
|
|
+
|
|
|
+ Rect saveGridScrollView = new Rect(0, 0
|
|
|
+ , saveGridWidth - 30
|
|
|
+ , (numImages / maxColumns + 1) * (imageHeight + imagePadding) + imagePadding
|
|
|
+ );
|
|
|
+
|
|
|
+ GUI.Box(new Rect(
|
|
|
+ saveGridX
|
|
|
+ , saveGridY
|
|
|
+ , saveGridWidth
|
|
|
+ , saveGridHeight - windowPadding
|
|
|
+ ), "");
|
|
|
+
|
|
|
+ saveManagerScrollPos = GUI.BeginScrollView(saveGridScrollRect, saveManagerScrollPos, saveGridScrollView);
|
|
|
+ if (GUI.Button(new Rect(
|
|
|
+ imageGridOffset
|
|
|
+ , imagePadding
|
|
|
+ , imageWidth
|
|
|
+ , imageHeight)
|
|
|
+ , "+", newSaveStyle))
|
|
|
+ {
|
|
|
+ createSaveFlag = true;
|
|
|
+ TakeScreenshot();
|
|
|
+ }
|
|
|
+
|
|
|
+ int j = 1;
|
|
|
+ int i = numImages - 1;
|
|
|
+
|
|
|
+ while (i >= 0 && j <= numImages)
|
|
|
+ {
|
|
|
+ Texture2D saveImage = saveScenes[i]?.Item2 ?? null;
|
|
|
+ if (saveImage != null)
|
|
|
+ {
|
|
|
+
|
|
|
+ if (GUI.Button(new Rect(
|
|
|
+ (j % maxColumns) * imageWidth + (j % maxColumns) * imagePadding + imageGridOffset
|
|
|
+ , (j / maxColumns) * imageHeight + (j / maxColumns + 1) * imagePadding
|
|
|
+ , imageWidth
|
|
|
+ , imageHeight)
|
|
|
+ , saveImage, saveImageStyle))
|
|
|
+ {
|
|
|
+ selectedSave = i;
|
|
|
+ }
|
|
|
+ i--;
|
|
|
+ j++;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ GUI.EndScrollView();
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ #region SAVE_CONTROLS
|
|
|
+ if (numImages > 0)
|
|
|
+ {
|
|
|
+ Texture2D previewImage = saveScenes[selectedSave]?.Item2 ?? null;
|
|
|
+ if (previewImage != null)
|
|
|
+ {
|
|
|
+
|
|
|
+ float saveManagerX = windowPadding;
|
|
|
+ float saveManagerY = windowPaddingY + GetPix(80);
|
|
|
+
|
|
|
+ int previewWidth = Mathf.Min(previewImage.width, GetPix(previewImage.width));
|
|
|
+ int previewHeight = Mathf.Min(previewImage.height, GetPix(previewImage.height));
|
|
|
+
|
|
|
+ float previewX = saveManagerX + (saveGridX / 2 - previewWidth / 2);
|
|
|
+ float previewY = saveManagerY;
|
|
|
+
|
|
|
+ GUI.DrawTexture(new Rect(
|
|
|
+ previewX - GetPix(10)
|
|
|
+ , previewY - GetPix(10)
|
|
|
+ , previewWidth + GetPix(20)
|
|
|
+ , previewHeight + GetPix(20))
|
|
|
+ , frame
|
|
|
+ );
|
|
|
+ GUI.DrawTexture(new Rect(
|
|
|
+ previewX,
|
|
|
+ previewY,
|
|
|
+ previewWidth,
|
|
|
+ previewHeight
|
|
|
+ ), previewImage);
|
|
|
+
|
|
|
+ float saveControlX = previewX + GetPix(20);
|
|
|
+ float saveControlY = saveManagerY + previewHeight + windowPaddingY;
|
|
|
+
|
|
|
+ int saveControlWidth = GetPix(110);
|
|
|
+ int saveControlHeight = GetPix(40);
|
|
|
+
|
|
|
+ if (GUI.Button(new Rect(
|
|
|
+ saveControlX
|
|
|
+ , saveControlY
|
|
|
+ , saveControlWidth
|
|
|
+ , saveControlHeight)
|
|
|
+ , "Overwrite", saveControlStyle))
|
|
|
+ {
|
|
|
+ createSaveFlag = true;
|
|
|
+ overwriteFlag = true;
|
|
|
+
|
|
|
+ TakeScreenshot();
|
|
|
+ }
|
|
|
+
|
|
|
+ if (GUI.Button(new Rect(
|
|
|
+ previewX + previewWidth - saveControlWidth - GetPix(20)
|
|
|
+ , saveControlY
|
|
|
+ , saveControlWidth
|
|
|
+ , saveControlHeight)
|
|
|
+ , "Load", saveControlStyle))
|
|
|
+ {
|
|
|
+ // string sceneData = LoadSave(saveScenes[selectedSave].Item1.FullName);
|
|
|
+ // Debug.Log(sceneData);
|
|
|
+ loadSaveFlag = true;
|
|
|
+ loadScene = 1;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ #endregion
|
|
|
+
|
|
|
+ GUI.enabled = true;
|
|
|
+
|
|
|
+ if (createSaveFlag)
|
|
|
+ {
|
|
|
+ if (File.Exists(thum_file_path_))
|
|
|
+ {
|
|
|
+ if (overwriteFlag)
|
|
|
+ OverWrite();
|
|
|
+ SaveScene();
|
|
|
+ createSaveFlag = false;
|
|
|
+ overwriteFlag = false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ GUI.DragWindow();
|
|
|
+ }
|
|
|
+
|
|
|
+ public void TakeScreenshot()
|
|
|
+ {
|
|
|
+ GameMain.Instance.SoundMgr.PlaySe("se002.ogg", false);
|
|
|
+ isScreen2 = true;
|
|
|
+ if (!isMessage)
|
|
|
+ {
|
|
|
+ ui_cam_hide_list_.Clear();
|
|
|
+ foreach (UICamera uiCamera in NGUITools.FindActive<UICamera>())
|
|
|
+ {
|
|
|
+ if (uiCamera.GetComponent<Camera>().enabled)
|
|
|
+ {
|
|
|
+ uiCamera.GetComponent<Camera>().enabled = false;
|
|
|
+ ui_cam_hide_list_.Add(uiCamera);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ else
|
|
|
+ {
|
|
|
+ editUI = GameObject.Find("/UI Root/Camera");
|
|
|
+ if (editUI != null)
|
|
|
+ {
|
|
|
+ editUI.SetActive(false);
|
|
|
+ }
|
|
|
+
|
|
|
+ if (GameMain.Instance.CMSystem.ViewFps)
|
|
|
+ {
|
|
|
+ UTY.GetChildObject(GameMain.Instance.gameObject, "SystemUI Root/FpsCounter", false).SetActive(false);
|
|
|
+ }
|
|
|
+
|
|
|
+ GameObject childObject1 = UTY.GetChildObject(GameMain.Instance.gameObject, "SystemUI Root/SystemDialog", false);
|
|
|
+ GameObject childObject2 = UTY.GetChildObject(GameMain.Instance.gameObject, "SystemUI Root/SystemShortcut", false);
|
|
|
+ childObject1.SetActive(false);
|
|
|
+ childObject2.SetActive(false);
|
|
|
+ }
|
|
|
+
|
|
|
+ isGui = bGui;
|
|
|
+ bGui = false;
|
|
|
+ try
|
|
|
+ {
|
|
|
+ thum_byte_to_base64_ = string.Empty;
|
|
|
+ thum_file_path_ = Path.Combine(Path.GetTempPath(), "cm3d2_" + Guid.NewGuid().ToString() + ".png");
|
|
|
+ GameMain.Instance.MainCamera.ScreenShot(thum_file_path_, 1, true);
|
|
|
+ }
|
|
|
+ catch { }
|
|
|
+ }
|
|
|
}
|
|
|
}
|