Exemplo n.º 1
0
        /// <summary>
        ///     Main mod class constructor. Sets up the static instance.
        /// </summary>
        public PrepareLanding()
        {
            Logger.Message("Enter constructor.");
            if (Instance == null)
            {
                Instance = this;
            }

            // initialize events
            EventHandler = new RimWorldEventHandler();

            // global game options
            GameOptions = new GameOptions(Settings, EventHandler);

            // instance used to keep track of (or override) game ticks.
            GameTicks = new GameTicks();

            // Holds various mod options (shown on the 'option' tab on the GUI).
            var filterOptions = new FilterOptions();

            GameData = new GameData.GameData(filterOptions);

            TileFilter = new WorldTileFilter(GameData.UserData);

            // instantiate the tile highlighter
            TileHighlighter = new TileHighlighter(filterOptions);

            Logger.Message("Exit constructor.");
        }
Exemplo n.º 2
0
        /// <summary>
        ///     Called during mod initialization.
        /// </summary>
        public override void Initialize()
        {
            Logger.Message("Initializing.");

            // initialize events
            PatchWorldInterfaceOnGui.OnWorldInterfaceOnGui   += WorldInterfaceOnGui;
            PatchWorldInterfaceUpdate.OnWorldInterfaceUpdate += WorldInterfaceUpdate;

            // various options show on the 'option' tab on the GUI.
            _filterOptions = new FilterOptions();

            // main instance to keep user filter choices on the GUI.
            UserData = new UserData(_filterOptions);

            TileFilter = new WorldTileFilter(UserData);

            // instantiate the main window now
            MainWindow = new MainWindow(UserData);

            // instantiate the tile highlighter
            TileHighlighter = new TileHighlighter();
            Instance.OnWorldInterfaceOnGui  += TileHighlighter.HighlightedTileDrawerOnGui;
            Instance.OnWorldInterfaceUpdate += TileHighlighter.HighlightedTileDrawerUpdate;
        }