summaryrefslogtreecommitdiff
path: root/GUI.cpp
diff options
context:
space:
mode:
authorCaldfir2012-03-16 02:38:22 -0700
committerCaldfir2012-03-16 02:38:22 -0700
commit0539996f01e34b9238d6d14ddb164c12037bd775 (patch)
treed050db94dcfdf2d13ec937d7df77490ffc3f296e /GUI.cpp
parent89b6ecb6d01f92f0df2ea23ef6a9fff796167f07 (diff)
downloadstonesense-0539996f01e34b9238d6d14ddb164c12037bd775.tar.gz
stonesense-0539996f01e34b9238d6d14ddb164c12037bd775.tar.bz2
stonesense-0539996f01e34b9238d6d14ddb164c12037bd775.tar.xz
Fixed a careless versioning issue and cleaned up how status icons/profession icons/creature names interact.
Diffstat (limited to 'GUI.cpp')
-rw-r--r--GUI.cpp123
1 files changed, 12 insertions, 111 deletions
diff --git a/GUI.cpp b/GUI.cpp
index 01a622a..83fd333 100644
--- a/GUI.cpp
+++ b/GUI.cpp
@@ -1,4 +1,4 @@
-#include <assert.h>
+#include <assert.h>
#include <vector>
using namespace std;
@@ -499,127 +499,28 @@ void drawDebugCursorAndInfo(WorldSegment * segment)
//Inventories!
if(b->inv)
{
- if(!b->inv->Weapons.empty())
+ for(int item_type_idex = 0; item_type_idex < b->inv->item.size(); item_type_idex++)
{
+ if(b->inv->item[item_type_idex].empty())
+ continue;
draw_textf_border(font, al_map_rgb(255,255,255), 2, (i++*al_get_font_line_height(font)), 0,
- "Weapons:");
- for(int ind = 0; ind < b->inv->Weapons.size(); ind++)
+ "%s:", ENUM_KEY_STR(item_type, (item_type::item_type)item_type_idex));
+ for(int ind = 0; ind < b->inv->item[item_type_idex].size(); ind++)
{
- if(b->inv->Weapons[ind].matt.type < 0)
+ if(b->inv->item[item_type_idex][ind].empty())
continue;
- MaterialInfo mat;
- mat.decode(b->inv->Weapons[ind].matt.type,b->inv->Weapons[ind].matt.index);
- draw_textf_border(font, al_map_rgb(255,255,255), 2, (i++*al_get_font_line_height(font)), 0,
- " %s - %s/%s",
- mat.getToken().c_str(),
- ENUM_KEY_STR(item_type, item_type::WEAPON),
- get_item_subtype(item_type::WEAPON,ind));
- }
- }
- if(!b->inv->Armor.empty())
- {
- draw_textf_border(font, al_map_rgb(255,255,255), 2, (i++*al_get_font_line_height(font)), 0,
- "Armor:");
- for(int ind = 0; ind < b->inv->Armor.size(); ind++)
- {
- if(b->inv->Armor[ind].matt.type < 0)
- continue;
- MaterialInfo mat;
- mat.decode(b->inv->Armor[ind].matt.type,b->inv->Armor[ind].matt.index);
- draw_textf_border(font, al_map_rgb(255,255,255), 2, (i++*al_get_font_line_height(font)), 0,
- " %s - %s/%s",
- mat.getToken().c_str(),
- ENUM_KEY_STR(item_type, item_type::ARMOR),
- get_item_subtype(item_type::ARMOR,ind));
- }
- }
- if(!b->inv->Shoes.empty())
- {
- draw_textf_border(font, al_map_rgb(255,255,255), 2, (i++*al_get_font_line_height(font)), 0,
- "Shoes:");
- for(int ind = 0; ind < b->inv->Shoes.size(); ind++)
- {
- if(b->inv->Shoes[ind].matt.type < 0)
- continue;
- MaterialInfo mat;
- mat.decode(b->inv->Shoes[ind].matt.type,b->inv->Shoes[ind].matt.index);
- draw_textf_border(font, al_map_rgb(255,255,255), 2, (i++*al_get_font_line_height(font)), 0,
- " %s - %s/%s",
- mat.getToken().c_str(),
- ENUM_KEY_STR(item_type, item_type::SHOES),
- get_item_subtype(item_type::SHOES,ind));
- }
- }
- if(!b->inv->Shield.empty())
- {
- draw_textf_border(font, al_map_rgb(255,255,255), 2, (i++*al_get_font_line_height(font)), 0,
- "Shield:");
- for(int ind = 0; ind < b->inv->Shield.size(); ind++)
- {
- if(b->inv->Shield[ind].matt.type < 0)
- continue;
- MaterialInfo mat;
- mat.decode(b->inv->Shield[ind].matt.type,b->inv->Shield[ind].matt.index);
- draw_textf_border(font, al_map_rgb(255,255,255), 2, (i++*al_get_font_line_height(font)), 0,
- " %s - %s/%s",
- mat.getToken().c_str(),
- ENUM_KEY_STR(item_type, item_type::SHIELD),
- get_item_subtype(item_type::SHIELD,ind));
- }
- }
- if(!b->inv->Helm.empty())
- {
- draw_textf_border(font, al_map_rgb(255,255,255), 2, (i++*al_get_font_line_height(font)), 0,
- "Headwear:");
- for(int ind = 0; ind < b->inv->Helm.size(); ind++)
- {
- if(b->inv->Helm[ind].matt.type < 0)
- continue;
- MaterialInfo mat;
- mat.decode(b->inv->Helm[ind].matt.type,b->inv->Helm[ind].matt.index);
- draw_textf_border(font, al_map_rgb(255,255,255), 2, (i++*al_get_font_line_height(font)), 0,
- " %s - %s/%s",
- mat.getToken().c_str(),
- ENUM_KEY_STR(item_type, item_type::HELM),
- get_item_subtype(item_type::HELM,ind));
- }
- }
- if(!b->inv->Gloves.empty())
- {
- draw_textf_border(font, al_map_rgb(255,255,255), 2, (i++*al_get_font_line_height(font)), 0,
- "Gloves:");
- for(int ind = 0; ind < b->inv->Gloves.size(); ind++)
- {
- if(b->inv->Gloves[ind].matt.type < 0)
- continue;
- MaterialInfo mat;
- mat.decode(b->inv->Gloves[ind].matt.type,b->inv->Gloves[ind].matt.index);
- draw_textf_border(font, al_map_rgb(255,255,255), 2, (i++*al_get_font_line_height(font)), 0,
- " %s - %s/%s",
- mat.getToken().c_str(),
- ENUM_KEY_STR(item_type, item_type::GLOVES),
- get_item_subtype(item_type::GLOVES,ind));
- }
- }
- if(!b->inv->Pants.empty())
- {
- draw_textf_border(font, al_map_rgb(255,255,255), 2, (i++*al_get_font_line_height(font)), 0,
- "Pants:");
- for(int ind = 0; ind < b->inv->Pants.size(); ind++)
- {
- if(b->inv->Pants[ind].matt.type < 0)
+ if(b->inv->item[item_type_idex][ind][0].matt.type < 0)
continue;
MaterialInfo mat;
- mat.decode(b->inv->Pants[ind].matt.type,b->inv->Pants[ind].matt.index);
+ mat.decode(b->inv->item[item_type_idex][ind][0].matt.type,b->inv->item[item_type_idex][ind][0].matt.index);
draw_textf_border(font, al_map_rgb(255,255,255), 2, (i++*al_get_font_line_height(font)), 0,
- " %s - %s/%s",
+ " %s - %s",
mat.getToken().c_str(),
- ENUM_KEY_STR(item_type, item_type::PANTS),
- get_item_subtype(item_type::PANTS,ind));
+ get_item_subtype((item_type::item_type)item_type_idex,ind));
}
}
}
- if(1) //just so it has it's own scope
+ //just so it has it's own scope
{
char strCreature[150] = {0};
generateCreatureDebugString( b->creature, strCreature );