Exemplo n.º 1
0
        //-----------------------------------------------------------------------------
        // Constructors
        //-----------------------------------------------------------------------------
        public EditorControl()
        {
            this.propertyGridControl	= null;
            this.worldFilePath	= String.Empty;
            this.worldFileName	= "untitled";
            this.world			= null;
            this.level			= null;
            this.tileset		= null;
            this.zone			= null;
            this.rewardManager	= null;
            this.inventory		= null;
            this.timer			= null;
            this.ticks			= 0;
            this.roomSpacing	= 1;
            this.playAnimations	= false;
            this.isInitialized	= false;
            this.hasMadeChanges	= false;

            this.currentLayer				= 0;
            this.currentToolIndex			= 0;
            this.aboveTileDrawMode			= TileDrawModes.Fade;
            this.belowTileDrawMode			= TileDrawModes.Fade;
            this.showRewards				= true;
            this.showGrid					= false;
            this.showEvents					= false;
            this.highlightMouseTile			= true;
            this.selectedRoom				= -Point2I.One;
            this.selectedTile				= -Point2I.One;
            this.selectedTilesetTile		= Point2I.Zero;
            this.selectedTilesetTileData	= null;
            this.playerPlaceMode			= false;
            this.sampleFromAllLayers		= false;
        }
Exemplo n.º 2
0
        public void Initialize(ContentManager contentManager, GraphicsDevice graphicsDevice)
        {
            if (!isInitialized) {
                Resources.Initialize(contentManager, graphicsDevice);
                GameData.Initialize();
                EditorResources.Initialize();

                this.inventory		= new Inventory(null);
                this.rewardManager	= new RewardManager(null);
                this.timer			= Stopwatch.StartNew();
                this.ticks			= 0;
                this.roomSpacing	= 1;
                this.playAnimations = false;
                this.tileset		= GameData.TILESET_CLIFFS;
                this.zone			= GameData.ZONE_PRESENT;
                this.selectedTilesetTileData = this.tileset.TileData[0, 0];
                this.eventMode		= false;

                GameData.LoadInventory(inventory);
                GameData.LoadRewards(rewardManager);

                // Create tileset combo box.
                editorForm.ComboBoxTilesets.Items.Clear();
                foreach (KeyValuePair<string, Tileset> entry in Resources.GetResourceDictionary<Tileset>()) {
                    editorForm.ComboBoxTilesets.Items.Add(entry.Key);
                }
                editorForm.ComboBoxTilesets.SelectedIndex = 0;

                // Create zone combo box.
                editorForm.ComboBoxZones.Items.Clear();
                foreach (KeyValuePair<string, Zone> entry in Resources.GetResourceDictionary<Zone>()) {
                    if (tileset.SpriteSheet.Image.HasVariant(entry.Key))
                        editorForm.ComboBoxZones.Items.Add(entry.Key);
                }
                editorForm.ComboBoxZones.SelectedIndex = 0;

                // Create controllers.
                propertyGridControl = new PropertyGridControl(this, editorForm.PropertyGrid);

                // Create tools.
                tools = new List<EditorTool>();
                AddTool(toolPointer		= new ToolPointer());
                AddTool(toolPlace		= new ToolPlace());
                AddTool(toolSelection	= new ToolSelection());
                AddTool(toolEyedrop		= new ToolEyedrop());
                currentToolIndex = 0;
                tools[currentToolIndex].OnBegin();

                this.isInitialized = true;
            }
        }
Exemplo n.º 3
0
 public SpriteIndexComboBox(PropertyGridControl propertyGridControl)
 {
     this.propertyGridControl = propertyGridControl;
 }