Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
8 changes: 4 additions & 4 deletions CaiBotLiteMod/CaiBotCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public override CommandType Type

public override string Command
=> "生成绑定码";

public override string Description
=> "生成一个CaiBot绑定码";

Expand All @@ -29,16 +29,16 @@ public override CommandType Type

public override string Command
=> "t";

public override string Description
=> "Test";

public override void Action(CommandCaller caller, string input, string[] args)
{
Console.WriteLine(JsonConvert.SerializeObject(ModLoader.Mods.Where(i=> i!=null).Select(i=> i.Name)));
Console.WriteLine(JsonConvert.SerializeObject(ModLoader.Mods.Where(i => i != null).Select(i => i.Name)));
var mod = ModLoader.GetMod("MagicStorage");
var asset = mod.Assets.GetLoadedAssets();

Console.WriteLine(asset.Length);
}
}
5 changes: 3 additions & 2 deletions CaiBotLiteMod/CaiBotLiteMod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public class CaiBotLiteMod : Mod
{
internal static int InitCode = -1;
internal static bool DebugMode;

public static readonly Version PluginVersion = ModLoader.GetMod("CaiBotLiteMod").Version;
public static readonly TSPlayer?[] Players = new TSPlayer[256];

Expand All @@ -23,6 +23,7 @@ public override void Load()
{
return;
}

DebugMode = Program.LaunchParameters.ContainsKey("-caidebug");
Config.Settings.Read();
Config.Settings.Write();
Expand All @@ -40,7 +41,7 @@ public override void Unload()
WebsocketManager.WebSocket.Dispose();
ExecuteCommandHook.Dispose();
}


public static void GenCode()
{
Expand Down
3 changes: 3 additions & 0 deletions CaiBotLiteMod/CaiBotLiteMod.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
<HintPath>lib\SixLabors.ImageSharp.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<PackageReference Update="tModLoader.CodeAssist" Version="0.1.5" />
</ItemGroup>


<!-- References -->
Expand Down
4 changes: 2 additions & 2 deletions CaiBotLiteMod/Moudles/Package.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public T Read<T>(string key)
{
if (Enum.GetNames(typeof(T)).Any(name => string.Equals(name, "Unknown", StringComparison.OrdinalIgnoreCase)))
{
return (T)Enum.Parse(typeof(T), "Unknown", true);
return (T) Enum.Parse(typeof(T), "Unknown", true);
}

throw new InvalidCastException($"Cannot convert string '{stringValue}' to enum {typeof(T).Name}", ex);
}
}
Expand Down
Loading
Loading