diff options
| author | Japa Illo | 2012-03-15 12:53:19 +0100 |
|---|---|---|
| committer | Japa Illo | 2012-03-15 12:53:19 +0100 |
| commit | 1bd9b2a540e52795cd3a9fbc402a1ee9736e1b70 (patch) | |
| tree | 5a07fe3d331f690950327d0923e61bb78e3b7cc1 /GUI.cpp | |
| parent | 42de27ed582314bfb08fbf4ae61f6bdd8fb5fb8f (diff) | |
| download | stonesense-1bd9b2a540e52795cd3a9fbc402a1ee9736e1b70.tar.gz stonesense-1bd9b2a540e52795cd3a9fbc402a1ee9736e1b70.tar.bz2 stonesense-1bd9b2a540e52795cd3a9fbc402a1ee9736e1b70.tar.xz | |
Got dyes to be detected properly. Also made the equipment drawing far neater.
Removed zoom in smoothing. it just looks bad.
Signed-off-by: Japa Illo <japa.mala.illo@gmail.com>
Diffstat (limited to 'GUI.cpp')
| -rw-r--r-- | GUI.cpp | 119 |
1 files changed, 10 insertions, 109 deletions
@@ -498,123 +498,24 @@ 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));
}
}
}
|
