2018-05-24 16:27 EDT


View Issue Details Jump to Notes ] Related Changesets ]
IDProjectCategoryView StatusLast Update
0003068FSSCPuser interfacepublic2014-12-22 01:48
ReporterMageKing17 
Assigned ToMageKing17 
PrioritylowSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
Product Version3.7.0 
Target Version3.7.2Fixed in Version3.7.2 
Summary0003068: Popup wordwrapping problem related to PF_TITLE_BIG
DescriptionWordwrapping in the popup code works differently for title lines (the first line of the popup if PF_TITLE or PF_TITLE_BIG is used); this isn't normally a problem, but in one particular case, the "title" is a somewhat-lengthy message and PF_TITLE_BIG exacerbates the problem.

Screenshot attached, and linked here: http://deviance.duckish.net/pictures/fs2_open_3_7_1_SSE2%202014-06-20%2020-56-30-04.png
Steps To Reproduce1) Open FSO.
2) Select a pilot in "multi" mode.
3) Hit your "delete" key.
4) Observe the text going outside the bounds of the popup window.
Additional InformationI've verified that the bug shows up at least as far back as 3.7.0, but I'm not sure where to find a string long enough try to trigger the bug in an earlier build; obviously, if it can be triggered in an older build, different Steps To Reproduce will be necessary.
TagsNo tags attached.
Attached Files
  • png file icon fs2_open_3_7_1_SSE2 2014-06-20 20-56-30-04.png (364,587 bytes) 2014-06-21 00:31
  • patch file icon 3068_easy.patch (781 bytes) 2014-09-13 15:11 -
    Index: code/menuui/playermenu.cpp
    ===================================================================
    --- code/menuui/playermenu.cpp	(revision 11071)
    +++ code/menuui/playermenu.cpp	(working copy)
    @@ -979,7 +979,7 @@
     			int ret;
     
     			if (Player_select_mode == PLAYER_SELECT_MODE_MULTI) {
    -				popup(PF_TITLE_BIG | PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK, XSTR("Pilots can only be deleted from the single player menu!", 1611));
    +				popup(PF_BODY_BIG | PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK, XSTR("Pilots can only be deleted from the single player menu!", 1611));
     			} else {
     				// display a popup requesting confirmation
     				ret = popup(PF_USE_AFFIRMATIVE_ICON | PF_USE_NEGATIVE_ICON,2,POPUP_NO,POPUP_YES,XSTR( "Are you sure you want to delete this pilot?", 383));										
    
    patch file icon 3068_easy.patch (781 bytes) 2014-09-13 15:11 +
  • patch file icon 3068_proper.patch (908 bytes) 2014-12-22 01:45 -
    Index: code/menuui/playermenu.cpp
    ===================================================================
    --- code/menuui/playermenu.cpp	(revision 11201)
    +++ code/menuui/playermenu.cpp	(working copy)
    @@ -975,21 +975,7 @@
     
     	// delete the currently highlighted pilot
     	case KEY_DELETE:
    -		if (Player_select_pilot >= 0) {
    -			int ret;
    -
    -			if (Player_select_mode == PLAYER_SELECT_MODE_MULTI) {
    -				popup(PF_TITLE_BIG | PF_USE_AFFIRMATIVE_ICON, 1, POPUP_OK, XSTR("Pilots can only be deleted from the single player menu!", 1611));
    -			} else {
    -				// display a popup requesting confirmation
    -				ret = popup(PF_USE_AFFIRMATIVE_ICON | PF_USE_NEGATIVE_ICON,2,POPUP_NO,POPUP_YES,XSTR( "Are you sure you want to delete this pilot?", 383));										
    -
    -				// delete the pilot
    -				if (ret == 1) {
    -					player_select_delete_pilot();
    -				}
    -			}
    -		}
    +		player_select_button_pressed(DELETE_BUTTON);
     		break;
     	}
     
    
    patch file icon 3068_proper.patch (908 bytes) 2014-12-22 01:45 +

-Relationships
+Relationships

-Notes

~0016276

MageKing17 (developer)

Last edited: 2014-09-13 15:09

View 2 revisions

I feel profoundly... unobservant for not noticing this when I originally investigated the issue, but the problem here is that it's a one-line popup using PF_TITLE_BIG, and "title" lines aren't subject to normal wordwrapping (they use a width of 1000 regardless of the popup window's width).

"Easy" solution is to just change PF_TITLE_BIG to PF_BODY_BIG (which, despite my claim in the initial report, works fine). "Proper" solution should probably be to refactor the code in playermenu.cpp so that hitting DEL has the same effect as clicking the "remove" button; the popup in that case is more verbose and its title line is an actual title instead of the body of the message.

~0016430

MageKing17 (developer)

Doing it the "proper" way turned out to be a lot easier than I expected. I think this is simple enough it should probably make it into 3.7.2.

~0016431

MageKing17 (developer)

Fix committed to trunk@11202.
+Notes

+Related Changesets

-Issue History
Date Modified Username Field Change
2014-06-21 00:31 MageKing17 New Issue
2014-06-21 00:31 MageKing17 File Added: fs2_open_3_7_1_SSE2 2014-06-20 20-56-30-04.png
2014-06-21 01:47 MageKing17 Description Updated View Revisions
2014-09-11 19:30 MageKing17 Note Added: 0016276
2014-09-11 19:40 MageKing17 Summary Popup wordwrapping malfunctioning when PF_BODY_BIG flag set. => Popup wordwrapping problem related to PF_TITLE_BIG
2014-09-11 19:40 MageKing17 Description Updated View Revisions
2014-09-11 19:42 MageKing17 Assigned To => MageKing17
2014-09-11 19:42 MageKing17 Status new => assigned
2014-09-13 15:09 MageKing17 Note Edited: 0016276 View Revisions
2014-09-13 15:11 MageKing17 File Added: 3068_easy.patch
2014-12-22 01:45 MageKing17 File Added: 3068_proper.patch
2014-12-22 01:46 MageKing17 Note Added: 0016430
2014-12-22 01:46 MageKing17 Status assigned => code review
2014-12-22 01:46 MageKing17 Fixed in Version => 3.7.2
2014-12-22 01:46 MageKing17 Target Version => 3.7.2
2014-12-22 01:48 MageKing17 Changeset attached => fs2open trunk r11202
2014-12-22 01:48 MageKing17 Note Added: 0016431
2014-12-22 01:48 MageKing17 Status code review => resolved
2014-12-22 01:48 MageKing17 Resolution open => fixed
+Issue History