Merge pull request #2733 from KawaiiYuyu/general-devel
Add localization support for console spam reduction
This commit is contained in:
commit
be4c33cff5
2 changed files with 17 additions and 8 deletions
|
|
@ -16,6 +16,7 @@ You should have received a copy of the GNU General Public License
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
using System;
|
using System;
|
||||||
|
using Terraria.Localization;
|
||||||
|
|
||||||
namespace TShockAPI.Modules;
|
namespace TShockAPI.Modules;
|
||||||
|
|
||||||
|
|
@ -32,6 +33,13 @@ public class ReduceConsoleSpam : Module
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private string _lastStatusText = null;
|
private string _lastStatusText = null;
|
||||||
|
|
||||||
|
private readonly string _resettingObjectText = LanguageManager.Instance.GetTextValue("LegacyWorldGen.47");
|
||||||
|
private readonly string _loadingText = LanguageManager.Instance.GetTextValue("LegacyWorldGen.51");
|
||||||
|
private readonly string _settlingText = LanguageManager.Instance.GetTextValue("LegacyWorldGen.27");
|
||||||
|
private readonly string _savingText = LanguageManager.Instance.GetTextValue("LegacyWorldGen.49");
|
||||||
|
private readonly string _validatingText = LanguageManager.Instance.GetTextValue("LegacyWorldGen.73");
|
||||||
|
private readonly string _finalizingText = LanguageManager.Instance.GetTextValue("LegacyWorldGen.87");
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Aims to reduce the amount of console spam by filtering out load/save progress
|
/// Aims to reduce the amount of console spam by filtering out load/save progress
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
@ -59,11 +67,11 @@ public class ReduceConsoleSpam : Module
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (replace("Resetting game objects")
|
if (replace(_resettingObjectText)
|
||||||
|| replace("Settling liquids")
|
|| replace(_settlingText)
|
||||||
|| replace("Loading world data")
|
|| replace(_loadingText)
|
||||||
|| replace("Saving world data")
|
|| replace(_savingText)
|
||||||
|| replace("Validating world save"))
|
|| replace(_validatingText))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// try parsing % - [text] - %
|
// try parsing % - [text] - %
|
||||||
|
|
@ -84,10 +92,10 @@ public class ReduceConsoleSpam : Module
|
||||||
if (text.Length > 0 && !(
|
if (text.Length > 0 && !(
|
||||||
// relogic has made a mess of this
|
// relogic has made a mess of this
|
||||||
(
|
(
|
||||||
_lastStatusText != "Validating world save"
|
_lastStatusText != _validatingText
|
||||||
|| _lastStatusText != "Saving world data"
|
|| _lastStatusText != _savingText
|
||||||
)
|
)
|
||||||
&& text == "Finalizing world"
|
&& text == _finalizingText
|
||||||
))
|
))
|
||||||
WriteIfChange(text);
|
WriteIfChange(text);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ Use past tense when adding new entries; sign your name off when you add or chang
|
||||||
* Added new tile provider. Use `-constileation` or `-c` to use it. Constileation is an alternative tile provider to Tiled and HeapTile. (@SignatureBeef)
|
* Added new tile provider. Use `-constileation` or `-c` to use it. Constileation is an alternative tile provider to Tiled and HeapTile. (@SignatureBeef)
|
||||||
* Fixed an exploit with grass mowing not removing hanging vines. (@punchready)
|
* Fixed an exploit with grass mowing not removing hanging vines. (@punchready)
|
||||||
* Added `-additionalplugins` command line argument to load additional plugins. (@pontaoski)
|
* Added `-additionalplugins` command line argument to load additional plugins. (@pontaoski)
|
||||||
|
* Added localization support for console spam reduction. (@KawaiiYuyu)
|
||||||
|
|
||||||
## TShock 4.5.18
|
## TShock 4.5.18
|
||||||
* Fixed `TSPlayer.GiveItem` not working if the player is in lava. (@PotatoCider)
|
* Fixed `TSPlayer.GiveItem` not working if the player is in lava. (@PotatoCider)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue