Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
68 commits
Select commit Hold shift + click to select a range
b7374d8
[Major] adds interfaces for LocalizationElement and ElementCollection…
remyCases Aug 26, 2024
943dfa3
[Minor] removes useless using
remyCases Aug 26, 2024
165cc36
[Major] adds npclines and consumables injection in their respective f…
remyCases Aug 26, 2024
65ff4bf
[Major] adds speech injection
remyCases Aug 26, 2024
3c9c3d1
[Minor] fixes collection interface to use the interface instead of a …
remyCases Aug 26, 2024
0395dbc
[Minor] updates create line for item, injecttable for collection
remyCases Aug 26, 2024
06264ac
[Minor] updates injecttable for collection
remyCases Aug 26, 2024
ee33f35
[Minor] saves export folder when loading a new file, by default the e…
remyCases Aug 26, 2024
3abde17
[Minor] changes default dll folder when patching so dlls in the MSL f…
remyCases Aug 26, 2024
d80cb79
[Minor] adds stopwatch to track patching time
remyCases Aug 26, 2024
668f9ca
[Major] adds montecarlo estimation method
remyCases Aug 26, 2024
fa056c6
[Major] moves all random methods in a seperate file, adds the modlang…
remyCases Aug 26, 2024
68abcef
[Minor] updates localization by using Id instead of OName
remyCases Aug 26, 2024
0c5482a
[Major] changes injecttable
remyCases Aug 26, 2024
140d18b
[Minor] fixes wrong class for GenerateNRandomLinesFromCode
remyCases Aug 27, 2024
7d40443
[Major] fixes asm table injection, updates ILocalizationElement to al…
remyCases Aug 27, 2024
8da09db
[Minor] updates unit test
remyCases Aug 27, 2024
95fcb22
[Major] adds new interface for multi sub tables table, updates old cl…
remyCases Aug 27, 2024
75a75f1
[Major] adds modifier table
remyCases Aug 27, 2024
4ba1613
[Minor] fixes modifier injection
remyCases Aug 27, 2024
743a383
[Minor] fixes null descrition modifier
remyCases Aug 27, 2024
73061a3
[Major] updates consumable injection with the new localization
remyCases Aug 27, 2024
93b9409
[Major] adds weapon_text, change name of tableArmor and tableWeapons …
remyCases Aug 27, 2024
6553395
[Major] removes tableCollections set of classes, merges the item inte…
remyCases Aug 27, 2024
259b18d
[Minor] removes localization constructor with only id
remyCases Aug 27, 2024
afdb0f3
[Major] book localization done
remyCases Aug 27, 2024
9595685
[Major] adds support for 4 subtables of Text
remyCases Aug 27, 2024
a8a623d
[Major] adds type safety for injects methods, fixes speech missing se…
remyCases Aug 27, 2024
9655f14
[Major] adds skills table
remyCases Aug 27, 2024
1cb79c6
[Minor] fix correct table name
remyCases Aug 27, 2024
60ea048
[Minor] fixes table length not being updated when patched in asm
remyCases Aug 28, 2024
93876f4
[Minor] adds table_animals_ai backbone
remyCases Aug 28, 2024
f397599
[Minor] fixes inject table items
remyCases Aug 28, 2024
5c12377
[Major] improves table ai injection
remyCases Aug 28, 2024
5568fd1
[Major] updates table ai as a rectangular matrix instead of a squared…
remyCases Aug 30, 2024
c43391a
[Major] adds a placeholder png, adds a new button in the main menu, r…
remyCases Aug 30, 2024
43ce90f
[Major] updates placeholder aw builder
remyCases Aug 30, 2024
fc3f68a
[Minor] removes useless readme
remyCases Aug 30, 2024
328f950
[Major] reorganizes tables file into 2 folders, localization and stat
remyCases Aug 30, 2024
e6e19f2
[Minor] updates csproj since some files were displaced
remyCases Aug 30, 2024
f61b038
[Minor] moves test files and prepares it for future tests
remyCases Aug 30, 2024
ee10a62
[Minor] adds a new test for npclines
remyCases Aug 30, 2024
3cc308b
[Major] reworks table injection to seperate into modification and inj…
remyCases Aug 30, 2024
44953bf
[Major] adds Books unit test
remyCases Aug 30, 2024
6ae8433
[Minor] adds books unit tests
remyCases Aug 30, 2024
3b9e6d9
[Minor] add skills unit test
remyCases Aug 30, 2024
903e692
[Minor] adds speeches unit test and fixes speeches
remyCases Aug 30, 2024
751f326
[Minor] adds weapon text unit test
remyCases Aug 30, 2024
d8d0451
[Minor] adds rarity and tree text unit tests
remyCases Aug 30, 2024
6a048d1
[Minor] adds context unit tests
remyCases Aug 30, 2024
a50618e
[Minor] adds backward compatibility for consumables injection
remyCases Sep 1, 2024
3f67f8c
[Major] adds three names subtables
remyCases Sep 2, 2024
5de94da
[Major] updates table elements being added at the end of the table in…
remyCases Sep 6, 2024
9a6396f
[Minor] fixes context injection
remyCases Sep 7, 2024
ab36cab
[Major] adds script implementation for context menu
remyCases Sep 7, 2024
44bd700
[Identity Test] I dont even know what I'm pushing pong
remyCases Nov 19, 2024
636478f
[Minor] Add log functions for modders
altairwei Apr 12, 2025
8a41bdb
Merge remote-tracking branch 'upstream/TableInjection' into PickRemyC…
altairwei Apr 17, 2025
667f611
[Major] add LocalizationLogText api
altairwei May 6, 2025
0707d3c
[Minor] fixed several localization apis
altairwei May 6, 2025
ce2c0b5
[Minor] fix ItemStats API by removing Bleeding_Resistance_2
altairwei May 6, 2025
a29661d
[Major] add a new api of InjectTableTextCraftingCategoryLocalization
altairwei May 6, 2025
7c50b08
[Minor] fix InjectTableDialogLocalization
altairwei May 11, 2025
8d72393
[Minor] Fixed books localization api
altairwei Jun 12, 2025
507d035
[Minor] Fixed broken ItemStats table API
altairwei Sep 22, 2025
35fec30
[Minor] Fix armor stats and localization table injection
altairwei Sep 27, 2025
4e4f58f
[Minor] update InjectTableWeapons
altairwei Oct 19, 2025
a7cb402
[Minor] Fix mods stats api
altairwei Nov 29, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions DataLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
using System.Threading.Tasks;
using System.IO;
using System;
using System.Windows;
using UndertaleModLib.Util;
using System.Linq;
using Microsoft.Win32;
Expand All @@ -20,8 +19,10 @@ public class DataLoader
public static UndertaleData data = new();
internal static string dataPath = "";
internal static string savedDataPath = "";
internal static string exportPath = "";
public delegate void FileMessageEventHandler(string message);
public static event FileMessageEventHandler FileMessageEvent;
public static int LastCountContext;
public static void ShowWarning(string warning, string title)
{
Console.WriteLine(title + ":" + warning);
Expand Down Expand Up @@ -54,17 +55,17 @@ private static void ExportData()
File.WriteAllText("json_dump_code.json", JsonConvert.SerializeObject(data.Code.Select(t => t.Name.Content)));
File.WriteAllText("json_dump_variables.json", JsonConvert.SerializeObject(data.Variables.Select(t => t.Name.Content)));
File.WriteAllText("json_dump_rooms.json", JsonConvert.SerializeObject(data.Rooms.Select(t => t.Name.Content)));
Msl.GenerateNRandomLinesFromCode(data.Code, new GlobalDecompileContext(data, false), 100, 1, 0);
RandomUtils.GenerateNRandomLinesFromCode(data.Code, new GlobalDecompileContext(data, false), 100, 1, 0);
}
/// <summary>
/// Export all items, weapons and armors in csv files.
/// </summary>
private static void ExportItems()
private static void ExportItems(bool deleteBeforeExport = false)
{
try
{
DirectoryInfo dir = new("export");
if (dir.Exists) dir.Delete(true);
DirectoryInfo dir = new(exportPath);
if (deleteBeforeExport && dir.Exists) dir.Delete(true);
dir.Create();

List<string>? weapons = ModLoader.GetTable("gml_GlobalScript_table_weapons");
Expand Down Expand Up @@ -168,6 +169,8 @@ public static async Task LoadFile(string filename, bool re = false)
{
// save the filename for later
dataPath = filename;
// save export folder
exportPath = Path.Join(Directory.GetCurrentDirectory(), Path.DirectorySeparatorChar.ToString(), "export");
// create a new dialog box
LoadingDialog dialog = new()
{
Expand Down Expand Up @@ -197,6 +200,7 @@ public static async Task LoadFile(string filename, bool re = false)
ModLoader.Initalize();
// cleaning loot table
LootUtils.ResetLootTables();
LastCountContext = ContextMenuUtils.ReadLastContextIndex();
ExportItems();
}
public static async Task<bool> DoSaveDialog()
Expand Down
2 changes: 1 addition & 1 deletion FilePacker.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static bool Pack(string path)
null,
path,
ModLoader.ModPath,
path,
Path.GetDirectoryName(Path.GetDirectoryName(path)) ?? path,
Main.Instance.mslVersion,
new Type[2] {typeof(ModShardLauncher.Mods.Mod), typeof(UndertaleModLib.Models.UndertaleCode)}
);
Expand Down
5 changes: 4 additions & 1 deletion ModLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,6 @@ public static void PatchMods()
Disclaimers = new();
List<ModFile> mods = ModInfos.Instance.Mods;
Menus = new();

Stopwatch watch = Stopwatch.StartNew();
foreach (ModFile mod in mods)
{
Expand Down Expand Up @@ -204,6 +203,10 @@ public static void PatchMods()
Msl.AddDisclaimerRoom(Credits.Select(x => x.Item1).ToArray(), Credits.SelectMany(x => x.Item2).Distinct().ToArray());
Msl.ChainDisclaimerRooms(Disclaimers);
Msl.CreateMenu(Menus);
Msl.AddFunction(@"function msl_always_true() {
return true;
}", "msl_always_true");


watch.Stop();
long elapsedMs = watch.ElapsedMilliseconds;
Expand Down
21 changes: 3 additions & 18 deletions ModShardLauncher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,11 @@

<ItemGroup> <!-- Include the specific files to exclude the ones in the test folder -->
<Compile Include="*.cs" Exclude="bin\**;obj\**;ModShardLauncherTest\**.*cs" />
<Compile Include="ModUtils\TableUtils\Backers.cs" />
<Compile Include="ModUtils\TableUtils\ContractsStats.cs" />
<Compile Include="ModUtils\TableUtils\Drops.cs" />
<Compile Include="ModUtils\TableUtils\DungeonsSpawn.cs" />
<Compile Include="ModUtils\TableUtils\ItemStats.cs" />
<Compile Include="ModUtils\TableUtils\MobsStats.cs" />
<Compile Include="ModUtils\TableUtils\PotionsStats.cs" />
<Compile Include="ModUtils\TableUtils\RecipesCook.cs" />
<Compile Include="ModUtils\TableUtils\RecipesCraft.cs" />
<Compile Include="ModUtils\TableUtils\SkillsStats.cs" />
<Compile Include="ModUtils\TableUtils\SurfaceSpawn.cs" />
<Compile Include="ModUtils\TableUtils\TableArmor.cs" />
<Compile Include="ModUtils\TableUtils\TableUtils.cs" />
<Compile Include="ModUtils\TableUtils\LocalizationUtils.cs" />
<Compile Include="ModUtils\TableUtils\TableWeapons.cs" />
<Compile Include="Pages/*.cs" />
<Compile Include="Extensions/*.cs" />
<Compile Include="Mods/*.cs" />
<Compile Include="Controls/*.cs" />
<Compile Include="ModUtils/*.cs" />
<Compile Include="ModUtils\**\*.*cs" />
</ItemGroup>

<ItemGroup>
Expand Down Expand Up @@ -218,9 +203,9 @@

<Target Name="CopyDevFiles" AfterTargets="Publish">
<Copy SourceFiles="Resources\ExportRoom.csx" DestinationFolder="$(PublishDir)" />
<Copy SourceFiles="Reference\UndertaleModLib.dll" DestinationFolder="$(PublishDir)" />
<Copy SourceFiles="Reference\UndertaleModTool.dll" DestinationFolder="$(PublishDir)" />
<Copy SourceFiles="$(OutputPath)ModShardLauncher.dll" DestinationFolder="$(PublishDir)" />
<Copy SourceFiles="Reference\UndertaleModLib.dll;Reference\UndertaleModTool.dll" DestinationFolder="$(PublishDir)" />
<Copy SourceFiles="ModReference\netstandard.dll;ModReference\System.Collections.dll;ModReference\System.Runtime.dll;ModReference\System.Linq.dll;ModReference\System.ObjectModel.dll" DestinationFolder="$(PublishDir)" />
</Target>

</Project>
211 changes: 0 additions & 211 deletions ModShardLauncherTest/LocalizationUtilsTest.cs

This file was deleted.

2 changes: 1 addition & 1 deletion ModShardLauncherTest/ModShardLauncherTest.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
</PropertyGroup>

<ItemGroup>
<Compile Include="*.cs" Exclude="bin\**;obj\**"/>
<Compile Include="**\*.cs" Exclude="bin\**;obj\**"/>
</ItemGroup>

<ItemGroup>
Expand Down
Loading