예제 #1
0
파일: TileTypeTool.cs 프로젝트: MK4H/MHUrho
        public TileTypeTool(GameController input, GameUI ui, CameraMover camera, IntRect iconRectangle)
            : base(input, iconRectangle)
        {
            this.input           = input;
            this.ui              = ui;
            this.tileTypes       = new Dictionary <CheckBox, TileType>();
            this.highlight       = new StaticSizeHighlighter(input, ui, camera, 3, Color.Green);
            this.checkBoxes      = new ExclusiveCheckBoxes();
            this.mouseButtonDown = false;
            this.enabled         = false;
            InitUI(ui, out uiElem, out sizeSlider);

            foreach (var tileType in input.Level.Package.TileTypes)
            {
                var checkBox = ui.SelectionBar.CreateCheckBox();
                checkBox.SetStyle("SelectionBarCheckBox");
                checkBox.Toggled      += OnTileTypeToggled;
                checkBox.Texture       = input.Level.Package.TileIconTexture;
                checkBox.ImageRect     = tileType.IconRectangle;
                checkBox.HoverOffset   = new IntVector2(tileType.IconRectangle.Width(), 0);
                checkBox.CheckedOffset = new IntVector2(2 * tileType.IconRectangle.Width(), 0);

                tileTypes.Add(checkBox, tileType);
                checkBoxes.AddCheckBox(checkBox);
            }
        }
예제 #2
0
 public TerrainSmoothingManipulator(GameController input, GameUI ui, CameraMover camera, IMap map)
 {
     this.input = input;
     this.ui    = ui;
     this.map   = map;
     InitUI(ui, out uiElem, out sizeSlider);
     highlight = new StaticSizeHighlighter(input, ui, camera, 3, Color.Green);
 }