public static string ToText(this DestroyAnimation destroyAnimation) { switch (destroyAnimation) { case DestroyAnimation.Sprites: return("Sprites (original)"); case DestroyAnimation.Noise: return("Noise"); default: return(null); } }
private Settings() { CreateDirectories(); int graphicsMode = (int)_graphicsMode; bool fullScreen = _fullScreen; bool rightSideBar = _rightSideBar; int scale = _scale; int aspectRatio = (int)_aspectRatio; bool revealWorld = false; bool debugMenu = false; int cursorType = (int)_cursorType; int destroyAnimation = (int)_destroyAnimation; // Read settings Int32.TryParse(GetSetting("GraphicsMode"), out graphicsMode); fullScreen = (GetSetting("FullScreen") == "1"); rightSideBar = (GetSetting("SideBar") == "1"); Int32.TryParse(GetSetting("Scale"), out scale); Int32.TryParse(GetSetting("AspectRatio"), out aspectRatio); revealWorld = (GetSetting("RevealWorld") == "1"); debugMenu = (GetSetting("DebugMenu") == "1"); Int32.TryParse(GetSetting("CursorType"), out cursorType); Int32.TryParse(GetSetting("DestroyAnimation"), out destroyAnimation); // Set settings if (graphicsMode > 0 && graphicsMode < 3) { _graphicsMode = (GraphicsMode)graphicsMode; } _fullScreen = fullScreen; _rightSideBar = rightSideBar; if (scale < 1 || scale > 4) { scale = 2; } _scale = scale; _aspectRatio = (AspectRatio)aspectRatio; _revealWorld = revealWorld; _debugMenu = debugMenu; _cursorType = (CursorType)cursorType; _destroyAnimation = (DestroyAnimation)destroyAnimation; // Set game options EndOfTurn = false; AutoSave = true; }
internal DestroyUnit(IUnit unit, bool stack) { _unit = unit; _stack = stack; _x = Common.GamePlay.X; _y = Common.GamePlay.Y; Palette = Common.DefaultPalette; _gameMap = GameMap; _animation = Settings.DestroyAnimation; if (!Resources.Exists("SP257")) { _animation = DestroyAnimation.Noise; } switch (_animation) { case DestroyAnimation.Sprites: _destroySprites = new IBitmap[8]; for (int i = 0; i < 8; i++) { _destroySprites[i] = Resources["SP257"][16 * i, 96, 16, 16].ColourReplace(9, 0); } break; case DestroyAnimation.Noise: _noiseMap = new byte[320, 200]; for (int x = 0; x < 320; x++) { for (int y = 0; y < 200; y++) { _noiseMap[x, y] = (byte)Common.Random.Next(1, NOISE_COUNT); } } break; } }
private Settings() { CreateDirectories(); int graphicsMode = (int)_graphicsMode; bool fullScreen = _fullScreen; bool rightSideBar = _rightSideBar; int scale = _scale; int aspectRatio = (int)_aspectRatio; int expandWidth = (int)_expandWidth; int expandHeight = (int)_expandHeight; bool revealWorld = false; bool debugMenu = false; bool deityEnabled = false; bool arrowHelper = false; bool customMapSize = false; int cursorType = (int)_cursorType; int destroyAnimation = (int)_destroyAnimation; // Read settings Int32.TryParse(GetSetting("GraphicsMode"), out graphicsMode); fullScreen = (GetSetting("FullScreen") == "1"); rightSideBar = (GetSetting("SideBar") == "1"); Int32.TryParse(GetSetting("Scale"), out scale); Int32.TryParse(GetSetting("AspectRatio"), out aspectRatio); Int32.TryParse(GetSetting("ExpandWidth"), out expandWidth); Int32.TryParse(GetSetting("ExpandHeight"), out expandHeight); revealWorld = (GetSetting("RevealWorld") == "1"); debugMenu = (GetSetting("DebugMenu") == "1"); deityEnabled = (GetSetting("DeityEnabled") == "1"); arrowHelper = (GetSetting("ArrowHelper") == "1"); customMapSize = (GetSetting("CustomMapSize") == "1"); Int32.TryParse(GetSetting("CursorType"), out cursorType); Int32.TryParse(GetSetting("DestroyAnimation"), out destroyAnimation); // Set settings if (graphicsMode > 0 && graphicsMode < 3) { _graphicsMode = (GraphicsMode)graphicsMode; } _fullScreen = fullScreen; _rightSideBar = rightSideBar; if (scale < 1 || scale > 4) { scale = 2; } _scale = scale; _aspectRatio = (AspectRatio)aspectRatio; if (expandWidth < 320 || expandWidth > 512 || expandHeight < 200 || expandHeight > 384) { _expandWidth = -1; _expandHeight = -1; } else { _expandWidth = expandWidth; _expandHeight = expandHeight; } _revealWorld = revealWorld; _debugMenu = debugMenu; _deityEnabled = deityEnabled; _arrowHelper = arrowHelper; _customMapSize = customMapSize; _cursorType = (CursorType)cursorType; _destroyAnimation = (DestroyAnimation)destroyAnimation; // Set game options EndOfTurn = false; AutoSave = true; }