Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add shimmer transmutations to the recipe browser #142

Open
wants to merge 4 commits into
base: 1.4
Choose a base branch
from
Open
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
18 changes: 9 additions & 9 deletions Localization/TranslationsNeeded.txt
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
en-US, 95/95, 100%, missing 0
de-DE, 28/95, 29%, missing 67
it-IT, 28/95, 29%, missing 67
fr-FR, 28/95, 29%, missing 67
es-ES, 49/95, 52%, missing 46
ru-RU, 80/95, 84%, missing 15
zh-Hans, 95/95, 100%, missing 0
pt-BR, 95/95, 100%, missing 0
pl-PL, 80/95, 84%, missing 15
en-US, 96/96, 100%, missing 0
de-DE, 28/96, 29%, missing 68
it-IT, 28/96, 29%, missing 68
fr-FR, 28/96, 29%, missing 68
es-ES, 49/96, 51%, missing 47
ru-RU, 80/96, 83%, missing 16
zh-Hans, 95/96, 99%, missing 1
pt-BR, 95/96, 99%, missing 1
pl-PL, 80/96, 83%, missing 16
2 changes: 2 additions & 0 deletions Localization/de-DE.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -207,5 +207,7 @@ Mods: {
}
}
}

// Conditions.ShimmerTransmutation: Shimmer Transmutation
}
}
2 changes: 2 additions & 0 deletions Localization/en-US.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,7 @@ Mods: {
}
}
}

Conditions.ShimmerTransmutation: Shimmer Transmutation
}
}
2 changes: 2 additions & 0 deletions Localization/es-ES.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -207,5 +207,7 @@ Mods: {
}
}
}

// Conditions.ShimmerTransmutation: Shimmer Transmutation
}
}
2 changes: 2 additions & 0 deletions Localization/fr-FR.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -207,5 +207,7 @@ Mods: {
}
}
}

// Conditions.ShimmerTransmutation: Shimmer Transmutation
}
}
2 changes: 2 additions & 0 deletions Localization/it-IT.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -207,5 +207,7 @@ Mods: {
}
}
}

// Conditions.ShimmerTransmutation: Shimmer Transmutation
}
}
2 changes: 2 additions & 0 deletions Localization/pl-PL.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -207,5 +207,7 @@ Mods: {
}
}
}

// Conditions.ShimmerTransmutation: Shimmer Transmutation
}
}
2 changes: 2 additions & 0 deletions Localization/pt-BR.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -207,5 +207,7 @@ Mods: {
}
}
}

// Conditions.ShimmerTransmutation: Shimmer Transmutation
}
}
2 changes: 2 additions & 0 deletions Localization/ru-RU.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -207,5 +207,7 @@ Mods: {
}
}
}

// Conditions.ShimmerTransmutation: Shimmer Transmutation
}
}
2 changes: 2 additions & 0 deletions Localization/zh-Hans.hjson
Original file line number Diff line number Diff line change
Expand Up @@ -211,5 +211,7 @@ Mods: {
}
}
}

