Fix spellcasting and dynamic menus

- Spell targeting line and array draws nicely, though not the same as the original
- Fix targeting falsely complaining about being off the edge of town
- Monster info dialog works properly; attacks now display correctly
- Fix dialogs always showing the wrong terrain or monster graphic
- Spell menus, monster menus, and PC editor item menus all work
- Spellcasting dialog now chooses the correct spell
- Fix out-of-place LED in spellcasting dialog
This commit is contained in:
2014-04-22 02:06:31 -04:00
parent d90a006e43
commit a4430cdf5a
15 changed files with 71 additions and 100 deletions

View File

@@ -882,9 +882,24 @@ public:
// TODO: Additional functions?
};
void draw_line(sf::RenderTarget& target, location from, location to, int thickness, sf::Color colour, sf::BlendMode mode) {
sf::VertexArray line(sf::LinesStrip, 2);
line[0].position = from;
line[0].color = colour;
line[1].position = to;
line[1].color = colour;
setActiveRenderTarget(target);
float saveThickness;
glGetFloatv(GL_LINE_WIDTH, &saveThickness);
glLineWidth(thickness);
target.draw(line, mode);
glLineWidth(saveThickness);
}
static void fill_shape(sf::RenderTarget& target, sf::Shape& shape, int x, int y, sf::Color colour) {
shape.setPosition(x, y);
shape.setFillColor(colour);
setActiveRenderTarget(target);
target.draw(shape);
}