Beispiel #1
0
 private void Main()
 {
     Logger = base.Logger;
     AnimationControllerHotkey = Config.GetSetting("Keyboard Shortcuts", "Toggle Animation Controller Window", new KeyboardShortcut(KeyCode.Minus), new ConfigDescription("Show or hide the Animation Controller window in Studio"));
     CharacterApi.RegisterExtraBehaviour <AnimationControllerCharaController>(GUID);
     StudioSaveLoadApi.RegisterExtraBehaviour <AnimationControllerSceneController>(GUID);
 }
 private void Awake()
 {
     bepinex = gameObject;
     harmony = new Harmony($"{GUID}.harmony");
     HarmonyWrapper.PatchAll(typeof(Hooks), harmony);
     StudioSaveLoadApi.RegisterExtraBehaviour <SceneDataController>(GUID);
 }
Beispiel #3
0
        internal void Main()
        {
            Logger   = base.Logger;
            Instance = this;
            var harmony = Harmony.CreateAndPatchAll(typeof(Hooks));

            SceneManager.sceneLoaded += InitStudioUI;
            StudioSaveLoadApi.RegisterExtraBehaviour <SceneController>(GUID);

            ColliderColor        = Config.Bind("Config", "Collider Color", Color.green, "Color of the collider box drawn when one is selected");
            AddNewMaskToSelected = Config.Bind("Config", "Add New Masks To Selected Object", true, "When enabled, newly created masks will be added to the currently selected object rather than added without a parent object.");

            ColliderColor.SettingChanged += ColliderColor_SettingChanged;

            Type ScreencapType = Type.GetType("Screencap.ScreenshotManager, Screencap");

            if (ScreencapType == null)
            {
                ScreencapType = Type.GetType($"Screencap.ScreenshotManager, {Constants.Prefix}_Screencap");
            }

            if (ScreencapType != null)
            {
#if KK
                harmony.Patch(ScreencapType.GetMethod("TakeCharScreenshot", AccessTools.all), new HarmonyMethod(typeof(Hooks).GetMethod(nameof(Hooks.ScreencapHook), AccessTools.all)));
#else
                harmony.Patch(ScreencapType.GetMethod("CaptureAndWrite", AccessTools.all), new HarmonyMethod(typeof(Hooks).GetMethod(nameof(Hooks.ScreencapHook), AccessTools.all)));
#endif
            }
        }
Beispiel #4
0
        internal void Main()
        {
            Logger = base.Logger;
            CharacterApi.RegisterExtraBehaviour <ColliderController>(GUID);
            StudioSaveLoadApi.RegisterExtraBehaviour <ColliderSceneController>(GUID);

            ConfigBreastColliders = Config.Bind("Config", "Breast Colliders", true, new ConfigDescription("Whether breast colliders are enabled. Makes breasts interact and collide with arms, hands, etc.", null, new ConfigurationManagerAttributes {
                Order = 10
            }));
            ConfigArmColliders = Config.Bind("Config", "Arm Colliders", true, new ConfigDescription("Whether arm colliders are enabled. Makes arms and hands interact and collide with breast.", null, new ConfigurationManagerAttributes {
                Order = 11
            }));
            ConfigFloorCollider = Config.Bind("Config", "Floor Collider", true, new ConfigDescription("Adds a floor collider so hair doesn't clip through the floor when laying down.", null, new ConfigurationManagerAttributes {
                Order = 1
            }));
            ConfigDefaultStudioSettings = Config.Bind("Config", "Default Studio Settings", DefaultStudioSettings.Off, new ConfigDescription("Default state of colliders for new characters in Studio or for older scenes.\nScenes made with this plugin will load with colliders enabled or disabled depending on how the character in scene was configured.", null, new ConfigurationManagerAttributes {
                Order = 0
            }));

            ConfigBreastColliders.SettingChanged += ConfigBreastColliders_SettingChanged;
            ConfigArmColliders.SettingChanged    += ConfigArmColliders_SettingChanged;
            ConfigFloorCollider.SettingChanged   += ConfigFloorCollider_SettingChanged;

            RegisterStudioControls();
        }
