Changeset - r25359:9796f7058da8
[Not reviewed]
master
0 3 0
PeterN - 3 years ago 2021-05-02 09:43:14
peter1138@openttd.org
Fix: Update text effect size when font zoom is changed. (#9174)
3 files changed with 12 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/saveload/afterload.cpp
Show inline comments
 
@@ -219,6 +219,7 @@ void UpdateAllVirtCoords()
 
	UpdateAllStationVirtCoords();
 
	UpdateAllSignVirtCoords();
 
	UpdateAllTownVirtCoords();
 
	UpdateAllTextEffectVirtCoords();
 
	RebuildViewportKdtree();
 
}
 

	
src/texteff.cpp
Show inline comments
 
@@ -73,7 +73,16 @@ void UpdateTextEffect(TextEffectID te_id
 
	te->params_1 = GetDParam(0);
 
	te->params_2 = GetDParam(1);
 

	
 
	te->UpdatePosition(te->center, te->top, msg);
 
	te->UpdatePosition(te->center, te->top, te->string_id, te->string_id - 1);
 
}
 

	
 
void UpdateAllTextEffectVirtCoords()
 
{
 
	for (auto &te : _text_effects) {
 
		SetDParam(0, te.params_1);
 
		SetDParam(1, te.params_2);
 
		te.UpdatePosition(te.center, te.top, te.string_id, te.string_id - 1);
 
	}
 
}
 

	
 
void RemoveTextEffect(TextEffectID te_id)
src/texteff.hpp
Show inline comments
 
@@ -32,6 +32,7 @@ void InitTextEffects();
 
void DrawTextEffects(DrawPixelInfo *dpi);
 
void UpdateTextEffect(TextEffectID effect_id, StringID msg);
 
void RemoveTextEffect(TextEffectID effect_id);
 
void UpdateAllTextEffectVirtCoords();
 

	
 
/* misc_gui.cpp */
 
TextEffectID ShowFillingPercent(int x, int y, int z, uint8 percent, StringID colour);
0 comments (0 inline, 0 general)