Exemplo n.º 1
0
 public static void DrawEditButtons()
 {
     GUILayout.BeginVertical();
     GUILayout.BeginHorizontal();
     if (GUILayout.Button("Add scene", GUILayout.Height(55), GUILayout.Width(ColumnWidth / 2)))
     {
         Instance.addAuto();
     }
     if (GUILayout.Button("Update scene", GUILayout.Height(55), GUILayout.Width(ColumnWidth / 2)))
     {
         Instance.UpdateScene();
     }
     GUILayout.EndHorizontal();
     GUILayout.BeginHorizontal();
     if (GUILayout.Button("Insert scene", GUILayout.Height(25), GUILayout.Width(ColumnWidth / 2)))
     {
         Instance.addAuto(insert: true);
     }
     if (GUILayout.Button("Dup scene", GUILayout.Height(25), GUILayout.Width(ColumnWidth / 2)))
     {
         Instance.dupScene();
     }
     GUILayout.EndHorizontal();
     GUILayout.BeginHorizontal();
     if (GUILayout.Button("Delete scene"))
     {
         if (Instance.promptOnDelete.Value)
         {
             warning_action = Instance.removeScene;
             warning_param  = new WarningParam_s("Delete selected scene?", false);
         }
         else
         {
             Instance.removeScene();
         }
     }
     GUILayout.EndHorizontal();
     GUILayout.EndVertical();
 }
Exemplo n.º 2
0
        public static void sceneConsoleTrackable()
        {
            GUILayout.BeginHorizontal();
            GUILayout.BeginVertical(GUILayout.Width(ColumnWidth));
            GUILayout.Label("Actors:");
            tracking_actors_scroll = GUILayout.BeginScrollView(tracking_actors_scroll);
            var actors = Instance.game.AllActors;

            foreach (var actorid in actors.Keys)
            {
                VNActor.Actor actor = actors[actorid];
                render_ui_for_tracking(actorid, actor);
            }
            GUILayout.EndScrollView();
            GUILayout.EndVertical();

            GUILayout.BeginVertical(GUILayout.Width(ColumnWidth));
            GUILayout.Label("Props:");
            tracking_props_scroll = GUILayout.BeginScrollView(tracking_props_scroll);
            var props = Instance.game.AllProps;

            foreach (var propid in props.Keys)
            {
                render_ui_for_tracking(propid, props[propid]);
            }
            GUILayout.EndScrollView();

            GUILayout.EndVertical();
            GUILayout.BeginVertical(GUILayout.Width(ColumnWidth));
            if (GUILayout.Button("Track selected", GUILayout.Height(50), GUILayout.Width(ColumnWidth)))
            {
                Instance.addSelectedToTrack();
            }
            if (GUILayout.Button("Untrack selected", GUILayout.Height(25), GUILayout.Width(ColumnWidth)))
            {
                if (Instance.promptOnDelete.Value)
                {
                    warning_action = Instance.delSelectedFromTrack;
                    warning_param  = new WarningParam_s("Untrack and delete selected from scenes?", false);
                }
                else
                {
                    Instance.delSelectedFromTrack();
                }
            }
            if (GUILayout.Button("Refresh", GUILayout.Height(25), GUILayout.Width(ColumnWidth)))
            {
                SceneFolders.LoadTrackedActorsAndProps();
            }
            if (!Instance.isSysTracking)
            {
                if (GUILayout.Button("Track scene settings", GUILayout.Height(25), GUILayout.Width(ColumnWidth)))
                {
                    Instance.addSysTracking();
                }
            }
            else
            {
                if (GUILayout.Button("Untrack scene settings", GUILayout.Height(25), GUILayout.Width(ColumnWidth)))
                {
                    Instance.delSysTracking();
                }
            }
            if (Instance.track_map)
            {
                if (GUILayout.Button("Stop tracking map selection", GUILayout.Height(25), GUILayout.Width(ColumnWidth)))
                {
                    Instance.track_map = false;
                }
            }
            else
            {
                if (GUILayout.Button("Track map selection", GUILayout.Height(25), GUILayout.Width(ColumnWidth)))
                {
                    Instance.track_map = true;
                }
            }
            GUILayout.EndVertical();
            GUILayout.EndHorizontal();
            GUILayout.FlexibleSpace();
            GUILayout.BeginHorizontal();
            GUILayout.Label("Pro: Change selected char ID to ");
            //GUILayout.Label("  Who say:", GUILayout.Width(80))
            Instance.newid = GUILayout.TextField(Instance.newid);
            if (GUILayout.Button("Change", GUILayout.Width(60)))
            {
                //sc.cam_whosay = sc.get_next_speaker(sc.cam_whosay, False)
                Instance.changeSelTrackID(Instance.newid);
            }
            GUILayout.EndHorizontal();
        }
