Exemplo n.º 1
0
        public override void Init()
        {
            try
            {
                if (containingAtom.type != "Person")
                {
                    SuperController.LogError("Please add Doll Master to a Person atom");
                    return;
                }

                lastAtomName = containingAtom.uid;

                PLUGIN_PATH    = GetPluginPath();
                ASSETS_PATH    = PLUGIN_PATH + "/Assets";
                VAMASUTRA_PATH = ASSETS_PATH + "/VAMasutra";
                LOAD_PATH      = SuperController.singleton.currentLoadDir;

                headAudioSource = containingAtom.GetStorableByID("HeadAudioSource") as AudioSourceControl;

                RegisterActions();

                ui = new UI(this, 0.001f);
                ui.canvas.transform.Translate(0, 0.2f, 0);

                config = new Config(this);

                personas = new Personas(this);

                ps = new PluginState(this);

                arousal = new Arousal(this);

                expressions = new Expressions(this);

                expressionController = new ExpressionController(this);

                sfxController = new SFXController(this);

                thrustController = new ThrustController(this);

                thrustAutoController = new ThrustAutoController(this);

                breathController = new BreathController(this);

                headController = new HeadController(this);

                poseController = new PoseController(this);

                montageController = new MontageController(this, poseController);

                dressController = new DressController(this);

                climaxController = new ClimaxController(this);

                kissController = new KissController(this);

                new TopButtons(this);

                //new WorldUI(this);

                CreateSpacer().height = 200;

                //SuperController singleton = SuperController.singleton;
                //singleton.onAtomUIDRenameHandlers = (SuperController.OnAtomUIDRename)Delegate.Combine(singleton.onAtomUIDRenameHandlers, new SuperController.OnAtomUIDRename(HandleRename));
            }
            catch (Exception e)
            {
                SuperController.LogError("Exception caught: " + e);
            }
        }
Exemplo n.º 2
0
        public TopButtons(DollmasterPlugin dm) : base(dm)
        {
            AddButton("Select Person", () =>
            {
                SuperController.singleton.editModeToggle.isOn = true;
                SuperController.singleton.ShowMainHUDAuto();
                SuperController.singleton.ClearSelection();
                SuperController.singleton.SelectController(atom.mainController);
            });

            // Shit's broken yo.

            //AddButton("Change Look", () =>
            //{
            //    SuperController.singleton.ShowMainHUDAuto();
            //    PresetManager pm = atom.GetComponentInChildren<PresetManager>(includeInactive: true);
            //    PresetManagerControlUI pmcui = atom.GetComponentInChildren<PresetManagerControlUI>(includeInactive: true);
            //    if (pm != null && pmcui != null)
            //    {
            //        pm.itemType = PresetManager.ItemType.Atom;
            //        pm.creatorName = null;
            //        pm.storeFolderName = "Appearance";
            //        pm.storeName = "Appearance";
            //        pmcui.browsePresetsButton.onClick.Invoke();
            //        //atom.LoadAppearancePresetDialog();
            //    }
            //    dm.dressController.OnRestore();
            //});

            //AddButton("Change Outfit", () =>
            //{
            //    SuperController.singleton.ShowMainHUDAuto();
            //    PresetManager pm = atom.GetComponentInChildren<PresetManager>(includeInactive: true);
            //    PresetManagerControlUI pmcui = atom.GetComponentInChildren<PresetManagerControlUI>(includeInactive: true);

            //    if (pm != null && pmcui != null)
            //    {
            //        pm.itemType = PresetManager.ItemType.Custom;
            //        pm.customPath = "Atom/Person/Clothing/";
            //        pmcui.browsePresetsButton.onClick.Invoke();
            //    }

            //    dm.dressController.OnRestore();
            //});

            AddButton("Toggle Clothes", () =>
            {
                dm.dressController.ToggleDressed();
            });

            AddButton("Select Pose", () =>
            {
                SuperController.singleton.ShowMainHUDAuto();
                // TODO: Preset pose-loading is not working here.
                string text = SuperController.singleton.savesDir + atom.type + "\\pose";
                SuperController.singleton.fileBrowserUI.defaultPath = text;
                SuperController.singleton.fileBrowserUI.SetTextEntry(b: false);
                SuperController.singleton.fileBrowserUI.Show((path) => {
                    if (string.IsNullOrEmpty(path))
                    {
                        return;
                    }
                    atom.LoadPhysicalPreset(path);

                    SuperController.singleton.PauseSimulation(5, "Loading Pose");

                    AllJointsController ajc = atom.GetComponentInChildren <AllJointsController>(includeInactive: true);
                    ajc.SetOnlyKeyJointsOn();
                    dm.thrustController.Clear();
                    dm.thrustController.GenerateThrustAtoms();
                });
            });

            AddButton("VAMasutra", () =>
            {
                SuperController.singleton.ShowMainHUDAuto();
                string sutraPath = DollmasterPlugin.ASSETS_PATH + "/VAMasutra";
                SuperController.singleton.fileBrowserUI.defaultPath = sutraPath;
                SuperController.singleton.fileBrowserUI.SetTextEntry(b: false);
                SuperController.singleton.fileBrowserUI.Show((path) => {
                    var montageJSON = JSON.Parse(SuperController.singleton.ReadFileIntoString(path)) as JSONClass;
                    dm.montageController.currentMontage = null;
                    MontageController.BeginMontage(dm, montageJSON);
                });
            });

            AddButton("Cycle Thruster", () =>
            {
                dm.montageController.NextThruster();
            });

            bool minimized = false;

            UIDynamicButton minimizeUIButton = ui.CreateButton("Minimize UI", 100, 40);

            minimizeUIButton.transform.Translate(0.1f, -0.1f, 0, Space.Self);
            UI.ColorButton(minimizeUIButton, Color.white, Color.black);

            Dictionary <GameObject, bool> priorActive = new Dictionary <GameObject, bool>();

            minimizeUIButton.button.onClick.AddListener(() =>
            {
                minimized = !minimized;

                Transform t = ui.canvas.transform;
                for (int i = 0; i < t.childCount; i++)
                {
                    GameObject child = t.GetChild(i).gameObject;
                    if (minimized)
                    {
                        priorActive[child] = child.activeSelf;
                        child.SetActive(false);
                    }
                    else
                    {
                        child.SetActive(priorActive[child]);
                    }
                }

                minimizeUIButton.gameObject.SetActive(true);

                minimizeUIButton.label = minimized ? "Max UI" : "Minimize UI";
            });
        }
Exemplo n.º 3
0
 public void Activate(DollmasterPlugin dm)
 {
     MontageController.BeginMontage(dm, montageJSON);
 }