public EditorPreferences(string registryKey) { _registryKey = registryKey; RegistryKey key = Registry.CurrentUser.OpenSubKey(registryKey); if (key != null) { _tabSize = Convert.ToInt32(key.GetValue("ScEdTabWidth", _tabSize)); _testGameScreen = (TestGameWindowStyle)Convert.ToInt32(key.GetValue("TestGameStyle", _testGameScreen)); _editorStartupPane = (EditorStartupPane)Convert.ToInt32(key.GetValue("StartupPane", _editorStartupPane)); _defaultImportPath = Convert.ToString(key.GetValue("DefaultImportPath", string.Empty)); _projectTreeOnRight = Convert.ToInt32(key.GetValue("ProjectTreeOnRight", _projectTreeOnRight)) != 0; _messageBoxOnCompileErrors = (MessageBoxOnCompile)Convert.ToInt32(key.GetValue("MessageBoxOnCompileErrors", _messageBoxOnCompileErrors)); _indentUseTabs = Convert.ToInt32(key.GetValue("IndentUsingTabs", _indentUseTabs)) != 0; _showViewPreviewByDefault = Convert.ToInt32(key.GetValue("ShowViewPreviewByDefault", _showViewPreviewByDefault)) != 0; _paintProgramPath = Convert.ToString(key.GetValue("PaintProgramPath", string.Empty)); _defaultSpriteImportTransparency = (SpriteImportMethod)Convert.ToInt32(key.GetValue("SpriteImportTransparency", _defaultSpriteImportTransparency)); _defaultNewGamePath = Convert.ToString(key.GetValue("NewGamePath", _defaultNewGamePath)); _sendAnonymousStats = Convert.ToInt32(key.GetValue("SendAnonymousStats", _sendAnonymousStats)) != 0; _statsLastSent = ReadDateFromRegistry(key, "StatsLastSent", _statsLastSent); _backupWarningInterval = Convert.ToInt32(key.GetValue("BackupWarningInterval", _backupWarningInterval)); _lastBackupWarning = ReadDateFromRegistry(key, "LastBackupWarning", _lastBackupWarning); _remapPalettizedBackgrounds = Convert.ToInt32(key.GetValue("RemapPaletteBackgrounds", _remapPalettizedBackgrounds)) != 0; _keepHelpOnTop = Convert.ToInt32(key.GetValue("KeepHelpOnTop", _keepHelpOnTop)) != 0; _dialogOnMultibleTabsClose = Convert.ToInt32(key.GetValue("DialogOnMultipleTabsClose", _dialogOnMultibleTabsClose)) != 0; _useLegacyCompiler = Convert.ToInt32(key.GetValue("UseLegacyCompiler", _useLegacyCompiler)) != 0; ReadRecentSearchesList(key); key.Close(); if ((_defaultImportPath.Length > 0) && (!System.IO.Directory.Exists(_defaultImportPath))) { _defaultImportPath = string.Empty; } if ((_paintProgramPath.Length > 0) && (!System.IO.File.Exists(_paintProgramPath))) { _paintProgramPath = string.Empty; } } }
public EditorPreferences(string registryKey) { _registryKey = registryKey; RegistryKey key = Registry.CurrentUser.OpenSubKey(registryKey); if (key != null) { _tabSize = Convert.ToInt32(key.GetValue("ScEdTabWidth", _tabSize)); _testGameScreen = (TestGameWindowStyle)Convert.ToInt32(key.GetValue("TestGameStyle", _testGameScreen)); _editorStartupPane = (EditorStartupPane)Convert.ToInt32(key.GetValue("StartupPane", _editorStartupPane)); _defaultImportPath = Convert.ToString(key.GetValue("DefaultImportPath", string.Empty)); _projectTreeOnRight = Convert.ToInt32(key.GetValue("ProjectTreeOnRight", _projectTreeOnRight)) != 0; _messageBoxOnCompileErrors = (MessageBoxOnCompile)Convert.ToInt32(key.GetValue("MessageBoxOnCompileErrors", _messageBoxOnCompileErrors)); _indentUseTabs = Convert.ToInt32(key.GetValue("IndentUsingTabs", _indentUseTabs)) != 0; _showViewPreviewByDefault = Convert.ToInt32(key.GetValue("ShowViewPreviewByDefault", _showViewPreviewByDefault)) != 0; _paintProgramPath = Convert.ToString(key.GetValue("PaintProgramPath", string.Empty)); _defaultSpriteImportTransparency = (SpriteImportMethod)Convert.ToInt32(key.GetValue("SpriteImportTransparency", _defaultSpriteImportTransparency)); _defaultNewGamePath = Convert.ToString(key.GetValue("NewGamePath", _defaultNewGamePath)); _sendAnonymousStats = Convert.ToInt32(key.GetValue("SendAnonymousStats", _sendAnonymousStats)) != 0; _statsLastSent = ReadDateFromRegistry(key, "StatsLastSent", _statsLastSent); _backupWarningInterval = Convert.ToInt32(key.GetValue("BackupWarningInterval", _backupWarningInterval)); _lastBackupWarning = ReadDateFromRegistry(key, "LastBackupWarning", _lastBackupWarning); _remapPalettizedBackgrounds = Convert.ToInt32(key.GetValue("RemapPaletteBackgrounds", _remapPalettizedBackgrounds)) != 0; _keepHelpOnTop = Convert.ToInt32(key.GetValue("KeepHelpOnTop", _keepHelpOnTop)) != 0; _dialogOnMultibleTabsClose = Convert.ToInt32(key.GetValue("DialogOnMultipleTabsClose", _dialogOnMultibleTabsClose)) != 0; ReadRecentSearchesList(key); key.Close(); if ((_defaultImportPath.Length > 0) && (!System.IO.Directory.Exists(_defaultImportPath))) { _defaultImportPath = string.Empty; } if ((_paintProgramPath.Length > 0) && (!System.IO.File.Exists(_paintProgramPath))) { _paintProgramPath = string.Empty; } } }
public void ReplaceSpriteWithBitmap(Sprite spr, Bitmap bmp, SpriteImportMethod transparency, bool remapColours, bool useRoomBackgroundColours, bool alphaChannel) { _native.ReplaceSpriteWithBitmap(spr, bmp, (int)transparency, remapColours, useRoomBackgroundColours, alphaChannel); }
/* * public Sprite CreateSpriteFromBitmap(Bitmap bmp) * { * int spriteSlot = _native.GetFreeSpriteSlot(); * return _native.SetSpriteFromBitmap(spriteSlot, bmp, 0, true, false, false); * } */ public Sprite CreateSpriteFromBitmap(Bitmap bmp, SpriteImportMethod transparency, bool remapColours, bool useRoomBackgroundColours, bool alphaChannel) { int spriteSlot = _native.GetFreeSpriteSlot(); return(_native.SetSpriteFromBitmap(spriteSlot, bmp, (int)transparency, remapColours, useRoomBackgroundColours, alphaChannel)); }
/* public Sprite CreateSpriteFromBitmap(Bitmap bmp) { int spriteSlot = _native.GetFreeSpriteSlot(); return _native.SetSpriteFromBitmap(spriteSlot, bmp, 0, true, false, false); } */ public Sprite CreateSpriteFromBitmap(Bitmap bmp, SpriteImportMethod transparency, bool remapColours, bool useRoomBackgroundColours, bool alphaChannel) { int spriteSlot = _native.GetFreeSpriteSlot(); return _native.SetSpriteFromBitmap(spriteSlot, bmp, (int)transparency, remapColours, useRoomBackgroundColours, alphaChannel); }