Tweak some proportions so that costs and info strings won't overlap in shops

This commit is contained in:
2015-02-05 22:54:37 -05:00
parent 7d67c0c85b
commit e1babdef66
3 changed files with 19 additions and 12 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.8 KiB

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@@ -139,8 +139,8 @@ void init_screen_locs() {
shopping_rects[0][SHOPRECT_ITEM_NAME].top += 4; shopping_rects[0][SHOPRECT_ITEM_NAME].top += 4;
shopping_rects[0][SHOPRECT_ITEM_NAME].left += 28; shopping_rects[0][SHOPRECT_ITEM_NAME].left += 28;
shopping_rects[0][SHOPRECT_ITEM_COST].top += 20; shopping_rects[0][SHOPRECT_ITEM_COST].top += 20;
// TODO: Might need to put this back to what it was (I was trying to make more room for alchemy info) shopping_rects[0][SHOPRECT_ITEM_COST].left += 154;
shopping_rects[0][SHOPRECT_ITEM_COST].left += 170;//154; shopping_rects[0][SHOPRECT_ITEM_COST].right -= 20;
shopping_rects[0][SHOPRECT_ITEM_EXTRA].top += 20; shopping_rects[0][SHOPRECT_ITEM_EXTRA].top += 20;
shopping_rects[0][SHOPRECT_ITEM_EXTRA].left += 34; shopping_rects[0][SHOPRECT_ITEM_EXTRA].left += 34;
shopping_rects[0][SHOPRECT_ITEM_HELP].top += 3; shopping_rects[0][SHOPRECT_ITEM_HELP].top += 3;

View File

@@ -792,8 +792,14 @@ void draw_shop_graphics(bool pressed,rectangle clip_area_rect) {
style.pointSize = 12; style.pointSize = 12;
style.lineHeight = 12; style.lineHeight = 12;
win_draw_string(talk_gworld,shopping_rects[i][SHOPRECT_ITEM_NAME],cur_name,eTextMode::WRAP,style); win_draw_string(talk_gworld,shopping_rects[i][SHOPRECT_ITEM_NAME],cur_name,eTextMode::WRAP,style);
cur_name = "Cost: " + std::to_string(cur_cost); cur_name = std::to_string(cur_cost);
win_draw_string(talk_gworld,shopping_rects[i][SHOPRECT_ITEM_COST],cur_name,eTextMode::WRAP,style); rectangle cost_rect = shopping_rects[i][SHOPRECT_ITEM_COST];
cost_rect.left = cost_rect.right - string_length(cur_name, style) - 10;
win_draw_string(talk_gworld,cost_rect,cur_name,eTextMode::WRAP,style);
cost_rect.left = cost_rect.right - 7;
cost_rect.top += 3;
cost_rect.height() = 7;
rect_draw_some_item(invenbtn_gworld, {0, 29, 7, 36}, talk_gworld, cost_rect, sf::BlendAlpha);
style.pointSize = 10; style.pointSize = 10;
win_draw_string(talk_gworld,shopping_rects[i][SHOPRECT_ITEM_EXTRA],cur_info_str,eTextMode::WRAP,style); win_draw_string(talk_gworld,shopping_rects[i][SHOPRECT_ITEM_EXTRA],cur_info_str,eTextMode::WRAP,style);
rect_draw_some_item(invenbtn_gworld,item_info_from,talk_gworld,shopping_rects[i][SHOPRECT_ITEM_HELP],pressed ? sf::BlendNone : sf::BlendAlpha); rect_draw_some_item(invenbtn_gworld,item_info_from,talk_gworld,shopping_rects[i][SHOPRECT_ITEM_HELP],pressed ? sf::BlendNone : sf::BlendAlpha);
@@ -886,8 +892,8 @@ std::string get_item_interesting_string(cItem item) {
case eItemType::BOLTS: case eItemType::BOLTS:
case eItemType::MISSILE_NO_AMMO: case eItemType::MISSILE_NO_AMMO:
if(item.bonus != 0) if(item.bonus != 0)
sout << "Damage: 1-" << item.item_level << " + " << item.bonus << '.'; sout << "Damage: 1-" << item.item_level << " + " << item.bonus;
else sout << "Damage: 1-" << item.item_level << '.'; else sout << "Damage: 1-" << item.item_level;
break; break;
case eItemType::SHIELD: case eItemType::SHIELD:
case eItemType::ARMOR: case eItemType::ARMOR:
@@ -895,31 +901,32 @@ std::string get_item_interesting_string(cItem item) {
case eItemType::GLOVES: case eItemType::GLOVES:
case eItemType::SHIELD_2: case eItemType::SHIELD_2:
case eItemType::BOOTS: // TODO: Verify that this is displayed correctly case eItemType::BOOTS: // TODO: Verify that this is displayed correctly
sout << "Blocks " << item.item_level + ((item.protection > 0) ? 1 : 0) << '-' << item.item_level + item.protection << " damage."; sout << "Blocks " << item.item_level + ((item.protection > 0) ? 1 : 0) << '-' << item.item_level + item.protection << " damage";
break; break;
case eItemType::BOW: case eItemType::BOW:
case eItemType::CROSSBOW: case eItemType::CROSSBOW:
sout << "Bonus: +" << item.bonus << " to hit."; sout << "Bonus: +" << item.bonus << " to hit";
break; break;
case eItemType::GOLD: case eItemType::GOLD:
sout << item.item_level << " gold pieces."; sout << item.item_level << " gold pieces";
break; break;
case eItemType::SPECIAL: case eItemType::SPECIAL:
sout << "Special"; sout << "Special";
break; break;
case eItemType::FOOD: case eItemType::FOOD:
sout << item.item_level << " food."; sout << item.item_level << " food";
break; break;
case eItemType::WEAPON_POISON: case eItemType::WEAPON_POISON:
sout << "Poison: Does " << item.item_level << '-' << item.item_level * 6 << " damage."; sout << "Poison: " << item.item_level << '-' << item.item_level * 6 << " damage";
break; break;
default: default:
if(item.charges > 0) if(item.charges > 0)
sout << "Uses: " << item.charges; sout << "Uses: " << item.charges << '.';
return sout.str(); return sout.str();
} }
if(item.charges > 0) if(item.charges > 0)
sout << "; Uses: " << item.charges; sout << "; Uses: " << item.charges;
sout << '.';
return sout.str(); return sout.str();
} }