Exemplo n.º 3
0
        public static void sceneConsoleLdSvUI()
        {
            object fld;
            // sc.svname = GUILayout.TextField(sc.svname)
            // GUILayout.Space(35)
            var btnBigHeight   = 60;
            var btnSmallHeight = 50;

            saveload_scroll = GUILayout.BeginScrollView(saveload_scroll);
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            GUILayout.Label(" ------------------------------------------    Data in card   ------------------------------------------");
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            GUILayout.Space(5);
            GUILayout.BeginHorizontal();
            GUILayout.Label($"Storing <b>{Instance.saveDataSize:N} Kb</b> of saved scene data.");
            GUILayout.EndHorizontal();
            GUILayout.Space(5);

            /*
             * GUILayout.BeginHorizontal();
             * GUILayout.FlexibleSpace();
             * if (GUILayout.Button("Reload Scene Data.", GUILayout.Height(btnBigHeight), GUILayout.Width(210)))
             * {
             *  if (Instance.block.Count > 0)
             *  {
             *      //warning_action = SaveLoadController.LoadPluginData;
             *      //warning_param = new WarningParam_s("Reload scene data from card? This will overwrite current scenes.", false);
             *  }
             *  else
             *  {
             *      //SaveLoadController.LoadPluginData();
             *  }
             * }
             * GUILayout.FlexibleSpace();
             * if (GUILayout.Button("Delete Saved \n Scene Data.", GUILayout.Height(btnBigHeight), GUILayout.Width(210)))
             * {
             *  var msg = "";
             *  if (Instance.block.Count > 0)
             *  {
             *      msg = "Delete saved scene data and reset current scenes?";
             *  }
             *  else
             *  {
             *      msg = "Delete saved scene data?";
             *  }
             *  //warning_action = SaveLoadController.deleteSaveData;
             *  //warning_param = new WarningParam_s(msg, false);
             * }
             * GUILayout.FlexibleSpace();
             * GUILayout.EndHorizontal();
             */
            GUILayout.Space(20);
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            GUILayout.Label(" ----------------------------------------    Data on external file    ----------------------------------------");
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            GUILayout.Space(15);
            GUILayout.BeginHorizontal();
            GUILayout.Space(40);
            GUILayout.Label("File name:");
            GUILayout.Space(20);
            Instance.svname = GUILayout.TextField(Instance.svname, GUILayout.Width(300));
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            GUILayout.Space(20);
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("<color=#00ff00>Load</color> from file", GUILayout.Height(btnBigHeight), GUILayout.Width(210)))
            {
                if (Instance.block.Count > 0)
                {
                    warning_action = Instance.loadSceneData;
                    warning_param  = new WarningParam_s("Do you wish to load scenedata from file? (Will overwrite console data)", false);
                }
                else
                {
                    Instance.loadSceneData(backup: false);
                }
            }
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("<color=#ff0000>Save</color> to file", GUILayout.Height(btnBigHeight), GUILayout.Width(210)))
            {
                // delete existing scenedata fld
                var fld_str = "-scfile:" + Instance.svname;
                fld = Utils.getFolder(Instance.game, Instance.svname, true);
                if (!(fld == null))
                {
                    warning_action = Instance.SaveToFile;
                    warning_param  = new WarningParam_s("Scenedata exists. Overwrite?", false);
                }
                else
                {
                    Instance.SaveToFile("SSS.dat");
                }
            }
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            GUILayout.Space(30);
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            GUILayout.Label(" ----------------------------    Load from backup (scene/external file)   ---------------------------");
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            GUILayout.Space(15);
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Load backup scene data\n(scene/external file)", GUILayout.Height(btnSmallHeight), GUILayout.Width(210)))
            {
                fld = Utils.getFolder(Instance.game, "-scfile:", false);
                if (Instance.block.Count > 0)
                {
                    if (fld == null)
                    {
                        warning_action = Instance.loadSceneData;
                        warning_param  = new WarningParam_s("Do you wish to load backup scenedata from scene? (Will overwrite console data)", false);
                    }
                    else
                    {
                        warning_action = Instance.loadSceneData;
                        warning_param  = new WarningParam_s("Do you wish to load backup scenedata from file? (Will overwrite console data)", false);
                    }
                }
                else if (fld == null)
                {
                    Instance.loadSceneData(backup: true);
                }
                else
                {
                    Instance.loadSceneData(backup: true);
                }
            }
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Load auto-timer backup file", GUILayout.Height(btnSmallHeight), GUILayout.Width(210)))
            {
                //sc.exportToVNSS()
                if (Instance.block.Count > 0)
                {
                    warning_action = Instance.loadSceneDataBackupTimer;
                    warning_param  = new WarningParam_s("Do you wish to load backup scenedata from file auto-saved by timer? (Will overwrite console data)", false);
                }
                else
                {
                    Instance.loadSceneDataBackupTimer();
                }
            }
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            GUILayout.FlexibleSpace();
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            // GUILayout.Label(
            //     " ----------------------------    Load from backup (scene/external file)   ---------------------------")
            GUILayout.Label(" -------------------------------    VN Export   ------------------------------");
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            GUILayout.Space(15);
            GUILayout.BeginHorizontal();

            /*
             * GUILayout.FlexibleSpace();
             * if (GUILayout.Button("<color=#00ff00>Export</color> scenes and cams\nto VNSceneScript", GUILayout.Height(btnSmallHeight), GUILayout.Width(210)))
             * {
             *  Instance.exportToVNSS();
             * }
             */
            //GUILayout.Space(210)
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("<color=#00ff00>Run</color> VN \nfrom beginning", GUILayout.Height(btnSmallHeight), GUILayout.Width(210)))
            {
                Instance.runVNSS();
            }

            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            //GUILayout.Space(210)

            /*
             * Instance.vnFastIsRunImmediately = GUILayout.Toggle(Instance.vnFastIsRunImmediately, "And run from cur scene", GUILayout.Height(20), GUILayout.Width(210));
             * GUILayout.FlexibleSpace();
             */
            if (GUILayout.Button("from scene", GUILayout.Height(20), GUILayout.Width(105)))
            {
                Instance.runVNSS("scene");
            }
            if (GUILayout.Button("from cam", GUILayout.Height(20), GUILayout.Width(105)))
            {
                Instance.runVNSS("cam");
            }
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            GUILayout.FlexibleSpace();
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            // GUILayout.Label(
            //     " ----------------------------    Load from backup (scene/external file)   ---------------------------")
            GUILayout.Label(" -------------------------------    Cam VN texts export/import   ------------------------------");
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            GUILayout.FlexibleSpace();
            GUILayout.Space(5);
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Export cam texts\nto sss_camtexts.xml", GUILayout.Height(btnSmallHeight), GUILayout.Width(210)))
            {
                Instance.block.exportCamTexts();
            }
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Import cam texts\nfrom sss_camtexts.xml", GUILayout.Height(btnSmallHeight), GUILayout.Width(210)))
            {
                Instance.block.importCamTexts();
            }
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            GUILayout.FlexibleSpace();
            if (GUILayout.Button("Import cam texts\nfrom sss_camtexts.txt (Python)", GUILayout.Height(btnSmallHeight), GUILayout.Width(210)))
            {
                Instance.block.ImportCamTextsCustom();
            }
            GUILayout.FlexibleSpace();
            GUILayout.EndHorizontal();
            GUILayout.EndScrollView();
        }
