Exemple #1
0
        private void DrawPercent(PercentWidget per, int value)
        {
            screen.DrawPatch(
                per.Patch,
                scale * per.NumberWidget.X,
                scale * per.NumberWidget.Y,
                scale);

            DrawNumber(per.NumberWidget, value);
        }
Exemple #2
0
        public StatusBarRenderer(DrawScreen screen)
        {
            this.screen = screen;

            this.patches = new Patches();

            this.scale = screen.Width / 320;

            this.ready         = new NumberWidget();
            this.ready.Patches = this.patches.TallNumbers;
            this.ready.Width   = StatusBarRenderer.ammoWidth;
            this.ready.X       = StatusBarRenderer.ammoX;
            this.ready.Y       = StatusBarRenderer.ammoY;

            this.health = new PercentWidget();
            this.health.NumberWidget.Patches = this.patches.TallNumbers;
            this.health.NumberWidget.Width   = 3;
            this.health.NumberWidget.X       = StatusBarRenderer.healthX;
            this.health.NumberWidget.Y       = StatusBarRenderer.healthY;
            this.health.Patch = this.patches.TallPercent;

            this.armor = new PercentWidget();
            this.armor.NumberWidget.Patches = this.patches.TallNumbers;
            this.armor.NumberWidget.Width   = 3;
            this.armor.NumberWidget.X       = StatusBarRenderer.armorX;
            this.armor.NumberWidget.Y       = StatusBarRenderer.armorY;
            this.armor.Patch = this.patches.TallPercent;

            this.ammo            = new NumberWidget[4];
            this.ammo[0]         = new NumberWidget();
            this.ammo[0].Patches = this.patches.ShortNumbers;
            this.ammo[0].Width   = StatusBarRenderer.ammo0Width;
            this.ammo[0].X       = StatusBarRenderer.ammo0X;
            this.ammo[0].Y       = StatusBarRenderer.ammo0Y;
            this.ammo[1]         = new NumberWidget();
            this.ammo[1].Patches = this.patches.ShortNumbers;
            this.ammo[1].Width   = StatusBarRenderer.ammo1Width;
            this.ammo[1].X       = StatusBarRenderer.ammo1X;
            this.ammo[1].Y       = StatusBarRenderer.ammo1Y;
            this.ammo[2]         = new NumberWidget();
            this.ammo[2].Patches = this.patches.ShortNumbers;
            this.ammo[2].Width   = StatusBarRenderer.ammo2Width;
            this.ammo[2].X       = StatusBarRenderer.ammo2X;
            this.ammo[2].Y       = StatusBarRenderer.ammo2Y;
            this.ammo[3]         = new NumberWidget();
            this.ammo[3].Patches = this.patches.ShortNumbers;
            this.ammo[3].Width   = StatusBarRenderer.ammo3Wdth;
            this.ammo[3].X       = StatusBarRenderer.ammo3X;
            this.ammo[3].Y       = StatusBarRenderer.ammo3Y;

            this.maxAmmo            = new NumberWidget[4];
            this.maxAmmo[0]         = new NumberWidget();
            this.maxAmmo[0].Patches = this.patches.ShortNumbers;
            this.maxAmmo[0].Width   = StatusBarRenderer.maxAmmo0Width;
            this.maxAmmo[0].X       = StatusBarRenderer.maxAmmo0X;
            this.maxAmmo[0].Y       = StatusBarRenderer.maxAmmo0Y;
            this.maxAmmo[1]         = new NumberWidget();
            this.maxAmmo[1].Patches = this.patches.ShortNumbers;
            this.maxAmmo[1].Width   = StatusBarRenderer.maxAmmo1Width;
            this.maxAmmo[1].X       = StatusBarRenderer.maxAmmo1X;
            this.maxAmmo[1].Y       = StatusBarRenderer.maxAmmo1Y;
            this.maxAmmo[2]         = new NumberWidget();
            this.maxAmmo[2].Patches = this.patches.ShortNumbers;
            this.maxAmmo[2].Width   = StatusBarRenderer.maxAmmo2Width;
            this.maxAmmo[2].X       = StatusBarRenderer.maxAmmo2X;
            this.maxAmmo[2].Y       = StatusBarRenderer.maxAmmo2Y;
            this.maxAmmo[3]         = new NumberWidget();
            this.maxAmmo[3].Patches = this.patches.ShortNumbers;
            this.maxAmmo[3].Width   = StatusBarRenderer.maxAmmo3Width;
            this.maxAmmo[3].X       = StatusBarRenderer.maxAmmo3X;
            this.maxAmmo[3].Y       = StatusBarRenderer.maxAmmo3Y;

            this.weapons = new MultIconWidget[6];

            for (var i = 0; i < this.weapons.Length; i++)
            {
                this.weapons[i]         = new MultIconWidget();
                this.weapons[i].X       = StatusBarRenderer.armsX + (i % 3) * StatusBarRenderer.armsSpaceX;
                this.weapons[i].Y       = StatusBarRenderer.armsY + (i / 3) * StatusBarRenderer.armsSpaceY;
                this.weapons[i].Patches = this.patches.Arms[i];
            }

            this.frags         = new NumberWidget();
            this.frags.Patches = this.patches.TallNumbers;
            this.frags.Width   = StatusBarRenderer.fragsWidth;
            this.frags.X       = StatusBarRenderer.fragsX;
            this.frags.Y       = StatusBarRenderer.fragsY;

            this.keys            = new MultIconWidget[3];
            this.keys[0]         = new MultIconWidget();
            this.keys[0].X       = StatusBarRenderer.key0X;
            this.keys[0].Y       = StatusBarRenderer.key0Y;
            this.keys[0].Patches = this.patches.Keys;
            this.keys[1]         = new MultIconWidget();
            this.keys[1].X       = StatusBarRenderer.key1X;
            this.keys[1].Y       = StatusBarRenderer.key1Y;
            this.keys[1].Patches = this.patches.Keys;
            this.keys[2]         = new MultIconWidget();
            this.keys[2].X       = StatusBarRenderer.key2X;
            this.keys[2].Y       = StatusBarRenderer.key2Y;
            this.keys[2].Patches = this.patches.Keys;
        }
