Changeset - r20726:7b9d88519b7d
[Not reviewed]
master
0 2 0
zuu - 11 years ago 2013-09-13 21:34:32
zuu@openttd.org
(svn r25769) -Fix (r25344): Drawing of broken goal references was broken
2 files changed with 7 insertions and 8 deletions:
0 comments (0 inline, 0 general)
src/lang/english.txt
Show inline comments
 
@@ -3024,12 +3024,13 @@ STR_STORY_BOOK_TITLE                    
 
STR_STORY_BOOK_GENERIC_PAGE_ITEM                                :Page {NUM}
 
STR_STORY_BOOK_SEL_PAGE_TOOLTIP                                 :{BLACK}Jump to a specific page by selecting it in this drop down list.
 
STR_STORY_BOOK_PREV_PAGE                                        :{BLACK}Previous
 
STR_STORY_BOOK_PREV_PAGE_TOOLTIP                                :{BLACK}Go to previous page
 
STR_STORY_BOOK_NEXT_PAGE                                        :{BLACK}Next
 
STR_STORY_BOOK_NEXT_PAGE_TOOLTIP                                :{BLACK}Go to next page
 
STR_STORY_BOOK_INVALID_GOAL_REF                                 :{RED}Invalid goal reference
 

	
 
# Station list window
 
STR_STATION_LIST_TOOLTIP                                        :{BLACK}Station names - click on name to centre main view on station. Ctrl+Click opens a new viewport on station location
 
STR_STATION_LIST_USE_CTRL_TO_SELECT_MORE                        :{BLACK}Hold Ctrl to select more than one item
 
STR_STATION_LIST_CAPTION                                        :{WHITE}{COMPANY} - {COMMA} Station{P "" s}
 
STR_STATION_LIST_STATION                                        :{YELLOW}{STATION} {STATION_FEATURES}
src/story_gui.cpp
Show inline comments
 
@@ -364,24 +364,25 @@ protected:
 
	 * text after that. These page elements are generally clickable and are thus called
 
	 * action elements.
 
	 * @param y_offset Current y_offset which will get updated when this method has completed its drawing.
 
	 * @param width Width of the region available for drawing.
 
	 * @param line_height Height of one line of text.
 
	 * @param action_sprite The sprite to draw.
 
	 * @param string_id The string id to draw.
 
	 * @return the number of lines.
 
	 */
 
	void DrawActionElement(int &y_offset, int width, int line_height, SpriteID action_sprite) const
 
	void DrawActionElement(int &y_offset, int width, int line_height, SpriteID action_sprite, StringID string_id = STR_JUST_RAW_STRING) const
 
	{
 
		Dimension sprite_dim = GetSpriteSize(action_sprite);
 
		uint element_height = max(sprite_dim.height, (uint)line_height);
 

	
 
		uint sprite_top = y_offset + (element_height - sprite_dim.height) / 2;
 
		uint text_top = y_offset + (element_height - line_height) / 2;
 

	
 
		DrawSprite(action_sprite, PAL_NONE, 0, sprite_top);
 
		DrawString(sprite_dim.width + WD_FRAMETEXT_LEFT, width, text_top, STR_JUST_RAW_STRING, TC_BLACK);
 
		DrawString(sprite_dim.width + WD_FRAMETEXT_LEFT, width, text_top, string_id, TC_BLACK);
 

	
 
		y_offset += element_height;
 
	}
 

	
 
	/**
 
	 * Internal event handler for when a page element is clicked.
 
@@ -520,18 +521,15 @@ public:
 
					SetDParamStr(0, pe->text);
 
					y_offset = DrawStringMultiLine(0, right - x, y_offset, bottom - y, STR_JUST_RAW_STRING, TC_BLACK, SA_TOP | SA_LEFT);
 
					break;
 

	
 
				case SPET_GOAL: {
 
					Goal *g = Goal::Get((GoalID) pe->referenced_id);
 
					if (g != NULL) {
 
						SetDParamStr(0, g->text);
 
						DrawActionElement(y_offset, right - x, line_height, GetPageElementSprite(*pe));
 
					} else {
 
						y_offset += line_height;
 
					}
 
					StringID string_id = g == NULL ? STR_STORY_BOOK_INVALID_GOAL_REF : STR_JUST_RAW_STRING;
 
					if (g != NULL) SetDParamStr(0, g->text);
 
					DrawActionElement(y_offset, right - x, line_height, GetPageElementSprite(*pe), string_id);
 
					break;
 
				}
 

	
 
				case SPET_LOCATION:
 
					SetDParamStr(0, pe->text);
 
					DrawActionElement(y_offset, right - x, line_height, GetPageElementSprite(*pe));
0 comments (0 inline, 0 general)