Beispiel #5
0
        internal void Main()
        {
            Logger = base.Logger;

            StudioSaveLoadApi.RegisterExtraBehaviour <StudioSceneSettingsSceneController>(GUID);
            SceneManager.sceneLoaded += (s, lsm) => InitStudioUI(s.name);
        }
Beispiel #6
0
        internal void Main()
        {
            Logger = base.Logger;
            Directory.CreateDirectory(ExportPath);

            UIScale = Config.Bind("Config", "UI Scale", 1.75f, new ConfigDescription("Controls the size of the window.", new AcceptableValueRange <float>(1f, 3f), new ConfigurationManagerAttributes {
                Order = 3
            }));
            UIWidth = Config.Bind("Config", "UI Width", 0.3f, new ConfigDescription("Controls the size of the window.", new AcceptableValueRange <float>(0f, 1f), new ConfigurationManagerAttributes {
                Order = 2, ShowRangeAsPercent = false
            }));
            UIHeight = Config.Bind("Config", "UI Height", 0.3f, new ConfigDescription("Controls the size of the window.", new AcceptableValueRange <float>(0f, 1f), new ConfigurationManagerAttributes {
                Order = 1, ShowRangeAsPercent = false
            }));

            UIScale.SettingChanged  += UISettingChanged;
            UIWidth.SettingChanged  += UISettingChanged;
            UIHeight.SettingChanged += UISettingChanged;

            MakerAPI.MakerBaseLoaded                   += MakerAPI_MakerBaseLoaded;
            MakerAPI.RegisterCustomSubCategories       += MakerAPI_RegisterCustomSubCategories;
            AccessoriesApi.SelectedMakerAccSlotChanged += AccessoriesApi_SelectedMakerAccSlotChanged;
            AccessoriesApi.AccessoryKindChanged        += AccessoriesApi_AccessoryKindChanged;
            AccessoriesApi.AccessoryTransferred        += AccessoriesApi_AccessoryTransferred;

            CharacterApi.RegisterExtraBehaviour <MaterialEditorCharaController>(GUID);

#if KK || AI
            SceneManager.sceneLoaded += (s, lsm) => InitStudioUI(s.name);
            StudioSaveLoadApi.RegisterExtraBehaviour <MaterialEditorSceneController>(GUID);
#endif
#if KK
            AccessoriesApi.AccessoriesCopied += AccessoriesApi_AccessoriesCopied;
#endif

            LoadXML();
            var harmony = HarmonyWrapper.PatchAll(typeof(Hooks));

#if KK || EC
            //Hooks for transfering accessories (MoreAccessories compatibility)
            foreach (var method in typeof(ChaCustom.CvsAccessoryChange).GetMethods(AccessTools.all).Where(x => x.Name.Contains("<Start>m__4")))
            {
                harmony.Patch(method, new HarmonyMethod(typeof(Hooks).GetMethod(nameof(Hooks.AccessoryTransferHook), AccessTools.all)));
            }
#elif AI
            //Hooks for changing clothing pattern
            foreach (var method in typeof(CharaCustom.CustomClothesPatternSelect).GetMethods(AccessTools.all).Where(x => x.Name.Contains("<ChangeLink>")))
            {
                harmony.Patch(method, new HarmonyMethod(typeof(Hooks).GetMethod(nameof(Hooks.ClothesColorChangeHook), AccessTools.all)));
            }

            //hooks for changing clothing color
            foreach (var method in typeof(CharaCustom.CustomClothesColorSet).GetMethods(AccessTools.all).Where(x => x.Name.StartsWith("<Initialize>")))
            {
                harmony.Patch(method, new HarmonyMethod(typeof(Hooks).GetMethod(nameof(Hooks.ClothesColorChangeHook), AccessTools.all)));
            }
#endif
        }
 internal void Main()
 {
     Logger  = Logger ?? base.Logger;
     Enabled = Config.Bind("Config", "Enabled", true, "Whether the plugin is enabled");
     SelectInitialCameraShortcut = Config.Bind("Config", "Keyboard Shortcut",
                                               new KeyboardShortcut(KeyCode.BackQuote),
                                               "Key than changes to this camera (behaves like 1-0)");
     StudioSaveLoadApi.RegisterExtraBehaviour <StudioSceneInitialCameraController>(GUID);
     Harmony.CreateAndPatchAll(typeof(Hooks));
 }
        private void Main()
        {
            SceneManager.sceneLoaded += (s, lsm) => InitStudioUI(s.name);
            MakerAPI.MakerBaseLoaded += MakerAPI_MakerBaseLoaded;
            AccessoriesApi.SelectedMakerAccSlotChanged += AccessoriesApi_SelectedMakerAccSlotChanged;
            AccessoriesApi.AccessoryKindChanged        += AccessoriesApi_AccessoryKindChanged;
            AccessoriesApi.AccessoriesCopied           += AccessoriesApi_AccessoriesCopied;
            AccessoriesApi.AccessoryTransferred        += AccessoriesApi_AccessoryTransferred;

            CharacterApi.RegisterExtraBehaviour <MaterialEditorCharaController>(GUID);
            StudioSaveLoadApi.RegisterExtraBehaviour <MaterialEditorSceneController>(GUID);

            HarmonyInstance.Create(GUID).PatchAll(typeof(Hooks));
        }
