@@ -312,7 +312,10 @@ private static void TerrainRenderer_UpdateGraphics(TerrainRenderer __instance, T
312312 SkinType skinType = tile . data . Skin ;
313313
314314 string flood = "" ;
315- if ( tile . data . effects . Contains ( TileData . EffectType . Flooded ) || ( tribe == TribeType . Aquarion && tile . data . terrain == Polytopia . Data . TerrainData . Type . Mountain ) )
315+ if (
316+ tile . data . effects . Contains ( TileData . EffectType . Flooded ) ||
317+ ( tribe == TribeType . Aquarion && tile . data . terrain == Polytopia . Data . TerrainData . Type . Mountain )
318+ ) // TODO: Check all tribes with flooded abil instead of Aquarion only.
316319 {
317320 foreach ( var effect in tile . data . effects )
318321 {
@@ -366,6 +369,22 @@ private static void TileData_Flood(TileData __instance, PlayerState playerState)
366369 }
367370 }
368371
372+ /// <summary>Removes custom flood effect loc from tile tip header.</summary>
373+ [ HarmonyPostfix ]
374+ [ HarmonyPatch ( typeof ( TileTipGenerator ) , nameof ( TileTipGenerator . GetTileTipHeader ) ) ]
375+ public static void GetTileTipHeader ( ref string __result , TileData tileData , SkinType skin ,
376+ PlayerState playerState , GameState gameState , GameLogicData gameLogicData )
377+ {
378+ foreach ( var effect in tileData . effects )
379+ {
380+ if ( customFloodingSkins . ContainsKey ( effect ) )
381+ {
382+ string localizedEffect = Localization . GetSkinned ( skin , playerState . tribe , $ "tile.effect.{ effect . GetName ( ) } ") ;
383+ __result = __result . Replace ( $ ", { localizedEffect } ", string . Empty ) ;
384+ }
385+ }
386+ }
387+
369388 /// <summary>Forces an update of the mesh for a PolytopiaSpriteRenderer with a custom sprite.</summary>
370389 [ HarmonyPostfix ]
371390 [ HarmonyPatch ( typeof ( PolytopiaSpriteRenderer ) , nameof ( PolytopiaSpriteRenderer . ForceUpdateMesh ) ) ]
0 commit comments