Ejemplo n.º 1
0
 public LtAddon()
 {
     if (Instance == null)
     {
         Instance = this;
     }
 }
Ejemplo n.º 2
0
        internal static void LoadSettings()
        {
            if (settings == null)
            {
                LoadSettingsFile();
            }

            if (settings != null)
            {
                ConfigNode windowsNode  = settings.HasNode("LT_Windows") ? settings.GetNode("LT_Windows") : settings.AddNode("LT_Windows");
                ConfigNode settingsNode = settings.HasNode("LT_Settings") ? settings.GetNode("LT_Settings") : settings.AddNode("LT_Settings");

                // Load window posisitons
                WindowSettings.position = GetRectangle(windowsNode, "SettingsPosition", WindowSettings.position);
                WindowSkyLab.position   = GetRectangle(windowsNode, "SkylabPosition", WindowSkyLab.position);

                // Load settings
                resolution  = settingsNode.HasValue("Resolution") ? float.Parse(settingsNode.GetValue("Resolution")) : resolution;
                shuttertime = settingsNode.HasValue("Shuttertime") ? float.Parse(settingsNode.GetValue("Shuttertime")) : shuttertime;

                enableBlizzyToolbar = settingsNode.HasValue("EnableBlizzyToolbar") ? bool.Parse(settingsNode.GetValue("EnableBlizzyToolbar")) : enableBlizzyToolbar;
                hideUiOnScreenshot  = settingsNode.HasValue("HideUIOnScreenshot") ? bool.Parse(settingsNode.GetValue("HideUIOnScreenshot")) : hideUiOnScreenshot;

                convertToJpg    = settingsNode.HasValue("ConvertToJPG") ? bool.Parse(settingsNode.GetValue("ConvertToJPG")) : convertToJpg;
                keepOriginalPng = settingsNode.HasValue("KeepOriginalPNG") ? bool.Parse(settingsNode.GetValue("KeepOriginalPNG")) : keepOriginalPng;
                jpgQuality      = settingsNode.HasValue("JPGQuality") ? int.Parse(settingsNode.GetValue("JPGQuality")) : jpgQuality;

                // Set the loaded flag
                loaded = true;
            }

            // Force styles to refresh/load
            LtStyle.WindowStyle = null;

            // Lets make sure that the windows can be seen on the screen
            LtAddon.RepositionWindows();
        }