Beispiel #9
0
        private void Start()
        {
            if (!CheckIncompatibilities())
            {
                return;
            }

            var insideStudio = Application.productName == "CharaStudio";

            MakerAPI.Init(insideStudio);
            StudioAPI.Init(insideStudio);
            StudioSaveLoadApi.Init(insideStudio);
            CharacterApi.Init();
            GameAPI.Init(insideStudio);
        }
        internal static void Init(bool insideStudio)
        {
            InsideStudio = insideStudio;

            if (!insideStudio)
            {
                return;
            }

            Hooks.SetupHooks();
            StudioSaveLoadApi.Init();

            SceneManager.sceneLoaded += SceneLoaded;

            DebugControls();
        }
Beispiel #11
0
        private void Awake()
        {
            EnableDebugLoggingSetting = new ConfigWrapper <bool>("EnableDebugLogging", GUID, false);

            if (!CheckIncompatibilities())
            {
                return;
            }

            var insideStudio = Application.productName == "CharaStudio";

            MakerAPI.Init(insideStudio);
            StudioAPI.Init(insideStudio);
            StudioSaveLoadApi.Init(insideStudio);
            CharacterApi.Init();
            GameAPI.Init(insideStudio);
        }
        internal void Main()
        {
            Logger = base.Logger;
            AnimationControllerHotkey = Config.Bind("Keyboard Shortcuts", "Toggle Animation Controller Window", new KeyboardShortcut(KeyCode.Minus), "Show or hide the Animation Controller window in Studio");
            CharacterApi.RegisterExtraBehaviour <AnimationControllerCharaController>(GUID);
            StudioSaveLoadApi.RegisterExtraBehaviour <AnimationControllerSceneController>(GUID);

            //Change window location for different resolutions. Probably a better way to do this, but I don't care.
            if (Screen.height == 900)
            {
                AnimGUI = new Rect(90, 350, 200, 400);
            }
            else if (Screen.height == 1080)
            {
                AnimGUI = new Rect(110, 510, 200, 400);
            }
        }
        internal void Main()
        {
            Logger = base.Logger;

            SavePattern = Config.Bind("Config", "Save pattern images to scene data", true, new ConfigDescription("Whether images from the userdata/pattern folder will be saved to scene data. False is vanilla behavior and such images can only be loaded if the same image exists on disk.", null, new ConfigurationManagerAttributes {
                Order = 2
            }));
            SaveBG = Config.Bind("Config", "Save BG images to scene data", true, new ConfigDescription("Whether images from the userdata/bg folder folder will be saved to scene data. False is vanilla behavior and such images can only be loaded if the same image exists on disk.", null, new ConfigurationManagerAttributes {
                Order = 1
            }));
            SaveFrame = Config.Bind("Config", "Save frame images to scene data", true, new ConfigDescription("Whether images from the userdata/frame folder folder will be saved to scene data. False is vanilla behavior and such images can only be loaded if the same image exists on disk.", null, new ConfigurationManagerAttributes {
                Order = 1
            }));

            StudioSaveLoadApi.RegisterExtraBehaviour <ImageEmbedSceneController>(GUID);
            Harmony.CreateAndPatchAll(typeof(Hooks));
        }
        private void Main()
        {
            Directory.CreateDirectory(ExportPath);

            SceneManager.sceneLoaded += (s, lsm) => InitStudioUI(s.name);
            MakerAPI.MakerBaseLoaded += MakerAPI_MakerBaseLoaded;
            AccessoriesApi.SelectedMakerAccSlotChanged += AccessoriesApi_SelectedMakerAccSlotChanged;
            AccessoriesApi.AccessoryKindChanged        += AccessoriesApi_AccessoryKindChanged;
            AccessoriesApi.AccessoriesCopied           += AccessoriesApi_AccessoriesCopied;
            AccessoriesApi.AccessoryTransferred        += AccessoriesApi_AccessoryTransferred;

            CharacterApi.RegisterExtraBehaviour <MaterialEditorCharaController>(GUID);
            StudioSaveLoadApi.RegisterExtraBehaviour <MaterialEditorSceneController>(GUID);

            HarmonyInstance.Create(GUID).PatchAll(typeof(Hooks));

            AdvancedMode = new ConfigWrapper <bool>(nameof(AdvancedMode), PluginName, false);
        }