Exemple #3
0
        public StatusBarRenderer(Wad wad, DrawScreen screen)
        {
            this.screen = screen;

            patches = new Patches(wad);

            scale = screen.Width / 320;

            ready         = new NumberWidget();
            ready.Patches = patches.TallNumbers;
            ready.Width   = ammoWidth;
            ready.X       = ammoX;
            ready.Y       = ammoY;

            health = new PercentWidget();
            health.NumberWidget.Patches = patches.TallNumbers;
            health.NumberWidget.Width   = 3;
            health.NumberWidget.X       = healthX;
            health.NumberWidget.Y       = healthY;
            health.Patch = patches.TallPercent;

            armor = new PercentWidget();
            armor.NumberWidget.Patches = patches.TallNumbers;
            armor.NumberWidget.Width   = 3;
            armor.NumberWidget.X       = armorX;
            armor.NumberWidget.Y       = armorY;
            armor.Patch = patches.TallPercent;

            ammo            = new NumberWidget[(int)AmmoType.Count];
            ammo[0]         = new NumberWidget();
            ammo[0].Patches = patches.ShortNumbers;
            ammo[0].Width   = ammo0Width;
            ammo[0].X       = ammo0X;
            ammo[0].Y       = ammo0Y;
            ammo[1]         = new NumberWidget();
            ammo[1].Patches = patches.ShortNumbers;
            ammo[1].Width   = ammo1Width;
            ammo[1].X       = ammo1X;
            ammo[1].Y       = ammo1Y;
            ammo[2]         = new NumberWidget();
            ammo[2].Patches = patches.ShortNumbers;
            ammo[2].Width   = ammo2Width;
            ammo[2].X       = ammo2X;
            ammo[2].Y       = ammo2Y;
            ammo[3]         = new NumberWidget();
            ammo[3].Patches = patches.ShortNumbers;
            ammo[3].Width   = ammo3Wdth;
            ammo[3].X       = ammo3X;
            ammo[3].Y       = ammo3Y;

            maxAmmo            = new NumberWidget[(int)AmmoType.Count];
            maxAmmo[0]         = new NumberWidget();
            maxAmmo[0].Patches = patches.ShortNumbers;
            maxAmmo[0].Width   = maxAmmo0Width;
            maxAmmo[0].X       = maxAmmo0X;
            maxAmmo[0].Y       = maxAmmo0Y;
            maxAmmo[1]         = new NumberWidget();
            maxAmmo[1].Patches = patches.ShortNumbers;
            maxAmmo[1].Width   = maxAmmo1Width;
            maxAmmo[1].X       = maxAmmo1X;
            maxAmmo[1].Y       = maxAmmo1Y;
            maxAmmo[2]         = new NumberWidget();
            maxAmmo[2].Patches = patches.ShortNumbers;
            maxAmmo[2].Width   = maxAmmo2Width;
            maxAmmo[2].X       = maxAmmo2X;
            maxAmmo[2].Y       = maxAmmo2Y;
            maxAmmo[3]         = new NumberWidget();
            maxAmmo[3].Patches = patches.ShortNumbers;
            maxAmmo[3].Width   = maxAmmo3Width;
            maxAmmo[3].X       = maxAmmo3X;
            maxAmmo[3].Y       = maxAmmo3Y;

            weapons = new MultIconWidget[6];
            for (var i = 0; i < weapons.Length; i++)
            {
                weapons[i]         = new MultIconWidget();
                weapons[i].X       = armsX + (i % 3) * armsSpaceX;
                weapons[i].Y       = armsY + (i / 3) * armsSpaceY;
                weapons[i].Patches = patches.Arms[i];
            }

            frags         = new NumberWidget();
            frags.Patches = patches.TallNumbers;
            frags.Width   = fragsWidth;
            frags.X       = fragsX;
            frags.Y       = fragsY;

            keys            = new MultIconWidget[3];
            keys[0]         = new MultIconWidget();
            keys[0].X       = key0X;
            keys[0].Y       = key0Y;
            keys[0].Patches = patches.Keys;
            keys[1]         = new MultIconWidget();
            keys[1].X       = key1X;
            keys[1].Y       = key1Y;
            keys[1].Patches = patches.Keys;
            keys[2]         = new MultIconWidget();
            keys[2].X       = key2X;
            keys[2].Y       = key2Y;
            keys[2].Patches = patches.Keys;
        }
        public StatusBarRenderer(Wad wad, DrawScreen screen)
        {
            this.screen = screen;

            patches = new Patches(wad);

            scale = screen.Width / 320;

            wReady         = new NumberWidget();
            wReady.Patches = patches.TallNumbers;
            wReady.Width   = ST_AMMOWIDTH;
            wReady.X       = ST_AMMOX;
            wReady.Y       = ST_AMMOY;

            wHealth = new PercentWidget();
            wHealth.NumberWidget.Patches = patches.TallNumbers;
            wHealth.NumberWidget.Width   = 3;
            wHealth.NumberWidget.X       = ST_HEALTHX;
            wHealth.NumberWidget.Y       = ST_HEALTHY;
            wHealth.Patch = patches.TallPercent;

            wArmor = new PercentWidget();
            wArmor.NumberWidget.Patches = patches.TallNumbers;
            wArmor.NumberWidget.Width   = 3;
            wArmor.NumberWidget.X       = ST_ARMORX;
            wArmor.NumberWidget.Y       = ST_ARMORY;
            wArmor.Patch = patches.TallPercent;

            wAmmo    = new NumberWidget[(int)AmmoType.Count];
            wMaxAmmo = new NumberWidget[(int)AmmoType.Count];

            wAmmo[0]         = new NumberWidget();
            wAmmo[0].Patches = patches.ShortNumbers;
            wAmmo[0].Width   = ST_AMMO0WIDTH;
            wAmmo[0].X       = ST_AMMO0X;
            wAmmo[0].Y       = ST_AMMO0Y;

            wAmmo[1]         = new NumberWidget();
            wAmmo[1].Patches = patches.ShortNumbers;
            wAmmo[1].Width   = ST_AMMO1WIDTH;
            wAmmo[1].X       = ST_AMMO1X;
            wAmmo[1].Y       = ST_AMMO1Y;

            wAmmo[2]         = new NumberWidget();
            wAmmo[2].Patches = patches.ShortNumbers;
            wAmmo[2].Width   = ST_AMMO2WIDTH;
            wAmmo[2].X       = ST_AMMO2X;
            wAmmo[2].Y       = ST_AMMO2Y;

            wAmmo[3]         = new NumberWidget();
            wAmmo[3].Patches = patches.ShortNumbers;
            wAmmo[3].Width   = ST_AMMO3WIDTH;
            wAmmo[3].X       = ST_AMMO3X;
            wAmmo[3].Y       = ST_AMMO3Y;

            wMaxAmmo[0]         = new NumberWidget();
            wMaxAmmo[0].Patches = patches.ShortNumbers;
            wMaxAmmo[0].Width   = ST_MAXAMMO0WIDTH;
            wMaxAmmo[0].X       = ST_MAXAMMO0X;
            wMaxAmmo[0].Y       = ST_MAXAMMO0Y;

            wMaxAmmo[1]         = new NumberWidget();
            wMaxAmmo[1].Patches = patches.ShortNumbers;
            wMaxAmmo[1].Width   = ST_MAXAMMO1WIDTH;
            wMaxAmmo[1].X       = ST_MAXAMMO1X;
            wMaxAmmo[1].Y       = ST_MAXAMMO1Y;

            wMaxAmmo[2]         = new NumberWidget();
            wMaxAmmo[2].Patches = patches.ShortNumbers;
            wMaxAmmo[2].Width   = ST_MAXAMMO2WIDTH;
            wMaxAmmo[2].X       = ST_MAXAMMO2X;
            wMaxAmmo[2].Y       = ST_MAXAMMO2Y;

            wMaxAmmo[3]         = new NumberWidget();
            wMaxAmmo[3].Patches = patches.ShortNumbers;
            wMaxAmmo[3].Width   = ST_MAXAMMO3WIDTH;
            wMaxAmmo[3].X       = ST_MAXAMMO3X;
            wMaxAmmo[3].Y       = ST_MAXAMMO3Y;

            // weapons owned
            wArms = new MultIconWidget[6];
            for (var i = 0; i < wArms.Length; i++)
            {
                wArms[i]         = new MultIconWidget();
                wArms[i].X       = ST_ARMSX + (i % 3) * ST_ARMSXSPACE;
                wArms[i].Y       = ST_ARMSY + (i / 3) * ST_ARMSYSPACE;
                wArms[i].Patches = patches.Arms[i];
            }

            wFrags         = new NumberWidget();
            wFrags.Patches = patches.TallNumbers;
            wFrags.Width   = ST_FRAGSWIDTH;
            wFrags.X       = ST_FRAGSX;
            wFrags.Y       = ST_FRAGSY;
        }