-
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 #10 from AxeelAnder/master
Version 1.1.1.4
- Loading branch information
Showing
68 changed files
with
610 additions
and
93 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -260,4 +260,5 @@ paket-files/ | |
|
||
# Python Tools for Visual Studio (PTVS) | ||
__pycache__/ | ||
*.pyc | ||
*.pyc | ||
/Localizer/Plugins |
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,32 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Localizer.Attributes; | ||
|
||
namespace Localizer.DataModel.Default | ||
{ | ||
public class PrefixEntry : IEntry | ||
{ | ||
[TModLocalizeTextProp("DisplayName")] public BaseEntry Name { get; set; } | ||
|
||
public IEntry Clone() | ||
{ | ||
return new PrefixEntry {Name = Name.Clone() as BaseEntry}; | ||
} | ||
} | ||
|
||
public class BasicPrefixFile : IFile | ||
{ | ||
[TModLocalizeField("prefixes")] | ||
public Dictionary<string, PrefixEntry> Prefixes { get; set; } = new Dictionary<string, PrefixEntry>(); | ||
|
||
public List<string> GetKeys() | ||
{ | ||
return Prefixes.Keys.ToList(); | ||
} | ||
|
||
public IEntry GetValue(string key) | ||
{ | ||
return Prefixes[key]; | ||
} | ||
} | ||
} |
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,32 @@ | ||
using System.Collections.Generic; | ||
using System.Linq; | ||
using Localizer.Attributes; | ||
|
||
namespace Localizer.DataModel.Default | ||
{ | ||
public class ProjectileEntry : IEntry | ||
{ | ||
[TModLocalizeTextProp("DisplayName")] public BaseEntry Name { get; set; } | ||
|
||
public IEntry Clone() | ||
{ | ||
return new ProjectileEntry {Name = Name.Clone() as BaseEntry}; | ||
} | ||
} | ||
|
||
public class BasicProjectileFile : IFile | ||
{ | ||
[TModLocalizeField("projectiles")] | ||
public Dictionary<string, ProjectileEntry> Projectiles { get; set; } = new Dictionary<string, ProjectileEntry>(); | ||
|
||
public List<string> GetKeys() | ||
{ | ||
return Projectiles.Keys.ToList(); | ||
} | ||
|
||
public IEntry GetValue(string key) | ||
{ | ||
return Projectiles[key]; | ||
} | ||
} | ||
} |
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,45 @@ | ||
using System; | ||
|
||
namespace Localizer.DataModel.Default | ||
{ | ||
public class GitHubUpdateInfo : IUpdateInfo | ||
{ | ||
public UpdateType Type => type; | ||
|
||
public Version Version => version; | ||
|
||
private UpdateType type; | ||
private Version version; | ||
|
||
private string versionString; | ||
|
||
public GitHubUpdateInfo(string versionString) | ||
{ | ||
this.versionString = versionString; | ||
|
||
Parse(); | ||
} | ||
|
||
internal void Parse() | ||
{ | ||
type = ParseType(versionString[0]); | ||
|
||
version = Version.Parse(versionString.Substring(1, versionString.Length - 1)); | ||
} | ||
|
||
internal UpdateType ParseType(char t) | ||
{ | ||
switch (t) | ||
{ | ||
case 'a': | ||
return UpdateType.Minor; | ||
case 'b': | ||
return UpdateType.Major; | ||
case 'c': | ||
return UpdateType.Critical; | ||
default: | ||
return UpdateType.None; | ||
} | ||
} | ||
} | ||
} |
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,19 @@ | ||
using System; | ||
|
||
namespace Localizer.DataModel | ||
{ | ||
public enum UpdateType | ||
{ | ||
None, | ||
Minor, | ||
Major, | ||
Critical, | ||
} | ||
|
||
public interface IUpdateInfo | ||
{ | ||
UpdateType Type { get; } | ||
|
||
Version Version { get; } | ||
} | ||
} |
File renamed without changes.
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,22 @@ | ||
using System; | ||
using System.Reflection; | ||
using Terraria.ModLoader; | ||
using Terraria.UI; | ||
|
||
namespace Localizer | ||
{ | ||
public static class UI | ||
{ | ||
public static void ShowInfoMessage(string message, int gotoMenu, UIState state = null, string altButtonText = "", Action altButtonAction = null) | ||
{ | ||
|
||
} | ||
|
||
public static object GetModLoaderUI(string uiName) | ||
{ | ||
var ui = typeof(Mod).Module.GetType("Terraria.ModLoader.Interface"); | ||
|
||
return ui.GetField(uiName, BindingFlags.Static | BindingFlags.NonPublic).GetValue(null); | ||
} | ||
} | ||
} |
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
Oops, something went wrong.