// Conditions.ShimmerTransmutation: Shimmer Transmutation
}
}
2 changes: 1 addition & 1 deletion RecipeBrowserGlobalItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public override void ModifyTooltips(Item item, List<TooltipLine> tooltips) {
if (RecipeCatalogueUI.instance.hoveredIndex < 0) return;

var selectedModRecipe = Main.recipe[RecipeCatalogueUI.instance.hoveredIndex];
if (selectedModRecipe.Mod != null && ModContent.GetInstance<RecipeBrowserClientConfig>().ShowRecipeModSource && item.type == selectedModRecipe.createItem.type)
if (selectedModRecipe.Mod != null && selectedModRecipe.Mod != Mod && ModContent.GetInstance<RecipeBrowserClientConfig>().ShowRecipeModSource && item.type == selectedModRecipe.createItem.type)
{
var line = new TooltipLine(Mod, "RecipeBrowser:RecipeOriginHint", "Recipe added by " + selectedModRecipe.Mod.DisplayName)
{
Expand Down
2 changes: 1 addition & 1 deletion UIElements/UIRecipeInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ protected override void DrawSelf(SpriteBatch spriteBatch)
int row = 0;
int tileIndex = 0;
bool comma = false;
if(selectedRecipe.requiredTile.Count == 0) {
if(selectedRecipe.requiredTile.Count == 0 && selectedRecipe.Conditions.Count == 0) {
sb.Append($"{(comma ? ", " : "")}[c/{Utilities.textColor.Hex3()}:{Language.GetTextValue("LegacyInterface.23")}]");
sbTiles.Append($"{(comma ? ", " : "")}[c/{Utilities.textColor.Hex3()}:{Language.GetTextValue("LegacyInterface.23")}]");
comma = true;
Expand Down
70 changes: 69 additions & 1 deletion UISystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,75 @@ public class UISystem : ModSystem

public override void PreSaveAndQuit() => RecipeBrowser.instance.PreSaveAndQuit();

public override void PostAddRecipes()
public override void AddRecipes() {
Condition shimmerTransmutationCondition = new("Mods.RecipeBrowser.Conditions.ShimmerTransmutation", () => false);
for (int i = 0; i < ItemID.Sets.ShimmerTransformToItem.Length; i++) {
// For some reason this is set initially but gets overriden later on
// So I'll skip it
if (i == ItemID.LihzahrdBrickWall)
continue;
int shimmerTransmutation = ItemID.Sets.ShimmerTransformToItem[i];
if (shimmerTransmutation > 0) {
Recipe.Create(shimmerTransmutation)
.AddIngredient(i)
.AddCondition(shimmerTransmutationCondition)
.Register();
}
}

// Fix for vanilla hardcoded transmutations
Recipe.Create(ItemID.RodOfHarmony)
.AddIngredient(ItemID.RodofDiscord)
.AddCondition(shimmerTransmutationCondition)
.AddCondition(Condition.DownedMoonLord)
.Register();

Recipe.Create(ItemID.Clentaminator2)
.AddIngredient(ItemID.Clentaminator)
.AddCondition(shimmerTransmutationCondition)
.AddCondition(Condition.DownedMoonLord)
.Register();

Recipe.Create(ItemID.BottomlessBucket)
.AddIngredient(ItemID.BottomlessShimmerBucket)
.AddCondition(shimmerTransmutationCondition)
.AddCondition(Condition.DownedMoonLord)
.Register();

Recipe.Create(ItemID.BottomlessShimmerBucket)
.AddIngredient(ItemID.BottomlessBucket)
.AddCondition(shimmerTransmutationCondition)
.AddCondition(Condition.DownedMoonLord)
.Register();

Recipe.Create(ItemID.LihzahrdWallUnsafe)
.AddIngredient(ItemID.LihzahrdBrickWall)
.AddCondition(shimmerTransmutationCondition)
.AddCondition(Condition.DownedGolem)
.Register();

List<KeyValuePair<int, Condition>> luminiteBrickTransmutations = new() {
new KeyValuePair<int, Condition>(ItemID.HeavenforgeBrick, Condition.MoonPhaseFull),
new KeyValuePair<int, Condition>(ItemID.LunarRustBrick, Condition.MoonPhaseWaningGibbous),
new KeyValuePair<int, Condition>(ItemID.AstraBrick, Condition.MoonPhaseThirdQuarter),
new KeyValuePair<int, Condition>(ItemID.DarkCelestialBrick, Condition.MoonPhaseWaningCrescent),
new KeyValuePair<int, Condition>(ItemID.MercuryBrick, Condition.MoonPhaseNew),
new KeyValuePair<int, Condition>(ItemID.StarRoyaleBrick, Condition.MoonPhaseWaxingCrescent),
new KeyValuePair<int, Condition>(ItemID.CryocoreBrick, Condition.MoonPhaseFirstQuarter),
new KeyValuePair<int, Condition>(ItemID.CosmicEmberBrick, Condition.MoonPhaseWaxingGibbous)
};

foreach (var item in luminiteBrickTransmutations)
{
Recipe.Create(item.Key)
.AddIngredient(ItemID.LunarBrick)
.AddCondition(shimmerTransmutationCondition)
.AddCondition(item.Value)
.Register();
}
}

public override void PostAddRecipes()
{
if (!Main.dedServ) {
LootCacheManager.Setup(RecipeBrowser.instance);
Expand Down