1 /* DooM2D: Midnight on the Firing Line
2 * coded by Ketmar // Invisible Vector <ketmar@ketmar.no-ip.org>
3 * Understanding is not required. Only obedience.
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 module d2dhud is "engine" "hud";
26 import d2dplayer; // for some actor fields
29 const KeyFrameBase = 0;
34 public void initializeAnim () {
35 animClearFrames("engine", "hud", "sleep");
37 animAddFrame("engine", "hud", "sleep", ACTOR_DIR_LEFT, "sprites/items/keyra0.vga");
38 animAddFrame("engine", "hud", "sleep", ACTOR_DIR_LEFT, "sprites/items/keyga0.vga");
39 animAddFrame("engine", "hud", "sleep", ACTOR_DIR_LEFT, "sprites/items/keyba0.vga");
44 public void drawHud () {
45 auto pl = getPlayerActor(1);
46 //writeln("pl.classname: ", pl.classname);
47 if (pl.dead || !pl.isPlayer) return;
49 // WARNING: keep in sync with INV_ITEM_KEY_xxx
51 auto inv = pl.invitems;
52 for (int kn = 0; kn < 3; ++kn) {
56 case 0: spn = "sprites/items/keyra0.vga"; break;
57 case 1: spn = "sprites/items/keyga0.vga"; break;
58 case 2: spn = "sprites/items/keyba0.vga"; break;
59 default: continue; // just in case
61 drawSpriteAt(spn, 4+kn*(spriteWidth(spn)+1), viewportHeight/*-spriteHeight(spn)*/-4);
66 string spn = "sprites/items/keyra0.vga";
67 drawSpriteAt(spn, 4, viewportHeight-4);