ellipsis-truncate long PC names in more places

This commit is contained in:
2025-05-07 13:43:25 -05:00
parent ebd6908b95
commit b1ddb696b3
2 changed files with 8 additions and 8 deletions

View File

@@ -13,12 +13,12 @@
<button name='caster6' type='regular' def-key='6' relative='pos-in pos-in' rel-anchor='prev' top='24' left='0'><key/></button>
<!-- PC names -->
<text name='pc-head' size='large' relative='pos-in pos-in' anchor='caster-head' top='0' left='66' width='75' height='16'></text><!-- Just for positioning-->
<text name='pc1' relative='pos-in pos-in' rel-anchor='prev' top='24' left='0' width='122' height='16'/>
<text name='pc2' relative='pos-in pos-in' rel-anchor='prev' top='24' left='0' width='122' height='16'/>
<text name='pc3' relative='pos-in pos-in' rel-anchor='prev' top='24' left='0' width='122' height='16'/>
<text name='pc4' relative='pos-in pos-in' rel-anchor='prev' top='24' left='0' width='122' height='16'/>
<text name='pc5' relative='pos-in pos-in' rel-anchor='prev' top='24' left='0' width='122' height='16'/>
<text name='pc6' relative='pos-in pos-in' rel-anchor='prev' top='24' left='0' width='122' height='16'/>
<text name='pc1' ellipsis='true' relative='pos-in pos-in' rel-anchor='prev' top='24' left='0' width='122' height='16'/>
<text name='pc2' ellipsis='true' relative='pos-in pos-in' rel-anchor='prev' top='24' left='0' width='122' height='16'/>
<text name='pc3' ellipsis='true' relative='pos-in pos-in' rel-anchor='prev' top='24' left='0' width='122' height='16'/>
<text name='pc4' ellipsis='true' relative='pos-in pos-in' rel-anchor='prev' top='24' left='0' width='122' height='16'/>
<text name='pc5' ellipsis='true' relative='pos-in pos-in' rel-anchor='prev' top='24' left='0' width='122' height='16'/>
<text name='pc6' ellipsis='true' relative='pos-in pos-in' rel-anchor='prev' top='24' left='0' width='122' height='16'/>
<!-- To the right of PC name, buttons to select target -->
<text name='target-head' size='large' relative='pos-in pos-in' anchor='pc-head' top='0' left='112' width='223' height='16'>Target:</text>
<button name='target1' type='small' def-key='shift 1' relative='pos-in pos-in' rel-anchor='prev' top='19' left='6'><key/></button>

View File

@@ -135,7 +135,7 @@ void put_pc_screen() {
std::ostringstream sout;
sout << i + 1 << ". " << univ.party[i].name;
win_draw_string(pc_stats_gworld(),pc_buttons[i][PCBTN_NAME],sout.str(),eTextMode::WRAP,style);
win_draw_string(pc_stats_gworld(),pc_buttons[i][PCBTN_NAME],sout.str(),eTextMode::ELLIPSIS,style);
style.italic = false;
style.colour = Colours::BLACK;
@@ -253,7 +253,7 @@ void put_item_screen(eItemWinMode screen_num) {
title = sout.str();
break;
}
win_draw_string(item_stats_gworld(),upper_frame_rect,title,eTextMode::WRAP,title_style);
win_draw_string(item_stats_gworld(),upper_frame_rect,title,eTextMode::ELLIPSIS,title_style);
TextStyle line_style;
auto draw_item_string = [&line_style](int i, std::string str, eFont font, sf::Color colour, bool italic = false, location offset = {0, 0}){