Beispiel #1
0
        public static void OnLoad(string path)
        {
            PUtil.InitLibrary(true);
            PLocalization.Register();
            POptions.RegisterOptions(typeof(InspectToolSettings));

            ReadOptions();

            PKeyBinding pKeyBinding = null;

            if (KKeyCodeUtil.TryParse(InspectToolSettings.Instance.Hotkey, out KKeyCode keyCode, out Modifier modifier))
            {
                pKeyBinding = new PKeyBinding(keyCode, modifier);
            }

            PAction = PAction.Register(InspectToolStrings.ACTION_ID, InspectToolStrings.ACTION_TITLE, pKeyBinding);

            try
            {
                var inspectToolIconSprite = Assembly.GetExecutingAssembly().GetManifestResourceStream("InspectTool.img.inspectToolIcon.dds");
                var inspectCursorSprite   = Assembly.GetExecutingAssembly().GetManifestResourceStream("InspectTool.img.inspectCursor.dds");
                InspectToolAssets.InspectToolIcon        = SpriteUtil.CreateSpriteDXT5(inspectToolIconSprite, 32, 32);
                InspectToolAssets.InspectToolCursor      = SpriteUtil.CreateSpriteDXT5(inspectCursorSprite, 256, 256);
                InspectToolAssets.InspectToolIcon.name   = InspectToolStrings.TOOL_ICON_SPRITE_NAME;
                InspectToolAssets.InspectToolCursor.name = InspectToolStrings.CURSOR_SPRITE_NAME;
            }
            catch (Exception e)
            {
                Debug.LogError(e);
            }
        }
Beispiel #2
0
        public static void OnLoad(string path)
        {
            PUtil.InitLibrary(true);
            PLocalization.Register();
            POptions.RegisterOptions(typeof(SandboxConduitToolSettings));

            ReadOptions();

            PKeyBinding pKeyBinding = null;

            if (KKeyCodeUtil.TryParse(SandboxConduitToolSettings.Instance.Hotkey, out KKeyCode keyCode, out Modifier modifier))
            {
                pKeyBinding = new PKeyBinding(keyCode, modifier);
            }
            PAction = PAction.Register("SandboxConduitToolAction", "Sandbox Conduit Tool", pKeyBinding);
        }