When items in the paper doll inventory subset (primary worn and wielded items) have known BUC state, indicate what that is. It now draws a one pixel wide white border around each doll tile, and if BUC is known, that border gets its color changed (red for known cursed, yellow for known uncursed, cyan for known blessed). That isn't very visual so the first pixel inside the tile is overwritten with the same color, and alternating pixels are also overwritten for the second rectangle within. The 2..3 pixel wide border is visible without cluttering the tile for 'normal' sized paper doll. The tiles are allowed to be scrunched down to as small as 6x6 so there won't be much left after 1 or 2 around the edge are replaced. Initially I was going to try to highlight welded items but the more general BUC highlighting is simpler and usually more useful to the player. The qt_map.* bits are just reformatting. I was looking at pet and pile annotations as a way to do BUC annotations but decided not to attempt that.
42 lines
964 B
C++
42 lines
964 B
C++
// Copyright (c) Warwick Allison, 1999.
|
|
// Qt4 conversion copyright (c) Ray Chason, 2012-2014.
|
|
// NetHack may be freely redistributed. See license for details.
|
|
|
|
// qt_glyph.h -- class to manage the glyphs in a tile set
|
|
|
|
#ifndef QT4GLYPH_H
|
|
#define QT4GLYPH_H
|
|
|
|
namespace nethack_qt_ {
|
|
|
|
enum border_code {
|
|
NO_BORDER, BORDER_DEFAULT,
|
|
BORDER_CURSED, BORDER_UNCURSED, BORDER_BLESSED
|
|
};
|
|
|
|
class NetHackQtGlyphs {
|
|
public:
|
|
NetHackQtGlyphs();
|
|
|
|
int width() const { return size.width(); }
|
|
int height() const { return size.height(); }
|
|
void toggleSize();
|
|
void setSize(int w, int h);
|
|
|
|
void drawGlyph(QPainter&, int glyph, int pixelx, int pixely);
|
|
void drawCell(QPainter&, int glyph, int cellx, int celly);
|
|
void drawBorderedCell(QPainter&, int glyph,
|
|
int cellx, int celly, int bordercode);
|
|
QPixmap glyph(int glyph);
|
|
|
|
private:
|
|
QImage img;
|
|
QPixmap pm,pm1, pm2;
|
|
QSize size;
|
|
int tiles_per_row;
|
|
};
|
|
|
|
} // namespace nethack_qt_
|
|
|
|
#endif
|