Skip to content

Commit 5b9a40d

Browse files
committed
v2.7: new icon, new localization
1 parent 94b6d1d commit 5b9a40d

File tree

7 files changed

+103
-82
lines changed

7 files changed

+103
-82
lines changed

Config.cs

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88

99
namespace VanillaTweaks
1010
{
11+
//I should probably rewrite this whole thing but I'll get to it once tML officially supports config files.
12+
1113
public static class Config
1214
{
1315
static string ConfigPath = Path.Combine(Main.SavePath, "Mod Configs", "Vanilla Tweaks.json");
@@ -109,8 +111,40 @@ public static void Load()
109111
VanillaTweaks.Log("Old config folder still cotains some files/directories. They will not get deleted.");
110112
}
111113
if(!ReadConfig())
112-
VanillaTweaks.Log("Failed to read config file! Recreating config...");
113-
SaveConfig();
114+
{
115+
SetDefaults();
116+
VanillaTweaks.Log("Failed to read config file! Creating config...");
117+
SaveConfig();
118+
}
119+
}
120+
121+
public static void SetDefaults()
122+
{
123+
GladiatorArmorTweak = true;
124+
ObsidianArmorTweak = true;
125+
MeteorArmorDefenseTweak = true;
126+
MeteorArmorDamageTweak = true;
127+
EskimoArmorTweak = true;
128+
HammerTweaks = true;
129+
RainArmorTweak = true;
130+
NightsEdgeAutoswing = true;
131+
TrueSwordsAutoswing = true;
132+
SwatHelmetTweak = true;
133+
SkullTweak = true;
134+
FishBowlTweak = true;
135+
SandstoneRename = true;
136+
CobaltShieldRename = true;
137+
GoldCritterDropTweak = true;
138+
BoneBlockFix = true;
139+
ExtractSpeedMultiplier = 5f;
140+
JestersArrowCraft = 50;
141+
FavoriteTooltipRemove = true;
142+
WhoopieCushionTweak = true;
143+
CoinsTweak = true;
144+
MolotovCraft = 25;
145+
VikingHelmetTweak = true;
146+
CactusArmorTweak = true;
147+
PharaohSetTweak = true;
114148
}
115149

116150
public static bool ReadConfig()

LangTweaks.cs