Beispiel #15
0
        protected override void Awake()
        {
            plugin            = this;
            defaultFov        = 90f;
            defaultViewOffset = 0.001f;
            base.Awake();

            HideHead = Config.Bind(SECTION_GENERAL, "Hide character head", true, "Whene entering POV, hide the character's head. Prevents accessories and hair from obstructing the view.");

            Harmony.CreateAndPatchAll(GetType());
            StudioSaveLoadApi.RegisterExtraBehaviour <SceneDataController>(GUID);

            SceneManager.sceneLoaded += (arg0, scene) =>
            {
                hFlag      = FindObjectOfType <HFlag>();
                charaQueue = null;
            };
            SceneManager.sceneUnloaded += arg0 => charaQueue = null;
        }
Beispiel #16
0
        internal void Main()
        {
            Logger = base.Logger;
            Directory.CreateDirectory(ExportPath);

            MakerAPI.MakerBaseLoaded                   += MakerAPI_MakerBaseLoaded;
            MakerAPI.RegisterCustomSubCategories       += MakerAPI_RegisterCustomSubCategories;
            AccessoriesApi.SelectedMakerAccSlotChanged += AccessoriesApi_SelectedMakerAccSlotChanged;
            AccessoriesApi.AccessoryKindChanged        += AccessoriesApi_AccessoryKindChanged;

            CharacterApi.RegisterExtraBehaviour <MaterialEditorCharaController>(GUID);

#if KK || AI
            SceneManager.sceneLoaded += (s, lsm) => InitStudioUI(s.name);
            StudioSaveLoadApi.RegisterExtraBehaviour <MaterialEditorSceneController>(GUID);
#endif
#if KK
            AccessoriesApi.AccessoryTransferred += AccessoriesApi_AccessoryTransferred;
            AccessoriesApi.AccessoriesCopied    += AccessoriesApi_AccessoriesCopied;
#endif

            LoadXML();
            var harmony = HarmonyWrapper.PatchAll(typeof(Hooks));

#if AI
            foreach (var method in typeof(CharaCustom.CustomClothesPatternSelect).GetMethods().Where(x => x.Name.Contains("<ChangeLink>")))
            {
                harmony.Patch(method, new HarmonyMethod(typeof(Hooks).GetMethod(nameof(Hooks.OverrideHook), AccessTools.all)));
            }

            foreach (var method in typeof(CharaCustom.CustomClothesColorSet).GetMethods().Where(x => x.Name.Contains("<Initialize>")))
            {
                harmony.Patch(method, new HarmonyMethod(typeof(Hooks).GetMethod(nameof(Hooks.OverrideHook), AccessTools.all)));
            }
#endif
        }
