View Issue Details

IDProjectCategoryView StatusLast Update
0003068FSSCPuser interfacepublic2014-12-22 06:48
ReporterMageKing17 Assigned ToMageKing17  
PrioritylowSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
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.

Activities

MageKing17

2014-06-21 04:31

developer  

MageKing17

2014-09-11 23:30

developer   ~0016276

Last edited: 2014-09-13 19:09

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.

MageKing17

2014-09-13 19:11

developer  

3068_easy.patch (781 bytes)   
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));										
3068_easy.patch (781 bytes)   

MageKing17

2014-12-22 06:45

developer  

3068_proper.patch (908 bytes)   
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;
 	}
 
3068_proper.patch (908 bytes)   

MageKing17

2014-12-22 06:46

developer   ~0016430

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.

MageKing17

2014-12-22 06:48

developer   ~0016431

Fix committed to trunk@11202.

Related Changesets

fs2open: trunk r11202

2014-12-22 02:39

MageKing17


Ported: N/A

Details Diff
Fix mantis 0003068.

Make hitting the "delete" key in the pilot-selection menu do the same thing as clicking on the "remove" button.
Affected Issues
0003068
mod - /trunk/fs2_open/code/menuui/playermenu.cpp Diff File

Issue History

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