diff --git a/src/boe.actions.cpp b/src/boe.actions.cpp index f0bacf7f..bde25def 100644 --- a/src/boe.actions.cpp +++ b/src/boe.actions.cpp @@ -214,6 +214,7 @@ void init_screen_locs() { item_buttons[0][ITEMBTN_SPEC] = item_buttons[0][ITEMBTN_NAME]; item_buttons[0][ITEMBTN_SPEC].left = 173; item_buttons[0][ITEMBTN_SPEC].right = 232; + item_buttons[0][ITEMBTN_NAME].top += 3; for(i = 1; i < 8; i++) for(j = 0; j < 6; j++) { item_buttons[i][j] = item_buttons[0][j]; @@ -250,6 +251,7 @@ void init_screen_locs() { pc_buttons[0][PCBTN_TRADE] = pc_buttons[0][PCBTN_NAME]; pc_buttons[0][PCBTN_TRADE].left = 253; pc_buttons[0][PCBTN_TRADE].right = 262; + pc_buttons[0][PCBTN_NAME].top += 3; for(i = 1; i < 6; i++) for(j = 0; j < 5; j++) { pc_buttons[i][j] = pc_buttons[0][j]; diff --git a/src/boe.consts.hpp b/src/boe.consts.hpp index 4b573213..02e2cdd9 100644 --- a/src/boe.consts.hpp +++ b/src/boe.consts.hpp @@ -186,6 +186,8 @@ enum eTrapType { #define ITEMBTN_DROP 3 #define ITEMBTN_INFO 4 #define ITEMBTN_SPEC 5 // Sell, Identify, or Enchant +#define ITEMBTN_ALL 10 // use, give, drop, info +#define ITEMBTN_NORM 11 // give, drop, info // PC button rects #define PCBTN_NAME 0 diff --git a/src/boe.graphics.cpp b/src/boe.graphics.cpp index ba08e0b0..d6ff7715 100644 --- a/src/boe.graphics.cpp +++ b/src/boe.graphics.cpp @@ -431,7 +431,7 @@ void draw_startup_stats() { pc_rect = startup_from[0]; pc_rect.offset(5,5); pc_rect.top = pc_rect.bottom - 25; - pc_rect.left = pc_rect.right - 300; + pc_rect.left = pc_rect.right - 270; // TODO: Should replace this with a more appropriate copyright string // Windows replaced it with "That is not dead which can eternally lie..." - I don't think that's quite appropriate though. win_draw_string(mainPtr,pc_rect,"Copyright 1997, All Rights Reserved, v" + oboeVersionString(),eTextMode::WRAP,style,ul); @@ -460,15 +460,13 @@ void draw_start_button(short which_position,short which_button) { style.pointSize = 24; to_rect = startup_button[which_position]; //to_rect.left += 80; - to_rect.offset(10, 10); + to_rect.offset(10, 5); if(which_button == 5) which_button = 4; // In the 0..65535 range, this was 14472 + (12288 * which_button) base_color.b += (48 * which_button); style.colour = base_color; style.lineHeight = 18; - if(which_position == 3) - to_rect.offset(-7,0); win_draw_string(mainPtr,to_rect,button_labels[which_position],eTextMode::CENTRE,style,ul); } @@ -728,11 +726,12 @@ void put_text_bar(std::string str) { style.pointSize = 12; style.lineHeight = 12; rectangle to_rect = rectangle(text_bar_gworld); - to_rect.top += 5; - // TODO: Not sure what the line height should be, so I just picked something + to_rect.top += 7; + to_rect.left += 5; win_draw_string(text_bar_gworld, to_rect, str, eTextMode::LEFT_TOP, style); if(!monsters_going) { + to_rect.top -= 2; to_rect.left = to_rect.right - 15; to_rect.width() = 12; to_rect.height() = 12; diff --git a/src/boe.text.cpp b/src/boe.text.cpp index f370bb7d..191a8028 100644 --- a/src/boe.text.cpp +++ b/src/boe.text.cpp @@ -88,7 +88,7 @@ void put_pc_screen() { short i = 0,j; rectangle erase_rect = {17,2,98,269},to_draw_rect,from_rect; // TODO: The duplication of rectangle here shouldn't be necessary... - rectangle small_erase_rects[3] = {rectangle{101,34,114,76},rectangle{101,106,114,147},rectangle{101,174,114,201}}; + rectangle small_erase_rects[3] = {rectangle{103,34,114,76},rectangle{103,106,114,147},rectangle{103,174,114,201}}; rectangle bottom_bar_rect = {99,0,116,271}; rectangle info_from = {0,1,12,13}; @@ -121,11 +121,11 @@ void put_pc_screen() { std::ostringstream sout; sout << i + 1 << ". " << univ.party[i].name; - win_draw_string(pc_stats_gworld,pc_buttons[i][0],sout.str(),eTextMode::WRAP,style); + win_draw_string(pc_stats_gworld,pc_buttons[i][PCBTN_NAME],sout.str(),eTextMode::WRAP,style); style.italic = false; style.colour = sf::Color::Black; - to_draw_rect = pc_buttons[i][1]; + to_draw_rect = pc_buttons[i][PCBTN_HP]; to_draw_rect.right += 20; sout.str(""); switch(univ.party[i].main_status) { @@ -135,13 +135,13 @@ void put_pc_screen() { else if(univ.party[i].cur_health > univ.party[i].max_health) style.colour = {0xff,0x80,0}; // Orange else style.colour = sf::Color::Red; - win_draw_string( pc_stats_gworld,pc_buttons[i][1],std::to_string(univ.party[i].cur_health),eTextMode::WRAP,style); + win_draw_string( pc_stats_gworld,pc_buttons[i][PCBTN_HP],std::to_string(univ.party[i].cur_health),eTextMode::WRAP,style); if(univ.party[i].cur_sp == univ.party[i].max_sp) style.colour = sf::Color::Blue; else if(univ.party[i].cur_sp > univ.party[i].max_sp) style.colour = {0,0xff,0x80}; // Teal else style.colour = sf::Color::Magenta; - win_draw_string( pc_stats_gworld,pc_buttons[i][2],std::to_string(univ.party[i].cur_sp),eTextMode::WRAP,style); + win_draw_string( pc_stats_gworld,pc_buttons[i][PCBTN_SP],std::to_string(univ.party[i].cur_sp),eTextMode::WRAP,style); draw_pc_effects(i); break; case eMainStatus::DEAD: @@ -174,8 +174,8 @@ void put_pc_screen() { //rect_draw_some_item(mixed_gworld,info_from,pc_stats_gworld,pc_buttons[i][3],1,0); //rect_draw_some_item(mixed_gworld,switch_from,pc_stats_gworld,pc_buttons[i][4],1,0); // do faster! - to_draw_rect = pc_buttons[i][3]; - to_draw_rect.right = pc_buttons[i][4].right + 1; + to_draw_rect = pc_buttons[i][PCBTN_INFO]; + to_draw_rect.right = pc_buttons[i][PCBTN_TRADE].right + 1; from_rect = info_from; from_rect.right = from_rect.left + to_draw_rect.right - to_draw_rect.left; rect_draw_some_item(invenbtn_gworld,from_rect,pc_stats_gworld,to_draw_rect,sf::BlendAlpha); @@ -220,7 +220,10 @@ void put_item_screen(short screen_num,short suppress_buttons) { if(suppress_buttons == 0) for(i = 0; i < 6; i++) tileImage(item_stats_gworld, item_screen_button_rects[i],bg[7]); - tileImage(item_stats_gworld, upper_frame_rect,bg[7]); + erase_rect = upper_frame_rect; + erase_rect.top = 0; + erase_rect.left = 0; + tileImage(item_stats_gworld, erase_rect,bg[7]); // Draw buttons at bottom if(suppress_buttons == 0) { @@ -236,16 +239,16 @@ void put_item_screen(short screen_num,short suppress_buttons) { TextStyle style; style.lineHeight = 10; + style.font = FONT_BOLD; + style.colour = sf::Color::Yellow; switch(screen_num) { case ITEM_WIN_SPECIAL: - style.font = FONT_BOLD; - style.colour = sf::Color::White; win_draw_string(item_stats_gworld,upper_frame_rect,"Special items:",eTextMode::WRAP,style); style.colour = sf::Color::Black; for(i = 0; i < 8; i++) { i_num = i + item_offset; if(i_num < spec_item_array.size()) { - win_draw_string(item_stats_gworld,item_buttons[i][0],univ.scenario.special_items[spec_item_array[i_num]].name,eTextMode::WRAP,style); + win_draw_string(item_stats_gworld,item_buttons[i][ITEMBTN_NAME],univ.scenario.special_items[spec_item_array[i_num]].name,eTextMode::WRAP,style); place_item_button(3,i,4,0); if((univ.scenario.special_items[spec_item_array[i_num]].flags % 10 == 1) @@ -255,8 +258,6 @@ void put_item_screen(short screen_num,short suppress_buttons) { } break; case ITEM_WIN_QUESTS: - style.font = FONT_BOLD; - style.colour = sf::Color::White; win_draw_string(item_stats_gworld,upper_frame_rect,"Quests/Jobs:",eTextMode::WRAP,style); style.colour = sf::Color::Black; for(i = 0; i < 8; i++) { @@ -266,12 +267,12 @@ void put_item_screen(short screen_num,short suppress_buttons) { if(spec_item_array[i_num] / 10000 == 2) style.colour = sf::Color::Red; - win_draw_string(item_stats_gworld,item_buttons[i][0],univ.scenario.quests[which_quest].name,eTextMode::WRAP,style); + win_draw_string(item_stats_gworld,item_buttons[i][ITEMBTN_NAME],univ.scenario.quests[which_quest].name,eTextMode::WRAP,style); if(spec_item_array[i_num] / 10000 == 1) { location from, to; - from = to = item_buttons[i][0].centre(); - from.x = item_buttons[i][0].left; + from = to = item_buttons[i][ITEMBTN_NAME].centre(); + from.x = item_buttons[i][ITEMBTN_NAME].left; to.x = from.x + string_length(univ.scenario.quests[which_quest].name, style); draw_line(item_stats_gworld, from, to, 1, sf::Color::Green); } @@ -283,22 +284,20 @@ void put_item_screen(short screen_num,short suppress_buttons) { default: // on an items page pc = screen_num; - style.colour = sf::Color::White; - style.font = FONT_PLAIN; sout.str("");; sout << univ.party[pc].name << " inventory:", win_draw_string(item_stats_gworld,upper_frame_rect,sout.str(),eTextMode::WRAP,style); style.colour = sf::Color::Black; - style.font = FONT_BOLD; for(i = 0; i < 8; i++) { i_num = i + item_offset; sout.str(""); sout << i_num + 1 << '.'; - win_draw_string(item_stats_gworld,item_buttons[i][0],sout.str(),eTextMode::WRAP,style); + win_draw_string(item_stats_gworld,item_buttons[i][ITEMBTN_NAME],sout.str(),eTextMode::WRAP,style); - dest_rect = item_buttons[i][0]; + dest_rect = item_buttons[i][ITEMBTN_NAME]; dest_rect.left += 36; + dest_rect.top -= 2; if(univ.party[pc].items[i_num].variety == eItemType::NO_ITEM) { @@ -335,8 +334,8 @@ void put_item_screen(short screen_num,short suppress_buttons) { ((is_town()) || (is_out()) || ((is_combat()) && (pc == current_pc)))) { // place give and drop and use place_item_button(0,i,0,univ.party[pc].items[i_num].graphic_num); // item_graphic if(abil_chart[univ.party[pc].items[i_num].ability]) // place use if can - place_item_button(10,i,1,0); - else place_item_button(11,i,1,0); + place_item_button(ITEMBTN_NORM,i,1,0); + else place_item_button(ITEMBTN_ALL,i,1,0); } else { place_item_button(0,i,0,univ.party[pc].items[i_num].graphic_num); // item_graphic @@ -473,21 +472,23 @@ void place_item_button(short which_button_to_put,short which_slot,short which_bu item_area_button_active[which_slot][which_button_position] = true; rect_draw_some_item(invenbtn_gworld, item_buttons_from[which_button_to_put], item_stats_gworld, item_buttons[which_slot][which_button_position], sf::BlendAlpha); } - if(which_button_to_put == 10) { // this means put all 4 + if(which_button_to_put == ITEMBTN_ALL) { // this means put all 4 item_area_button_active[which_slot][1] = true; item_area_button_active[which_slot][2] = true; item_area_button_active[which_slot][3] = true; item_area_button_active[which_slot][4] = true; - from_rect = item_buttons_from[0]; from_rect.right = item_buttons_from[3].right; + from_rect = item_buttons_from[0]; + from_rect.right = item_buttons_from[3].right; to_rect = item_buttons[which_slot][1]; to_rect.right = to_rect.left + from_rect.right - from_rect.left; rect_draw_some_item(invenbtn_gworld, from_rect, item_stats_gworld, to_rect, sf::BlendAlpha); } - if(which_button_to_put == 11) { // this means put right 3 + if(which_button_to_put == ITEMBTN_NORM) { // this means put right 3 item_area_button_active[which_slot][2] = true; item_area_button_active[which_slot][3] = true; item_area_button_active[which_slot][4] = true; - from_rect = item_buttons_from[1]; from_rect.right = item_buttons_from[3].right; + from_rect = item_buttons_from[1]; + from_rect.right = item_buttons_from[3].right; to_rect = item_buttons[which_slot][2]; to_rect.right = to_rect.left + from_rect.right - from_rect.left; rect_draw_some_item(invenbtn_gworld, from_rect, item_stats_gworld, to_rect, sf::BlendAlpha); @@ -632,7 +633,7 @@ rectangle get_stat_effect_rect(int code) { } void draw_pc_effects(short pc) { - rectangle dest_rect = {18,15,30,27},dlog_dest_rect = {66,354,78,366}; + rectangle dest_rect = {18,15,30,27}; short right_limit = 250; short name_width; diff --git a/src/pcedit/pc.action.cpp b/src/pcedit/pc.action.cpp index d160795f..dc686cf6 100644 --- a/src/pcedit/pc.action.cpp +++ b/src/pcedit/pc.action.cpp @@ -28,7 +28,7 @@ extern rectangle pc_info_rect; extern rectangle name_rect; extern rectangle pc_race_rect; -extern rectangle edit_rect[5][2]; +extern rectangle edit_rect[5]; bool handle_action(sf::Event event) { short i; @@ -50,7 +50,7 @@ bool handle_action(sf::Event event) { redraw_screen(); } for(i = 0; i < 5; i++) - if((the_point.in(edit_rect[i][0])) && + if((the_point.in(edit_rect[i])) && (univ.party[current_active_pc].main_status != eMainStatus::ABSENT)) { do_button_action(0,i + 10); switch(i) { diff --git a/src/pcedit/pc.graphics.cpp b/src/pcedit/pc.graphics.cpp index e93773fd..8907d87e 100644 --- a/src/pcedit/pc.graphics.cpp +++ b/src/pcedit/pc.graphics.cpp @@ -36,10 +36,10 @@ extern rectangle hp_sp_rect; extern rectangle skill_rect; extern rectangle pc_skills_rect[19]; extern rectangle status_rect; -extern rectangle pc_status_rect[10]; +extern rectangle pc_status_rect[15]; extern rectangle traits_rect; -extern rectangle pc_traits_rect[16]; -extern rectangle edit_rect[5][2]; +extern rectangle pc_traits_rect[17]; +extern rectangle edit_rect[5]; short store_str1a; short store_str1b; @@ -59,7 +59,6 @@ sf::Texture vehicle_gworld, small_ter_gworld; void init_main_buttons() { short i; - int indent = 0, indent2 = 0; rectangle base_rect; @@ -99,22 +98,12 @@ void init_main_buttons() { pc_area_buttons[i][3].offset(0,-2); } // Initialize the edit_rect buttons - edit_rect[0][0].top = pc_info_rect.top; + edit_rect[0].top = pc_info_rect.top; for(i = 0; i < 5; i++) { - if(i >= 2) - indent = 5; - else - indent = 0; - if( i == 4) - indent2 = 1; - edit_rect[i][0].top = edit_rect[0][0].top + 66*i; - edit_rect[i][0].bottom = edit_rect[i][0].top + 53; - edit_rect[i][0].left = 510; - edit_rect[i][0].right = edit_rect[i][0].left + 53; - edit_rect[i][1].top = edit_rect[i][0].top + 11 + indent; - edit_rect[i][1].bottom = edit_rect[i][0].bottom - 11 - indent; - edit_rect[i][1].right = edit_rect[i][0].right - 8 +indent2; - edit_rect[i][1].left = edit_rect[i][0].left + 8 + indent2; + edit_rect[i].top = edit_rect[0].top + 66*i; + edit_rect[i].bottom = edit_rect[i].top + 53; + edit_rect[i].left = 510; + edit_rect[i].right = edit_rect[i].left + 53; } // Initialize pc_race_rect @@ -130,7 +119,7 @@ void init_main_buttons() { info_area_rect.bottom = pc_info_rect.bottom; // Initialize hp_sp_rect - hp_sp_rect.top = name_rect.bottom + 1; + hp_sp_rect.top = name_rect.bottom + 3; hp_sp_rect.left = pc_info_rect.left + 1; hp_sp_rect.right = pc_race_rect.right; hp_sp_rect.bottom = hp_sp_rect.top + 12; @@ -138,7 +127,7 @@ void init_main_buttons() { skill_rect.top = hp_sp_rect.bottom + 2; skill_rect.left = pc_info_rect.left + 1; skill_rect.right = pc_race_rect.right; - skill_rect.bottom = skill_rect.top + 12; + skill_rect.bottom = skill_rect.top + 5; // Initialize skills_rect base_rect.top = skill_rect.bottom + 1; @@ -155,21 +144,24 @@ void init_main_buttons() { status_rect.top = pc_skills_rect[9].bottom + 5; status_rect.left = pc_info_rect.left + 1; status_rect.right = pc_race_rect.right; - status_rect.bottom = status_rect.top + 12; + status_rect.bottom = status_rect.top + 10; // Initialize pc_status_rect - base_rect.top = status_rect.bottom + 1; + base_rect.top = status_rect.bottom - 1; base_rect.left = status_rect.left + 1; base_rect.right = name_rect.right - 1; base_rect.bottom = base_rect.top + (pc_info_rect.bottom - status_rect.bottom)/15; - for(i = 0; i < 10; i++) { + for(i = 0; i < 14; i++) { pc_status_rect[i] = base_rect; - pc_status_rect[i].offset((i / 5) * ((name_rect.right)-(name_rect.left)), (i % 5) * (pc_info_rect.bottom - status_rect.bottom)/15); + pc_status_rect[i].offset((i / 7) * ((name_rect.right)-(name_rect.left)), (i % 7) * 9); } + pc_status_rect[14] = base_rect; + pc_status_rect[14].offset(name_rect.right - name_rect.left, -9); + // Initialize traits_rect - traits_rect.top = pc_status_rect[4].bottom + 5; + traits_rect.top = pc_status_rect[6].bottom + 5; traits_rect.left = pc_info_rect.left + 1; traits_rect.right = pc_race_rect.right; - traits_rect.bottom = traits_rect.top + 12; + traits_rect.bottom = traits_rect.top + 10; // Initialize pc_traits_rect base_rect.top = traits_rect.bottom - 1; base_rect.left = traits_rect.left + 1; @@ -179,10 +171,11 @@ void init_main_buttons() { pc_traits_rect[i] = base_rect; pc_traits_rect[i].offset((i / 8) * ((name_rect.right)-(name_rect.left)), (i % 8) * 9); } - + pc_traits_rect[16] = base_rect; + pc_traits_rect[16].offset(name_rect.right - name_rect.left, -9); item_string_rects[0][0].top = pc_info_rect.top + 3; - item_string_rects[0][0].left = pc_info_rect.left + (pc_info_rect.right - pc_info_rect.left)/2; + item_string_rects[0][0].left = pc_info_rect.left + (pc_info_rect.right - pc_info_rect.left)/2 + 2; item_string_rects[0][0].right = pc_info_rect.right; item_string_rects[0][0].bottom = item_string_rects[0][0].top + 12; for(i = 1; i < 24; i++) { @@ -245,7 +238,6 @@ void draw_main_screen() { TextStyle style; style.lineHeight = 10; - // TODO: Is this needed? if(!file_in_mem.empty()) { dest_rect = dest_rec; dest_rect.top = dest_rect.bottom - 10; @@ -273,7 +265,7 @@ void draw_main_screen() { win_draw_string(mainPtr,dest_rect,"Warning: Scenario item data could not be loaded.",eTextMode::WRAP,style); dest_rect.offset(-200,0); } - dest_rect.offset(0,12); + dest_rect.offset(0,14); if(!file_in_mem.empty()) win_draw_string(mainPtr,dest_rect,"Press 'I' button to identify item, and 'D' button to drop item.",eTextMode::WRAP,style); style.pointSize = 12; @@ -314,21 +306,17 @@ void draw_items() { dest_rect = item_string_rects[0][0]; dest_rect.bottom += 3; - dest_rect.offset(0,-14); + dest_rect.offset(0,-15); - // TODO: Should this be reimplemented? - // First, draw "Fred's Items:" - //sprintf((char *)to_draw,"%s items:",univ.party[current_active_pc].name); - //TextSize(12); - //ClipRect(&dest_rect); - //win_draw_string(mainPtr,item_string_rects[0][0],to_draw,0,12); - //undo_clip(); - //TextSize(10); + TextStyle style; + style.pointSize = 12; + win_draw_string(mainPtr,dest_rect,univ.party[current_active_pc].name + "'s Items:",eTextMode::LEFT_TOP,style); if(univ.party[current_active_pc].main_status != eMainStatus::ALIVE){ frame_dlog_rect(mainPtr,pc_info_rect); // re draw entire frame frame_dlog_rect(mainPtr,info_area_rect); // draw the frame frame_dlog_rect(mainPtr,pc_race_rect); // draw the frame + frame_dlog_rect(mainPtr,name_rect); // draw the frame return; // If PC is dead, it has no items } for(i = 0; i < 24; i++) // Loop through items and draw each @@ -344,7 +332,7 @@ void draw_items() { TextStyle style; style.lineHeight = 10; - win_draw_string(mainPtr,item_string_rects[i][0],to_draw,eTextMode::WRAP,style); + win_draw_string(mainPtr,item_string_rects[i][0],to_draw,eTextMode::LEFT_TOP,style); // Draw id/drop buttons rect_draw_some_item(invenbtn_gworld,d_from,mainPtr,item_string_rects[i][1],sf::BlendAlpha); @@ -373,7 +361,7 @@ void display_party() { } else { from_rect = pc_info_rect; - from_rect.top = from_rect.bottom - 14; + from_rect.top = from_rect.bottom - 11; if(!party_in_scen) win_draw_string(mainPtr,from_rect,"Party not in a scenario.",eTextMode::WRAP,style); else @@ -387,8 +375,6 @@ void display_party() { rect_draw_some_item(buttons_gworld,from_rect,mainPtr,pc_area_buttons[i][0], sf::BlendAdd); - // pc_record_type is the records that contains chaarcters - // main_status determins 0 - not exist, 1 - alive, OK, 2 - dead, 3 - stoned, 4 - dust if(univ.party[i].main_status != eMainStatus::ABSENT) { // PC exists? // draw PC graphic pic_num_t pic = univ.party[i].which_graphic; @@ -410,7 +396,6 @@ void display_party() { } rect_draw_some_item(*from_gw,from_rect,mainPtr,pc_area_buttons[i][1],sf::BlendAlpha); - //frame_dlog_rect(GetWindowPort(mainPtr),pc_area_buttons[i][1],0); // draw name style.pointSize = 9; if( (univ.party[i].name.length()) >= 10) { @@ -436,15 +421,10 @@ void display_party() { case eMainStatus::ALIVE: if(i == current_active_pc) { // Draw in race - if(univ.party[i].race == eRace::HUMAN) - win_draw_string(mainPtr,pc_race_rect,"Human ",eTextMode::CENTRE,style); - if(univ.party[i].race == eRace::NEPHIL) - win_draw_string(mainPtr,pc_race_rect,"Nephilim ",eTextMode::CENTRE,style); - if(univ.party[i].race == eRace::SLITH) - win_draw_string(mainPtr,pc_race_rect,"Slithzerikai ",eTextMode::CENTRE,style); - if(univ.party[i].race == eRace::VAHNATAI) - win_draw_string(mainPtr,pc_race_rect,"Vahnatai",eTextMode::CENTRE,style); - // TODO: Monster races + std::string race_str = "Unknown"; + if(univ.party[i].race != eRace::UNKNOWN) + race_str = get_str("traits", int(univ.party[i].race) * 2 + 35); + win_draw_string(mainPtr,pc_race_rect,race_str,eTextMode::CENTRE,style); // Draw in skills win_draw_string(mainPtr,skill_rect,"Skills:",eTextMode::WRAP,style); @@ -461,12 +441,13 @@ void display_party() { for( k = 0; k < 19 ; ++k) { temp_rect = pc_skills_rect[k]; temp_rect.left = pc_skills_rect[k].left + 80; + if(k < 10) temp_rect.left += 4; + else temp_rect.left -= 2; win_draw_string(mainPtr,pc_skills_rect[k],get_str("skills",string_num),eTextMode::WRAP,style); eSkill skill = eSkill(k); win_draw_string(mainPtr,temp_rect,std::to_string(univ.party[i].skills[skill]),eTextMode::WRAP,style); - //frame_dlog_rect(GetWindowPort(mainPtr),pc_skills_rect[k],0); string_num+=2; } style.lineHeight = 10; @@ -481,104 +462,106 @@ void display_party() { style.font = FONT_PLAIN; style.lineHeight = 9; - - //for(k = 0 ; k < 10; k++) - //frame_dlog_rect(GetWindowPort(mainPtr),pc_status_rect[k],0); if(univ.party[i].status[eStatus::POISONED_WEAPON] > 0) - if(cur_rect <= 9) { + if(cur_rect <= 14) { win_draw_string(mainPtr,pc_status_rect[cur_rect],"Poisoned Weap.",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].status[eStatus::BLESS_CURSE] > 0) - if(cur_rect <= 9) { + if(cur_rect <= 14) { win_draw_string(mainPtr,pc_status_rect[cur_rect],"Blessed",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].status[eStatus::BLESS_CURSE] < 0) - if(cur_rect <= 9) { + if(cur_rect <= 14) { win_draw_string(mainPtr,pc_status_rect[cur_rect],"Cursed",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].status[eStatus::POISON] > 0) - if(cur_rect <= 9) { + if(cur_rect <= 14) { win_draw_string(mainPtr,pc_status_rect[cur_rect],"Poisoned",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].status[eStatus::HASTE_SLOW] > 0) - if(cur_rect <= 9) { + if(cur_rect <= 14) { win_draw_string(mainPtr,pc_status_rect[cur_rect],"Hasted",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].status[eStatus::HASTE_SLOW] < 0) - if(cur_rect <= 9) { + if(cur_rect <= 14) { win_draw_string(mainPtr,pc_status_rect[cur_rect],"Slowed",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].status[eStatus::INVULNERABLE] > 0) - if(cur_rect <= 9) { + if(cur_rect <= 14) { win_draw_string(mainPtr,pc_status_rect[cur_rect],"Invulnerable",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].status[eStatus::MAGIC_RESISTANCE] > 0) - if(cur_rect <= 9) { + if(cur_rect <= 14) { win_draw_string(mainPtr,pc_status_rect[cur_rect],"Magic Resistant",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].status[eStatus::MAGIC_RESISTANCE] < 0) - if(cur_rect <= 9) { + if(cur_rect <= 14) { win_draw_string(mainPtr,pc_status_rect[cur_rect],"Magic Vulnerable",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].status[eStatus::WEBS] > 0) - if(cur_rect <= 9) { + if(cur_rect <= 14) { win_draw_string(mainPtr,pc_status_rect[cur_rect],"Webbed",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].status[eStatus::DISEASE] > 0) - if(cur_rect <= 9) { + if(cur_rect <= 14) { win_draw_string(mainPtr,pc_status_rect[cur_rect],"Diseased",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].status[eStatus::INVISIBLE] > 0) - if(cur_rect <= 9) { - win_draw_string(mainPtr,pc_status_rect[cur_rect],"Sanctury",eTextMode::WRAP,style); + if(cur_rect <= 14) { + win_draw_string(mainPtr,pc_status_rect[cur_rect],"Sanctuary",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].status[eStatus::DUMB] > 0) - if(cur_rect <= 9) { + if(cur_rect <= 14) { win_draw_string(mainPtr,pc_status_rect[cur_rect],"Dumbfounded",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].status[eStatus::DUMB] < 0) - if(cur_rect <= 9) { + if(cur_rect <= 14) { win_draw_string(mainPtr,pc_status_rect[cur_rect],"Enlightened",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].status[eStatus::MARTYRS_SHIELD] > 0) - if(cur_rect <= 9) { + if(cur_rect <= 14) { win_draw_string(mainPtr,pc_status_rect[cur_rect],"Martyr's Shield",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].status[eStatus::ASLEEP] > 0) - if(cur_rect <= 9) { + if(cur_rect <= 14) { win_draw_string(mainPtr,pc_status_rect[cur_rect],"Asleep",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].status[eStatus::ASLEEP] < 0) - if(cur_rect <= 9) { + if(cur_rect <= 14) { win_draw_string(mainPtr,pc_status_rect[cur_rect],"Hyperactive",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].status[eStatus::PARALYZED] > 0) - if(cur_rect <= 9) { + if(cur_rect <= 14) { win_draw_string(mainPtr,pc_status_rect[cur_rect],"Paralyzed",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].status[eStatus::ACID] > 0) - if(cur_rect <= 9) { + if(cur_rect <= 14) { win_draw_string(mainPtr,pc_status_rect[cur_rect],"Acid",eTextMode::WRAP,style); cur_rect++; } + if(univ.party[i].status[eStatus::FORCECAGE] > 0) + if(cur_rect <= 14) { + win_draw_string(mainPtr,pc_status_rect[cur_rect],"Forcecage",eTextMode::WRAP,style); + cur_rect++; + } style.lineHeight = 10; //end pc status section @@ -594,88 +577,88 @@ void display_party() { cur_rect=0; if(univ.party[i].traits[eTrait::TOUGHNESS]) - if(cur_rect <= 15) { + if(cur_rect <= 16) { win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Toughness",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].traits[eTrait::MAGICALLY_APT]) - if(cur_rect <= 15) { + if(cur_rect <= 16) { win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Magically Apt",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].traits[eTrait::AMBIDEXTROUS]) - if(cur_rect <= 15) { + if(cur_rect <= 16) { win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Ambidextrous",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].traits[eTrait::NIMBLE]) - if(cur_rect <= 15) { + if(cur_rect <= 16) { win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Nimble Fingers",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].traits[eTrait::CAVE_LORE]) - if(cur_rect <= 15) { + if(cur_rect <= 16) { win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Cave Lore",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].traits[eTrait::WOODSMAN]) - if(cur_rect <= 15) { + if(cur_rect <= 16) { win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Woodsman",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].traits[eTrait::GOOD_CONST]) - if(cur_rect <= 15) { + if(cur_rect <= 16) { win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Good Constitution",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].traits[eTrait::HIGHLY_ALERT]) - if(cur_rect <= 15) { + if(cur_rect <= 16) { win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Highly Alert",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].traits[eTrait::STRENGTH]) - if(cur_rect <= 15) { + if(cur_rect <= 16) { win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Exceptional Str.",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].traits[eTrait::RECUPERATION]) - if(cur_rect <= 15) { + if(cur_rect <= 16) { win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Recuperation",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].traits[eTrait::SLUGGISH]) - if(cur_rect <= 15) { + if(cur_rect <= 16) { win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Sluggish",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].traits[eTrait::MAGICALLY_INEPT]) - if(cur_rect <= 15) { + if(cur_rect <= 16) { win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Magically Inept",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].traits[eTrait::FRAIL]) - if(cur_rect <= 15) { + if(cur_rect <= 16) { win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Frail",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].traits[eTrait::CHRONIC_DISEASE]) - if(cur_rect <= 15) { + if(cur_rect <= 16) { win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Chronic Disease",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].traits[eTrait::BAD_BACK]) - if(cur_rect <= 15) { + if(cur_rect <= 16) { win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Bad Back",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].traits[eTrait::PACIFIST]) - if(cur_rect <= 15) { + if(cur_rect <= 16) { win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Pacifist",eTextMode::WRAP,style); cur_rect++; } if(univ.party[i].traits[eTrait::ANAMA]) - if(cur_rect <= 15) { + if(cur_rect <= 16) { win_draw_string(mainPtr,pc_traits_rect[cur_rect],"Anama Member",eTextMode::WRAP,style); cur_rect++; } @@ -739,46 +722,61 @@ void display_party() { style.pointSize = 10; break; } - //frame_dlog_rect(GetWindowPort(mainPtr),pc_area_buttons[i][0],0); - - } } // Closes the for i=6 loop + style.lineHeight = 16; for(i = 0; i < 5; i++) { - //frame_dlog_rect(GetWindowPort(mainPtr),edit_rect[i][0],0); - //frame_dlog_rect(GetWindowPort(mainPtr),edit_rect[i][1],0); from_rect = (current_pressed_button == i + 10) ? ed_buttons_from[1] : ed_buttons_from[0]; - rect_draw_some_item(buttons_gworld,from_rect,mainPtr,edit_rect[i][0]); + rect_draw_some_item(buttons_gworld,from_rect,mainPtr,edit_rect[i]); style.colour = sf::Color::White; + rectangle dest_rect = edit_rect[i]; switch(i) { case 0: - win_draw_string(mainPtr,edit_rect[0][1]," Add|Mage|Spells",eTextMode::WRAP,style); + dest_rect.top += dest_rect.height() / 2 - style.lineHeight; + win_draw_string(mainPtr,dest_rect,"Mage",eTextMode::CENTRE,style); break; case 1: - win_draw_string(mainPtr,edit_rect[1][1]," Add|Priest|Spells",eTextMode::WRAP,style); + dest_rect.top += dest_rect.height() / 2 - style.lineHeight; + win_draw_string(mainPtr,dest_rect,"Priest",eTextMode::CENTRE,style); break; case 2: - win_draw_string(mainPtr,edit_rect[2][1]," Edit|Traits",eTextMode::WRAP,style); + dest_rect.top += dest_rect.height() / 2 - style.lineHeight / 2; + win_draw_string(mainPtr,dest_rect,"Traits",eTextMode::CENTRE,style); break; case 3: - win_draw_string(mainPtr,edit_rect[3][1]," Edit|Skills",eTextMode::WRAP,style); + dest_rect.top += dest_rect.height() / 2 - style.lineHeight / 2; + win_draw_string(mainPtr,dest_rect,"Skills",eTextMode::CENTRE,style); break; case 4: - win_draw_string(mainPtr,edit_rect[4][1]," Edit| XP",eTextMode::WRAP,style); + dest_rect.top += dest_rect.height() / 2 - style.lineHeight / 2; + win_draw_string(mainPtr,dest_rect,"XP",eTextMode::CENTRE,style); break; default: break; } + if(i < 2) { + dest_rect.top -= style.lineHeight; + win_draw_string(mainPtr,dest_rect,"Add",eTextMode::CENTRE,style); + dest_rect.top += style.lineHeight * 2; + win_draw_string(mainPtr,dest_rect,"Spells",eTextMode::CENTRE,style); + } else { + dest_rect.top -= style.lineHeight; + win_draw_string(mainPtr,dest_rect,"Edit",eTextMode::CENTRE,style); + } } style.colour = sf::Color::Black; - // TODO: Maybe find a better place to print this - rectangle dest_rect = title_from; - dest_rect.offset(100,60); + rectangle dest_rect = name_rect; + dest_rect.offset(0,-14); std::ostringstream to_draw; - to_draw << " Gold: " << std::setw(0) << univ.party.gold << "Food: " << univ.party.food; + to_draw << " Gold: " << std::setw(0) << univ.party.gold; + win_draw_string(mainPtr,dest_rect,to_draw.str(),eTextMode::WRAP,style); + dest_rect = pc_race_rect; + dest_rect.offset(0,-14); + to_draw.str(""); + to_draw << " Food: " << univ.party.food; win_draw_string(mainPtr,dest_rect,to_draw.str(),eTextMode::WRAP,style); } } diff --git a/src/pcedit/pc.main.cpp b/src/pcedit/pc.main.cpp index e4d2f422..46648c4b 100644 --- a/src/pcedit/pc.main.cpp +++ b/src/pcedit/pc.main.cpp @@ -28,11 +28,11 @@ rectangle hp_sp_rect; // Holds hit points and spells points for pc rectangle skill_rect; // Holds "Skills:" string rectangle pc_skills_rect[19]; //Holds current pc's skill levels rectangle status_rect; //Holds the string "Status:" -rectangle pc_status_rect[10]; //Holds first 8 effects on pc +rectangle pc_status_rect[15]; //Holds first 8 effects on pc rectangle traits_rect; //Holds the string "Traits:" -rectangle pc_traits_rect[16]; //Holds pc traits +rectangle pc_traits_rect[17]; //Holds pc traits rectangle pc_race_rect; //Holds current pc's race -rectangle edit_rect[5][2]; //Buttons that bring up pc edit dialog boxs +rectangle edit_rect[5]; //Buttons that bring up pc edit dialog boxs std::string scenario_temp_dir_name = "pc_scenario"; short current_active_pc = 0; diff --git a/src/scenedit/scen.graphics.cpp b/src/scenedit/scen.graphics.cpp index 9b8b990f..50ef32f6 100644 --- a/src/scenedit/scen.graphics.cpp +++ b/src/scenedit/scen.graphics.cpp @@ -1361,7 +1361,7 @@ void place_location() { erase_rect.bottom = erase_rect.top + 12; tileImage(terrain_buttons_gworld, erase_rect,bg[17]); - location moveTo(5 ,terrain_rects[255].top + 15); + location moveTo(5, terrain_rects[255].top + 18); draw_rect = text_rect; draw_rect.offset(moveTo); if(overall_mode < MODE_MAIN_SCREEN) @@ -1375,7 +1375,7 @@ void place_location() { win_draw_string(terrain_buttons_gworld, draw_rect, sout.str(), eTextMode::LEFT_TOP, style); sout.str(""); - moveTo = location(260 ,terrain_rects[255].top + 15); + moveTo = location(260 ,terrain_rects[255].top + 18); draw_rect = text_rect; draw_rect.offset(moveTo); sout << current_terrain_type; @@ -1389,11 +1389,11 @@ void place_location() { tileImage(terrain_buttons_gworld, erase_rect,bg[17]); if(overall_mode < MODE_MAIN_SCREEN) { - moveTo = location(5,terrain_rects[255].bottom + 118); + moveTo = location(5,terrain_rects[255].bottom + 121); draw_rect = text_rect; draw_rect.offset(moveTo); win_draw_string(terrain_buttons_gworld, draw_rect, current_string[0], eTextMode::LEFT_TOP, style); - moveTo = location(RIGHT_AREA_WIDTH / 2,terrain_rects[255].bottom + 118); + moveTo = location(RIGHT_AREA_WIDTH / 2,terrain_rects[255].bottom + 121); draw_rect = text_rect; draw_rect.offset(moveTo); win_draw_string(terrain_buttons_gworld, draw_rect, current_string[1], eTextMode::LEFT_TOP, style); diff --git a/src/tools/graphtool.cpp b/src/tools/graphtool.cpp index 80f11c09..e8c97621 100644 --- a/src/tools/graphtool.cpp +++ b/src/tools/graphtool.cpp @@ -393,6 +393,10 @@ void win_draw_string(sf::RenderTarget& dest_window,rectangle dest_rect,std::stri fill_rect(dest_window, bounds, options.hilite_bg); } else str_to_draw.setColor(options.style.colour); dest_window.draw(str_to_draw); + if(options.style.font == FONT_BOLD) { + str_to_draw.move(1, 0); + dest_window.draw(str_to_draw); + } } }