Beispiel #17
0
        internal void Main()
        {
            Logger = base.Logger;
            Directory.CreateDirectory(ExportPath);

            MakerAPI.MakerBaseLoaded                   += MakerAPI_MakerBaseLoaded;
            MakerAPI.RegisterCustomSubCategories       += MakerAPI_RegisterCustomSubCategories;
            AccessoriesApi.SelectedMakerAccSlotChanged += AccessoriesApi_SelectedMakerAccSlotChanged;
            AccessoriesApi.AccessoryKindChanged        += AccessoriesApi_AccessoryKindChanged;
            AccessoriesApi.AccessoryTransferred        += AccessoriesApi_AccessoryTransferred;

            CharacterApi.RegisterExtraBehaviour <MaterialEditorCharaController>(GUID);

#if KK
            SceneManager.sceneLoaded         += (s, lsm) => InitStudioUI(s.name);
            AccessoriesApi.AccessoriesCopied += AccessoriesApi_AccessoriesCopied;
            StudioSaveLoadApi.RegisterExtraBehaviour <MaterialEditorSceneController>(GUID);
#endif

            AdvancedMode = Config.AddSetting("Config", "Enable advanced editing", false, "Enables advanced editing of characters in the character maker. Note: Some textures and colors will override chracter maker selections but will not always appear to do so, especially after changing them from the in game color pickers. Save and reload to see the real effects.\nUse at your own risk.");

            LoadXML();
            var harmony = HarmonyWrapper.PatchAll(typeof(Hooks));

#if AI
            foreach (var method in typeof(CharaCustom.CustomClothesPatternSelect).GetMethods().Where(x => x.Name.Contains("<ChangeLink>")))
            {
                harmony.Patch(method, new HarmonyMethod(typeof(Hooks).GetMethod(nameof(Hooks.OverrideHook), AccessTools.all)));
            }

            foreach (var method in typeof(CharaCustom.CustomClothesColorSet).GetMethods().Where(x => x.Name.Contains("<Initialize>")))
            {
                harmony.Patch(method, new HarmonyMethod(typeof(Hooks).GetMethod(nameof(Hooks.OverrideHook), AccessTools.all)));
            }
#endif
        }
Beispiel #18
0
 private void Awake()
 {
     harmony = HarmonyWrapper.PatchAll(typeof(Hooks));
     StudioSaveLoadApi.RegisterExtraBehaviour <SceneDataController>(GUID);
 }
Beispiel #19
0
 private void Main()
 {
     AnimationControllerHotkey = new SavedKeyboardShortcut(nameof(AnimationControllerHotkey), nameof(KK_AnimationController), new KeyboardShortcut(KeyCode.Minus));
     CharacterApi.RegisterExtraBehaviour <AnimationControllerCharaController>(GUID);
     StudioSaveLoadApi.RegisterExtraBehaviour <AnimationControllerSceneController>(GUID);
 }
Beispiel #20
0
 private void Awake()
 {
     CharacterApi.RegisterExtraBehaviour <CharaController>(GUID);
     StudioSaveLoadApi.RegisterExtraBehaviour <SceneController>(GUID);
     SceneManager.sceneLoaded += OnSceneLoaded;
 }
Beispiel #21
0
 internal void Start()
 {
     SceneManager.sceneLoaded += (s, lsm) => InitStudioUI(s.name);
     StudioSaveLoadApi.RegisterExtraBehaviour <SceneController>(GUID);
 }
Beispiel #22
0
 internal void Main()
 {
     Logger = base.Logger;
     StudioSaveLoadApi.RegisterExtraBehaviour <SceneController>(GUID);
     Harmony.CreateAndPatchAll(typeof(Hooks));
 }
Beispiel #23
0
        private void Start()
        {
            StudioSaveLoadApi.RegisterExtraBehaviour <SceneDataController>(GUID);

            ChangeLayer = Config.Bind("General", "Change layer", new KeyboardShortcut(KeyCode.V), "Toggle the selected objects between character and map layers");
        }
Beispiel #24
0
 internal void Awake()
 {
     StudioSaveLoadApi.RegisterExtraBehaviour <SaveLoadController>(GUID);
 }
 private void Start()
 {
     Instance = this;
     SceneManager.sceneLoaded += (s, lsm) => InitStudioUI(s.name);
     StudioSaveLoadApi.RegisterExtraBehaviour <SceneController>(MaterialEditorPlugin.PluginGUID);
 }
 internal void Start() => StudioSaveLoadApi.RegisterExtraBehaviour <SceneController>(GUID);
Beispiel #27
0
 private void Awake()
 {
     bepinex = gameObject;
     harmony = Harmony.CreateAndPatchAll(typeof(Hooks));
     StudioSaveLoadApi.RegisterExtraBehaviour <SceneDataController>(GUID);
 }