-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Round Set Changer / Apopalypse changes, minor fixes
- Loading branch information
1 parent
34f4083
commit 4b864b2
Showing
9 changed files
with
57 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,7 @@ | ||
## Misc Updates | ||
|
||
- Added a button that lets you open the Mods Menu from the In Game Pause Screen | ||
- This includes opening Mod Settings menus, but not many settings yet will probably live update in a game | ||
- Added a button in the Mods Menu that can display the SHA 256 hashes of active mods | ||
- Added a new `ModTower.IncludeInMonkeyTeams` override | ||
- Fixed some inconsistencies where some simulation behavior extensions would throw exceptions instead of just returning null | ||
- ModHelperData now supports multiline raw strings for descriptions, [example](https://github.com/doombubbles/ability-choice/blob/699658591855043372a128294de679670600e3c1/ModHelperData.cs#L10) | ||
|
||
## Localization Updates | ||
|
||
### General | ||
|
||
- Added a new button in the Mods Menu to export a mod's localization to a json file, which can be edited to change its | ||
supported displayed text for your language | ||
- This goes to a newly added subfolder `Mods/BloonsTD6 Mod Helper/Localization/[Language]` | ||
- Edits to files here should refresh the text without requiring a game restart | ||
- Added a new [Translation Tool page on the website](https://gurrenm3.github.io/BTD-Mod-Helper/tools/translate) that can | ||
easily put Localization files through Google translate for individual or all supported languages | ||
- Using this tool, Mod Helper now contains Localizations for all supported BTD6 language. If you see a way that | ||
one/many of the Google Translations could be improved for your language, you can help out by submitting edits to | ||
the [corresponding Language file](https://github.com/gurrenm3/BTD-Mod-Helper/tree/master/BloonsTD6%20Mod%20Helper/Localization) through GitHub | ||
- The text in mods that should be automatically supported for localization editing includes | ||
- Names and Descriptions for Towers, Upgrades, Heroes, Bloons etc | ||
- Names and Descriptions for Mod Settings | ||
- General mod info like the description | ||
|
||
### For Modders | ||
|
||
- The standard btd6.targets import will now automatically embed `/Localization/[Language].json` files in your mod | ||
project | ||
- Use the Localization Button on your own mod with active language English to get a starter .json for your mod | ||
- If you paste in the .json content on the website and press the "Translate All" button it will create a .zip file | ||
with all the correctly named .json files you'd need for your mod | ||
- ModHelperText and ModHelperDropdown components now Localize their texts by default | ||
- For Localization Entries, putting text within [Square Brackets] will make it try to fetch existing localization for | ||
that key | ||
- e.g. `The description is [DartMonkey Description]` -> | ||
`The description is Throws a single dart at nearby Bloons. Short range and low pierce but cheap.` | ||
- Added new `ModContent.Localize` methods that can add new mod specific localizations from variables | ||
```csharp | ||
private static readonly string DoTheThing = ModContent.Localize<MyMod>(nameof(DoTheThing), "Do The Thing!"); | ||
``` | ||
Or within any method/constructor that's going to run as the game loads | ||
```csharp | ||
var doTheThing = ModContent.Localize(nameof(DoTheThing), "Do The Thing!"); | ||
``` | ||
The result assigned to the `DoTheThing` is your mod specific localization key, that you can use in a | ||
`ModHelperText.SetText(DoTheThing)` directly or as `string localizedText = DoTheThing.Localize()` otherwise | ||
- As before, you can still override the `RegisterText` method in any class that extends `NamedModContent` to | ||
directly add extra stuff to the text table | ||
```csharp | ||
public override void RegisterText(Il2CppSystem.Collections.Generic.Dictionary<string, string> textTable) | ||
{ | ||
base.RegisterText(textTable); // Call the base to still register DisplayName / Description | ||
textTable[Id + " Long Description"] = LongDescription; // More specific stuff to your ModContent | ||
} | ||
``` | ||
- Pause Screen Mods Button now shows number of active mods | ||
- Updated icon for Pause Screen mods button | ||
- Made it less likely for other mods to have errors if they tried to use file/folder picker popups outside standard mod settings | ||
- Apopalypse Mode is now correctly affected by the Round Set changer | ||
- Made the Round Changer button also show up in the Challenge Editor Play screen | ||
- Note: The Round Set Changer would always technically apply to challenges, this is just making it clearer and easier | ||
to change without going back to the normal map play screens |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
BloonsTD6 Mod Helper/Patches/UI/UI_ApplyExtraNotInSimModelSettings.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using BTD_Mod_Helper.UI.Modded; | ||
using Il2CppAssets.Scripts.Models; | ||
using Il2CppAssets.Scripts.Simulation.Track.RoundManagers; | ||
using Il2CppAssets.Scripts.Unity.Bridge; | ||
|
||
namespace BTD_Mod_Helper.Patches.UI; | ||
|
||
[HarmonyPatch(typeof(Il2CppAssets.Scripts.Unity.UI_New.UI), nameof(Il2CppAssets.Scripts.Unity.UI_New.UI.ApplyExtraNotInSimModelSettings))] | ||
internal static class UI_ApplyExtraNotInSimModelSettings | ||
{ | ||
[HarmonyPostfix] | ||
internal static void Postfix(UnityToSimulation uts, GameModel model) | ||
{ | ||
if (!string.IsNullOrEmpty(RoundSetChanger.RoundSetOverride) && model.isApopalypse) | ||
{ | ||
var roundManager = new DefaultRoundManager(model); | ||
uts.InitRoundSet(roundManager); | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters