Example #1
0
 public BorderStyles(double width, EBorderStyle style, double[] dash)
 {
     this.mDict         = null;
     this.mDict         = Library.CreateDict();
     this.mDict["Type"] = Library.CreateName("Border");
     this.Style         = style;
     this.Width         = width;
     this.DashArray     = dash;
 }
Example #2
0
        public WindowPlayerState(int x, int y, int w, int h, string title, EBorderStyle borderStyle, Entity player, HUD parent)
            : base(x, y, w, h, title, borderStyle, player, parent)
        {
            skillInfoWindow = new WindowSkillInfo(0, 0, 30, 12, "[skill]", EBorderStyle.ALL, player, parent);
            parent.windows.Add(skillInfoWindow);

            playerSkills       = player.Get <SkillUserComponent>();
            playerPhysicsState = player.Get <PhysicsComponent>();
            playerAttributes   = player.Get <AttributesComponent>();
        }
Example #3
0
 public WindowLog(int x, int y, int w, int h, string title, EBorderStyle borderStyle, Entity player, HUD parent)
     : base(x, y, w, h, title, borderStyle, player, parent)
 {
     log     = new List <string>(MAX_LOG_SIZE);
     display = new string[DISPLAY_SIZE];
     for (int i = 0; i < display.Length; i++)
     {
         display[i] = "";
     }
 }
Example #4
0
        public Window(int x, int y, int w, int h, string title, EBorderStyle borderStyle, Entity player, HUD parent)
        {
            origin           = new Vector2(x, y);
            console          = new TCODConsole(w, h);
            this.title       = title;
            this.borderStyle = borderStyle;
            this.player      = player;
            this.parent      = parent;

            engine    = Engine.instance;
            isVisible = true;

            InitializeConsole();
        }
Example #5
0
        public WindowCharacterCreateMenu(int x, int y, int w, int h, string title, EBorderStyle borderStyle, Entity player, HUD parent)
            : base(x, y, w, h, title, borderStyle, player, parent)
        {
            borderStyle     = EBorderStyle.NONE;
            availablePoints = NUMBER_OF_POINTS;

            dragdrop = new HUD.DragDrop();

            characterNameField = new TextField(3, 5, MAX_NAME_LENGTH, 1, elementDarker, elementDark, foregroundColor, CharacterNameCompleted);

            // sub windows for inspecitng the starrting skills and starting items
            skillInspector = new WindowSkillInfo(0, 0, 30, 12, "[skill]", EBorderStyle.ALL, null, null);
            itemInspector  = new WindowItemInfo(0, 0, 30, 12, "[item]", EBorderStyle.ALL, null, null);
        }
Example #6
0
        public WindowInventory(int x, int y, int w, int h, string title, EBorderStyle borderStyle, Entity player, HUD parent)
            : base(x, y, w, h, title, borderStyle, player, parent)
        {
            itemInfoWindow = new WindowItemInfo(0, 0, 30, 12, "[details]", EBorderStyle.ALL, player, parent);
            parent.windows.Add(itemInfoWindow);

            // cache the players inventory: NOTE: this needs to be updated if teh player is destroyed so that the component can be GC'd
            inventory = player.Get <InvComponent>();
            equipment = player.Get <EquipmentComponent>();

            equipSection.starty = 4;
            equipSection.endy   = 24;
            invSection.starty   = 25;
            invSection.endy     = h;
        }
Example #7
0
        public WindowMainMenu(int x, int y, int w, int h, string title, EBorderStyle borderStyle, Entity player, HUD parent)
            : base(x, y, w, h, title, borderStyle, player, parent)
        {
            borderStyle = EBorderStyle.NONE;
            buttons     = new List <Button>();

            const int buttonWidth = 16;
            int       buttonX     = x + w / 2 - buttonWidth / 2;

            buttons.Add(new Button(buttonX, 10, buttonWidth, 1, "[START GAME]",
                                   elementDark, Constants.COL_FRIENDLY, foregroundColor,
                                   StartNewGame));

            buttons.Add(new Button(buttonX, 15, buttonWidth, 1, "[RESUME]",
                                   elementDark, Constants.COL_FRIENDLY, foregroundColor,
                                   ResumeGame));

            buttons.Add(new Button(buttonX, 20, buttonWidth, 1, "[SETTINGS]",
                                   elementDark, Constants.COL_FRIENDLY, foregroundColor,
                                   GameOptions));
        }
Example #8
0
 public WindowSkillInfo(int x, int y, int w, int h, string title, EBorderStyle borderStyle, Entity player, HUD parent)
     : base(x, y, w, h, title, borderStyle, player, parent)
 {
     isVisible = false;
 }
Example #9
0
 public WindowGameMenu(int x, int y, int w, int h, string title, EBorderStyle borderStyle, Entity player, HUD parent)
     : base(x, y, w, h, title, borderStyle, player, parent)
 {
     borderStyle = EBorderStyle.NONE;
 }
Example #10
0
        public void DrawRectBorderAt(int x, int y, int left, int top, int right, int bottom, EBorderStyle style, TCODColor borderCol)
        {
            // border cases
            if (x == left && (style == EBorderStyle.WEST || style == EBorderStyle.ALL))
            {
                console.setCharForeground(x, y, borderCol);
                console.setChar(x, y, CharConstants.VERT_LINE);
            }

            if (x == right - 1 && (style == EBorderStyle.EAST || style == EBorderStyle.ALL))
            {
                console.setCharForeground(x, y, borderCol);
                console.setChar(x, y, CharConstants.VERT_LINE);
            }

            if (y == top && (style == EBorderStyle.NORTH || style == EBorderStyle.ALL))
            {
                console.setCharForeground(x, y, borderCol);
                console.setChar(x, y, CharConstants.HORZ_LINE);
            }

            if (y == bottom - 1 && (style == EBorderStyle.SOUTH || style == EBorderStyle.ALL))
            {
                console.setCharForeground(x, y, borderCol);
                console.setChar(x, y, CharConstants.HORZ_LINE);
            }

            // Corner cases: char color has been set by the prev two cases: only if its all sides
            if (style == EBorderStyle.ALL)
            {
                if (x == left && y == top)
                {
                    console.setChar(x, y, CharConstants.NW_LINE);
                }
                if (x == right - 1 && y == top)
                {
                    console.setChar(x, y, CharConstants.NE_LINE);
                }
                if (x == left && y == bottom - 1)
                {
                    console.setChar(x, y, CharConstants.SW_LINE);
                }
                if (x == right - 1 && y == bottom - 1)
                {
                    console.setChar(x, y, CharConstants.SE_LINE);
                }
            }
        }
Example #11
0
 public WindowEnemyHealth(int x, int y, int w, int h, string title, EBorderStyle borderStyle, Entity player, HUD parent)
     : base(x, y, w, h, title, borderStyle, player, parent)
 {
     targetEnemy = null;
 }
Example #12
0
 public WindowPickupItem(int x, int y, int w, int h, string title, EBorderStyle borderStyle, Entity player, HUD parent)
     : base(x, y, w, h, title, borderStyle, player, parent)
 {
 }