-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #14 from AxeelAnder/master
v1.1.1.6
- Loading branch information
Showing
124 changed files
with
2,168 additions
and
1,110 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation"> | ||
<s:Boolean x:Key="/Default/CodeInspection/CodeAnnotations/NamespacesWithAnnotations/=TestWPF_002EAnnotations/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> | ||
<s:Boolean x:Key="/Default/CodeInspection/CodeAnnotations/NamespacesWithAnnotations/=TestWPF_002EAnnotations/@EntryIndexedValue">True</s:Boolean> | ||
<s:Boolean x:Key="/Default/UserDictionary/Words/=Localizer/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary> |
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,14 @@ | ||
using System; | ||
|
||
namespace Localizer.Attributes | ||
{ | ||
public class OperationTimingAttribute : Attribute | ||
{ | ||
public OperationTiming Timing { get; } | ||
|
||
public OperationTimingAttribute(OperationTiming timing = OperationTiming.Any) | ||
{ | ||
Timing = timing; | ||
} | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
using System; | ||
using System.Reflection; | ||
using Localizer.Helpers; | ||
using Terraria; | ||
using Terraria.ModLoader; | ||
using Terraria.ModLoader.Core; | ||
|
||
namespace Localizer.DataModel.Default | ||
{ | ||
public class LoadedModWrapper : IMod | ||
{ | ||
private readonly WeakReference<object> wrapped; | ||
|
||
public LoadedModWrapper(object mod) | ||
{ | ||
wrapped = new WeakReference<object>(mod); | ||
name = mod.Prop("Name") as string; | ||
if (name == "ModLoader") | ||
{ | ||
code = Assembly.GetAssembly(typeof(Main)); | ||
} | ||
else | ||
{ | ||
code = mod.Field("assembly") as Assembly; | ||
} | ||
var buildProp = mod.Field("properties"); | ||
displayName = buildProp.Field("displayName") as string; | ||
version = buildProp.Field("version") as Version; | ||
file = mod.Field("modFile") as TmodFile; | ||
} | ||
|
||
public string Name => name ?? ""; | ||
private string name; | ||
|
||
public Assembly Code => code; | ||
private Assembly code; | ||
|
||
public string DisplayName => displayName ?? ""; | ||
private string displayName; | ||
|
||
public Version Version => version ?? new Version(); | ||
private Version version; | ||
|
||
public TmodFile File => file; | ||
private TmodFile file; | ||
|
||
public bool Enabled => (bool)typeof(ModLoader).Method("IsEnabled", Name); | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
using System; | ||
|
||
namespace Localizer | ||
{ | ||
public abstract class Disposable : IDisposable | ||
{ | ||
protected bool disposed = false; | ||
|
||
public void Dispose() | ||
{ | ||
Dispose(true); | ||
GC.SuppressFinalize(this); | ||
} | ||
|
||
~Disposable() | ||
{ | ||
Dispose(false); | ||
} | ||
|
||
protected virtual void Dispose(bool disposeManaged) | ||
{ | ||
if (!disposed) | ||
{ | ||
if (disposeManaged) | ||
{ | ||
DisposeManaged(); | ||
} | ||
|
||
DisposeUnmanaged(); | ||
|
||
disposed = true; | ||
} | ||
} | ||
|
||
protected virtual void DisposeManaged() { } | ||
|
||
protected virtual void DisposeUnmanaged() { } | ||
} | ||
} |
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,13 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
|
||
namespace Localizer | ||
{ | ||
[JsonConverter(typeof(StringEnumConverter))] | ||
public enum AutoImportType | ||
{ | ||
All, | ||
DownloadedOnly, | ||
SourceOnly, | ||
} | ||
} |
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,15 @@ | ||
using Newtonsoft.Json; | ||
using Newtonsoft.Json.Converters; | ||
|
||
namespace Localizer | ||
{ | ||
[JsonConverter(typeof(StringEnumConverter))] | ||
public enum LogLevel : byte | ||
{ | ||
Fatal = 0, | ||
Error = 1, | ||
Warn = 2, | ||
Info = 3, | ||
Debug = 4, | ||
} | ||
} |
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,14 @@ | ||
using System; | ||
|
||
namespace Localizer | ||
{ | ||
[Flags] | ||
public enum OperationTiming : byte | ||
{ | ||
BeforeModCtor = 0b00000001, | ||
BeforeModLoad = 0b00000010, | ||
BeforeContentLoad = 0b00000100, | ||
PostContentLoad = 0b00001000, | ||
Any = 0b11111111, | ||
} | ||
} |
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,8 @@ | ||
namespace Localizer | ||
{ | ||
public enum PackageType | ||
{ | ||
Packed, | ||
Source, | ||
} | ||
} |
Oops, something went wrong.