Exemplo n.º 1
0
 private void DrawMultIcon(MultIconWidget mi, int value)
 {
     screen.DrawPatch(
         mi.Patches[value],
         scale * mi.X,
         scale * mi.Y,
         scale);
 }
Exemplo n.º 2
0
 private void DrawMultIcon(MultIconWidget mi, int num)
 {
     screen.DrawPatch(
         mi.Patches[num],
         scale * mi.X,
         scale * mi.Y,
         scale);
 }
Exemplo n.º 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;
        }
Exemplo n.º 4
0
        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;
        }