Exemplo n.º 4
0
 public static void sceneConsoleWindowFunc(int id)
 {
     ColumnWidth = WindowWidth / 3;
     GUI.DragWindow(new Rect(0, 0, 10000, 20));
     try
     {
         if (!(warning_param is null))
         {
             WarningParam_s warning_params = (WarningParam_s)warning_param;
             warningUI(warning_action, msg: warning_params.msg, single_op: warning_params.single_op);
         }
         else if (Instance.isFuncLocked == true)
         {
             GUILayout.BeginVertical();
             GUILayout.Space(10);
             GUILayout.BeginHorizontal();
             GUILayout.Space(10);
             GUILayout.Label("<size=20>" + Instance.funcLockedText + "</size>");
             // GUILayout.Label(sc.funcLockedText)
             GUILayout.Space(10);
             GUILayout.EndHorizontal();
             GUILayout.Space(10);
             GUILayout.EndVertical();
             if (GUILayout.Button("Ok.", GUILayout.Width(100)))
             {
                 Instance.isFuncLocked = false;
             }
         }
         else
         {
             GUILayout.BeginHorizontal();
             windowindex = GUILayout.Toolbar(windowindex, consolenames);
             GUILayout.EndHorizontal();
             GUILayout.Space(10);
             setWindowName(windowindex);
             // Scene Console
             if (windowindex == 0)
             {
                 GUILayout.BeginVertical();
                 subwinindex = GUILayout.Toolbar(subwinindex, options);
                 GUILayout.Space(10);
                 // Edit window
                 if (subwinindex == 0)
                 {
                     sceneConsoleEditUI();
                 }
                 else if (subwinindex == 1)
                 {
                     // Trackable window
                     sceneConsoleTrackable();
                 }
                 else if (subwinindex == 2)
                 {
                     // Load/Save window
                     sceneConsoleLdSvUI();
                 }
                 else if (subwinindex == 3)
                 {
                     // --------- Advanced controls -------------
                     sceneConsoleAdvUI();
                 }
                 else if (subwinindex == 4)
                 {
                     // Ministates window
                     //sceneConsoleMinistates();
                 }
                 else if (subwinindex == 100)
                 {
                     // Render for advanced cam properties
                     //VNExt.render_wizard_ui(SceneConsole.Instance); TODO
                 }
                 GUILayout.FlexibleSpace();
                 GUILayout.BeginHorizontal();
                 // GUILayout.Label("<b>Warning:</b> Closing console removes all console data")
                 if (GUILayout.Button("Reset scenes", GUILayout.Width(100)))
                 {
                     warning_action = Instance.Reset;
                     warning_param  = new WarningParam_s("Delete current scene data? This will not delete scene data saved to the card.", false);
                 }
                 GUILayout.FlexibleSpace();
                 if (GUILayout.Button("Start VN from scene.", GUILayout.Width(100)))
                 {
                     Instance.runVNSS("scene");
                 }
                 if (GUILayout.Button("About v" + mod_version, GUILayout.Width(100)))
                 {
                     //resetConsole(sc.game)
                     Instance.show_blocking_message_time_sc($"SceneSaveState {mod_version}\n{about_text}", 5.0f);
                 }
                 if (GUILayout.Button("Close console", GUILayout.Width(100)))
                 {
                     var col = Instance.sel_font_col;
                     Utils.sceneConsoleGUIClose();
                 }
                 GUILayout.EndHorizontal();
                 GUILayout.EndVertical();
                 GUI.DragWindow();
             }
             else if (windowindex == 1)
             {
                 // Pose Console
                 //var _pc = posesavestate.init_from_sc(SceneConsole.Instance.game); //TODO add posesavestate
                 //posesavestate.poseConsoleUIFuncs();
                 //GUILayout.Label("No poses console for now ))")
             }
             else if (windowindex == 2)
             {
                 //Utils.sceneUtilsUI(); TODO
             }
         }
     }
Exemplo n.º 5
0
        public static void DrawCamSelect()
        {
            GUILayout.BeginVertical();
            string col;

            cam_scroll = GUILayout.BeginScrollView(cam_scroll, GUILayout.Height(185), GUILayout.Width(camviewwidth));
            for (int i = 0; i < Instance.block.CurrentScene.cams.Count - 0; i++)
            {
                if (i == Instance.block.currentCamIndex)
                {
                    col = Instance.sel_font_col;
                }
                else
                {
                    col = "#f9f9f9";
                }
                var             cam       = Instance.block.CurrentScene.cams[i];
                VNCamera.VNData addparams = cam.addata;
                GUILayout.BeginHorizontal();
                // show name if available
                var camtxt = Instance.block.CamStrings[i];
                if (addparams.enabled)
                {
                    var addprops = addparams.addprops;
                    if (addprops.a1)
                    {
                        if (addprops.a1o.name != "")
                        {
                            camtxt = addprops.a1o.name;
                        }
                    }
                }
                if (GUILayout.Button(String.Format("<color={0}>{1}</color>", col, camtxt)))
                {
                    Instance.block.SetCurrentCam(i);
                    Instance.setCamera(isAnimated: false);
                }
                if (GUILayout.Button(String.Format("<color={0}>a</color>", col), GUILayout.Width(22)))
                {
                    Instance.block.SetCurrentCam(i);
                    Instance.setCamera(isAnimated: true);
                }
                GUILayout.EndHorizontal();
            }
            GUILayout.EndScrollView();
            GUILayout.FlexibleSpace();
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Add", GUILayout.Width(camviewwidth * 0.7f)))
            {
                Instance.changeSceneCam(CamTask.ADD);
            }
            if (Instance.block.CurrentScene.cams.Count > 0)
            {
                if (GUILayout.Button("Del", GUILayout.Width(camviewwidth * 0.3f)))
                {
                    if (Instance.promptOnDelete.Value)
                    {
                        warning_action = Instance.deleteSceneCam;
                        warning_param  = new WarningParam_s("Delete selected cam?", false);
                    }
                    else
                    {
                        Instance.changeSceneCam(CamTask.DELETE);
                    }
                }
            }
            GUILayout.EndHorizontal();
            if (Instance.block.CurrentScene.cams.Count > 0)
            {
                if (GUILayout.Button("Update", GUILayout.Width(camviewwidth + 5)))
                {
                    Instance.changeSceneCam(CamTask.UPDATE);
                }
            }
            GUILayout.Label("Move cam:");
            GUILayout.BeginHorizontal();
            var up   = "\u2191";
            var down = "\u2193";

            if (GUILayout.Button(up, GUILayout.Width(camviewwidth / 2)))
            {
                Instance.block.move_cam_up();
            }
            if (GUILayout.Button(down, GUILayout.Width(camviewwidth / 2)))
            {
                Instance.block.move_cam_down();
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            if (Instance.block.HasScenes && Instance.block.currentCamCount > 0)
            {
                if (GUILayout.Button("Copy cams", GUILayout.Width(camviewwidth)))
                {
                    Instance.copyCamSet();
                }
            }
            GUILayout.EndHorizontal();
            GUILayout.BeginHorizontal();
            if (Instance.block.HasScenes && Instance.camset != null)
            {
                if (GUILayout.Button("Paste cams", GUILayout.Width(camviewwidth)))
                {
                    Instance.pasteCamSet();
                }
            }
            GUILayout.EndHorizontal();
            GUILayout.EndVertical();
        }