Lines changed: 11 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -11,94 +11,27 @@ namespace VanillaTweaks
1111
{
1212
public static class LangTweaks
1313
{
14-
public static void AddText()
15-
{
16-
var mod = VanillaTweaks.Instance;
17-
var text = mod.CreateTranslation("ItemTooltip.ObsidianArmor");
18-
text.SetDefault("3% increased ranged critical strike chance");
19-
text.AddTranslation(GameCulture.Russian, "Увеличивает шанс крит. удара в дальнем бою на 3%");
20-
mod.AddTranslation(text);
21-
text = mod.CreateTranslation("ItemTooltip.SwatHelmet");
22-
text.SetDefault("15% increased ranged damage\n10% increased ranged critical strike chance");
23-
text.AddTranslation(GameCulture.Russian, "Увеличивает урон в дальнем бою на 15%\nУвеличивает шанс крит. удара в дальнем бою на 3%");
24-
mod.AddTranslation(text);
25-
text = mod.CreateTranslation("ItemTooltip.Eskimo");
26-
text.SetDefault("Allows touching cold water without freezing");
27-
text.AddTranslation(GameCulture.Russian, "Повзоляет прикасаться к холодной воде, не замерзая");
28-
mod.AddTranslation(text);
29-
text = mod.CreateTranslation("ItemTooltip.Pharaoh");
30-
text.SetDefault("Increases minion damage by 5%");
31-
text.AddTranslation(GameCulture.Russian, "Увеличивает урон питомцев на 5%"); //каких нахуй питомцев?
32-
mod.AddTranslation(text);
33-
34-
text = mod.CreateTranslation("ArmorSet.Obsidian");
35-
text.SetDefault("10% increased movement speed");
36-
text.AddTranslation(GameCulture.Russian, "Увеличивает скорость движения на 10%");
37-
mod.AddTranslation(text);
38-
text = mod.CreateTranslation("ArmorSet.Gladiator");
39-
text.SetDefault("15% increased critical strike chance");
40-
text.AddTranslation(GameCulture.Russian, "Увеличивает шанс крит. удара на 15%");
41-
mod.AddTranslation(text);
42-
text = mod.CreateTranslation("ArmorSet.Rain");
43-
text.SetDefault("1 defense\nGrants immunity to Water Guns");
44-
text.AddTranslation(GameCulture.Russian, "1 ед. защиты\nДаёт невосприимчивость к Водяному пистолету");
45-
mod.AddTranslation(text);
46-
text = mod.CreateTranslation("ArmorSet.Swat");
47-
text.SetDefault("Reduces damage taken by 25%\n20% increased ranged damage and chance not to consume ammo");
48-
text.AddTranslation(GameCulture.Russian, "Получаемый урон снижен на 25%\nУвеличивает урон в дальнем бою на 20%\nШанс 20 % не потратить боеприпасы");
49-
mod.AddTranslation(text);
50-
text = mod.CreateTranslation("ArmorSet.Eskimo");
51-
text.SetDefault("4 defense\nProvides warmth and immunity to chill, frostburn and freezing effects");
52-
text.AddTranslation(GameCulture.Russian, "4 ед. защиты\nДаёт тепло и защищает от замораживающих эффектов и ледяного ожога");
53-
mod.AddTranslation(text);
54-
text = mod.CreateTranslation("ArmorSet.Viking");
55-
text.SetDefault("5% increased damage");
56-
text.AddTranslation(GameCulture.Russian, "Увеличивает урон в ближнем бою на 5%");
57-
mod.AddTranslation(text);
58-
text = mod.CreateTranslation("ArmorSet.Cactus");
59-
text.SetDefault("Attackers also take damage");
60-
text.AddTranslation(GameCulture.Russian, "Атакующие тоже получают урон");
61-
mod.AddTranslation(text);
62-
text = mod.CreateTranslation("ArmorSet.Pharaoh");
63-
text.SetDefault("Increases your max number of minions");
64-
text.AddTranslation(GameCulture.Russian, "Увеличивает ваше максимальное количество питомцев");
65-
mod.AddTranslation(text);
66-
}
67-
6814
public static void EditNames(LanguageManager manager)
6915
{
7016
var bindFlags = BindingFlags.Instance | BindingFlags.NonPublic;
7117
var textValueMethod = typeof(LocalizedText).GetMethod("SetValue", bindFlags);
72-
73-
/* Translation Start */
74-
if(manager.ActiveCulture == GameCulture.English)
18+
19+
if(Config.CobaltShieldRename)
7520
{
76-
if(Config.CobaltShieldRename)
77-
{
78-
textValueMethod.Invoke(Lang.GetItemName(ItemID.CobaltShield), new object[]{ "Guardian's Shield" });
79-
}
80-
if(Config.SandstoneRename)
81-
{
82-
textValueMethod.Invoke(Lang.GetItemName(ItemID.SandstoneBrick), new object[]{ "Sand Brick" });
83-
textValueMethod.Invoke(Lang.GetItemName(ItemID.SandstoneBrickWall), new object[]{ "Sand Brick Wall" });
84-
textValueMethod.Invoke(Lang.GetItemName(ItemID.SandstoneSlab), new object[]{ "Sand Slab" });
85-
if(VanillaTweaks.MiscellaniaLoaded)
86-
{
87-
int type = ModLoader.GetMod("GoldensMisc").ItemType("SandstoneSlabWall");
88-
if(type > 0)
89-
textValueMethod.Invoke(Lang.GetItemName(type), new object[]{ "Sand Slab Wall"});
90-
}
91-
}
21+
textValueMethod.Invoke(Lang.GetItemName(ItemID.CobaltShield), new object[]{ Language.GetTextValue("Mods.GoldensMisc.ItemName.CobaltShield") });
9222
}
93-
else if(manager.ActiveCulture == GameCulture.Russian)
23+
if(Config.SandstoneRename && manager.ActiveCulture != GameCulture.Russian)
9424
{
95-
if(Config.CobaltShieldRename)
25+
textValueMethod.Invoke(Lang.GetItemName(ItemID.SandstoneBrick), new object[]{ Language.GetTextValue("Mods.GoldensMisc.ItemName.SandstoneBrick") });
26+
textValueMethod.Invoke(Lang.GetItemName(ItemID.SandstoneBrickWall), new object[]{ Language.GetTextValue("Mods.GoldensMisc.ItemName.SandstoneBrickWall") });
27+
textValueMethod.Invoke(Lang.GetItemName(ItemID.SandstoneSlab), new object[]{ Language.GetTextValue("Mods.GoldensMisc.ItemName.SandstoneSlab") });
28+
if(VanillaTweaks.MiscellaniaLoaded)
9629
{
97-
textValueMethod.Invoke(Lang.GetItemName(ItemID.CobaltShield), new object[]{ "Щит хранителя" });
30+
int type = ModLoader.GetMod("GoldensMisc").ItemType("SandstoneSlabWall");
31+
if(type > 0)
32+
textValueMethod.Invoke(Lang.GetItemName(type), new object[]{ Language.GetTextValue("Mods.GoldensMisc.ItemName.SandstoneSlabWall") });
9833
}
99-
//Sandstone stuff actually has correct names in Russian
10034
}
101-
/* Translation End */
10235
}
10336

10437
public static void EditTooltips(LanguageManager manager)

Localization/en-US.lang

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
ItemTooltip.ObsidianArmor=3% increased ranged critical strike chance
2+
ItemTooltip.SwatHelmet=15% increased ranged damage\n10% increased ranged critical strike chance
3+
ItemTooltip.Eskimo=Allows touching cold water without freezing
4+
ItemTooltip.Pharaoh=Increases minion damage by 5%
5+
6+
ArmorSet.Obsidian=10% increased movement speed
7+
ArmorSet.Gladiator=15% increased critical strike chance
8+
ArmorSet.Rain=1 defense\nGrants immunity to Water Guns
9+
ArmorSet.Swat=Reduces damage taken by 25%\n20% increased ranged damage and chance not to consume ammo
10+
ArmorSet.Eskimo=4 defense\nProvides warmth and immunity to chill, frostburn and freezing effects
11+
ArmorSet.Viking=5% increased damage
12+
ArmorSet.Cactus=Attackers also take damage
13+
ArmorSet.Pharaoh=Increases your max number of minions
14+
15+
ItemName.CobaltShield=Guardian's Shield
16+
ItemName.SandstoneBrick=Sand Brick
17+
ItemName.SandstoneBrickWall=Sand Brick Wall
18+
ItemName.SandstoneSlab=Sand Slab
19+
ItemName.SandstoneSlabWall=Sand Slab Wall

Localization/ru-RU.lang

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
ItemTooltip.ObsidianArmor=Увеличивает шанс крит. удара в дальнем бою на 3%
2+
ItemTooltip.SwatHelmet=Увеличивает урон в дальнем бою на 15%\nУвеличивает шанс крит. удара в дальнем бою на 10%
3+
ItemTooltip.Eskimo=Повзоляет прикасаться к холодной воде, не замерзая
4+
ItemTooltip.Pharaoh=Увеличивает урон питомцев на 5%
5+
6+
ArmorSet.Obsidian=Увеличивает скорость движения на 10%
7+
ArmorSet.Gladiator=Увеличивает шанс крит. удара на 15%
8+
ArmorSet.Rain=1 ед. защиты\nДаёт невосприимчивость к Водяному пистолету
9+
ArmorSet.Swat=Получаемый урон снижен на 25%\nУвеличивает урон в дальнем бою на 20%\nШанс 20% не потратить боеприпасы
10+
ArmorSet.Eskimo=4 ед. защиты\nДаёт тепло, защищает от замораживающих эффектов и ледяного ожога
11+
ArmorSet.Viking=Увеличивает урон на 5%
12+
ArmorSet.Cactus=Атакующие тоже получают урон
13+
ArmorSet.Pharaoh=Увеличивает ваше максимальное количество питомцев
14+
15+
ItemName.CobaltShield=Щит хранителя
16+
Песчаниковые блоки в русском языке не меняют названия.

VanillaTweaks.cs

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ public override void Load()
2626

2727
LanguageManager.Instance.OnLanguageChanged += LangTweaks.EditNames;
2828
LanguageManager.Instance.OnLanguageChanged += LangTweaks.EditTooltips;
29-
LangTweaks.AddText();
3029
}
3130

3231
public override void AddRecipes()
@@ -58,5 +57,25 @@ public static void Log(string message, params object[] formatData)
5857
{
5958
ErrorLogger.Log(String.Format("[Vanilla Tweaks][{0}] {1}", DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss"), string.Format(message, formatData)));
6059
}
60+
61+
#region Hamstar's Mod Helpers integration
62+
63+
public static string GithubUserName { get { return "goldenapple3"; } }
64+
public static string GithubProjectName { get { return "VanillaTweaks"; } }
65+
66+
public static string ConfigFileRelativePath { get { return "Mod Configs/Vanilla Tweaks.json"; } }
67+
68+
public static void ReloadConfigFromFile()
69+
{
70+
Config.ReadConfig();
71+
}
72+
73+
public static void ResetConfigFromDefaults()
74+
{
75+
Config.SetDefaults();
76+
Config.SaveConfig();
77+
}
78+
79+
#endregion
6180
}
6281
}

build.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
displayName = Vanilla Tweaks
22
author = goldenapple
3-
version = 2.6.1
3+
version = 2.7
44
homepage = http://forums.terraria.org/index.php?threads/vanilla-tweaks-a-mod-with-no-content.37443/
55
hideCode = false
66
includeSource = true

icon.png

1.28 KB
Loading

0 commit comments

Comments
 (0)