Changeset - r26454:da7e3664f572
[Not reviewed]
master
0 1 0
Nicolas Chappe - 2 years ago 2021-12-22 12:21:19
74881848+nchappe@users.noreply.github.com
Codechange: Allow use of SetDParam for tooltips
1 file changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/misc_gui.cpp
Show inline comments
 
@@ -672,7 +672,7 @@ struct TooltipsWindow : public Window
 
{
 
	StringID string_id;               ///< String to display as tooltip.
 
	byte paramcount;                  ///< Number of string parameters in #string_id.
 
	uint64 params[5];                 ///< The string parameters.
 
	uint64 params[8];                 ///< The string parameters.
 
	TooltipCloseCondition close_cond; ///< Condition for closing the window.
 

	
 
	TooltipsWindow(Window *parent, StringID str, uint paramcount, const uint64 params[], TooltipCloseCondition close_tooltip) : Window(&_tool_tips_desc)
 
@@ -681,6 +681,10 @@ struct TooltipsWindow : public Window
 
		this->string_id = str;
 
		static_assert(sizeof(this->params[0]) == sizeof(params[0]));
 
		assert(paramcount <= lengthof(this->params));
 
		if (params == nullptr) {
 
			_global_string_params.offset = 0;
 
			params = _global_string_params.GetDataPointer();
 
		}
 
		if (paramcount > 0) memcpy(this->params, params, sizeof(this->params[0]) * paramcount);
 
		this->paramcount = paramcount;
 
		this->close_cond = close_tooltip;
0 comments (0 inline, 0 general)