예제 #1
0
        private void Map_TileSelected(Tile t)
        {
            updatingDisplay = true;

            CheckDescriptionUpdate();
            CurrentTile = t;

            NorthWall.Setup(Context, Zone, t.Walls[0]);
            EastWall.Setup(Context, Zone, t.Walls[1]);
            SouthWall.Setup(Context, Zone, t.Walls[2]);
            WestWall.Setup(Context, Zone, t.Walls[3]);

            CeilingTexture.TextureId = t.CeilingTexture;
            FloorTexture.TextureId   = t.FloorTexture;

            UpdateDescription();
            UpdateETable();

            OnEnterBox.SelectedItem = Globals.Resolve(Context, t.OnEnterId);
            OnUseBox.SelectedItem   = Globals.Resolve(Context, t.OnUseId);
            ThingBox.SelectedItem   = Globals.Resolve(Context, t.Thing);
            DangerBox.Value         = t.Danger;
            EffectBox.SelectedIndex = (int)t.Effect;

            ImpassableFlag.Checked = t.Flags.HasFlag(TileFlags.Impassable);

            UpdateItemList();

            updatingDisplay = false;
        }
예제 #2
0
 public void EnableWalls(bool[] walls)
 {
     if (walls[(int)Direction.N])
     {
         NorthWall.SetActive(true);
     }
     if (walls[(int)Direction.E])
     {
         EastWall.SetActive(true);
     }
     if (walls[(int)Direction.S])
     {
         SouthWall.SetActive(true);
     }
     if (walls[(int)Direction.W])
     {
         WestWall.SetActive(true);
     }
 }
예제 #3
0
        private void Map_KeyUp(object sender, KeyEventArgs e)
        {
            bool handled = true;

            switch (e.KeyCode)
            {
            case Keys.N:
                if (e.Shift)
                {
                    NorthWall.CycleTexture();
                }
                else
                {
                    NorthWall.CycleType();
                }
                break;

            case Keys.E:
                if (e.Shift)
                {
                    EastWall.CycleTexture();
                }
                else
                {
                    EastWall.CycleType();
                }
                break;

            case Keys.S:
                if (e.Shift)
                {
                    SouthWall.CycleTexture();
                }
                else
                {
                    SouthWall.CycleType();
                }
                break;

            case Keys.W:
                if (e.Shift)
                {
                    WestWall.CycleTexture();
                }
                else
                {
                    WestWall.CycleType();
                }
                break;

            case Keys.C:
                CeilingTexture.Cycle();
                break;

            case Keys.F:
                FloorTexture.Cycle();
                break;

            case Keys.T:
                CycleThing();
                break;

            case Keys.I:
                ImpassableFlag.Checked = !ImpassableFlag.Checked;
                break;

            case Keys.Z:
                int size = Map.TileSize * 2;
                if (size > 100)
                {
                    size = 16;
                }
                Map.TileSize = size;
                break;

            default:
                handled = false;
                break;
            }

            e.Handled = handled;
        }