Skip to content

Commit

Permalink
Merge branch 'master' of github.com:aedenthorn/StardewValleyMods
Browse files Browse the repository at this point in the history
  • Loading branch information
aedenthorn committed May 6, 2023
2 parents 14cb61f + cc4de61 commit 170ce36
Show file tree
Hide file tree
Showing 13 changed files with 105 additions and 24 deletions.
4 changes: 2 additions & 2 deletions AdditionalMineMaps/ModEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,13 @@ private void GameLoop_GameLaunched(object sender, StardewModdingAPI.Events.GameL

configMenu.AddBoolOption(
mod: ModManifest,
name: () => "Mod Enabled",
name: () => ModEntry.SHelper.Translation.Get("GMCM_Option_ModEnabled_Name"),
getValue: () => Config.ModEnabled,
setValue: value => Config.ModEnabled = value
);
configMenu.AddBoolOption(
mod: ModManifest,
name: () => "Allow Vanilla Maps",
name: () => ModEntry.SHelper.Translation.Get("GMCM_Option_AllowVanillaMaps_Name"),
getValue: () => Config.AllowVanillaMaps,
setValue: value => Config.AllowVanillaMaps = value
);
Expand Down
5 changes: 5 additions & 0 deletions AdditionalMineMaps/i18n/default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
// GMCM
"GMCM_Option_ModEnabled_Name": "Mod Enabled",
"GMCM_Option_AllowVanillaMaps_Name": "Allow Vanilla Maps",
}
5 changes: 5 additions & 0 deletions AdditionalMineMaps/i18n/fr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
// GMCM
"GMCM_Option_ModEnabled_Name": "Activer le Mod",
"GMCM_Option_AllowVanillaMaps_Name": "Autoriser les cartes de base",
}
2 changes: 1 addition & 1 deletion AdvancedCooking/CodePatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ private static void CraftingPage_Prefix(CraftingPage __instance, int x, int y, b
}
private static void CraftingPage_receiveLeftClick_Prefix(CraftingPage __instance, ref Item ___heldItem, int x, int y)
{
if (!Config.EnableMod || Game1.activeClickableMenu is not CraftingPage || !AccessTools.FieldRefAccess<CraftingPage, bool>(Game1.activeClickableMenu as CraftingPage, "cooking"))
if (!Config.EnableMod || Game1.activeClickableMenu is not CraftingPage || !AccessTools.FieldRefAccess<CraftingPage, bool>(Game1.activeClickableMenu as CraftingPage, "cooking") || ___heldItem is Tool)
return;
if (cookButton != null && cookButton.containsPoint(x, y))
{
Expand Down
32 changes: 19 additions & 13 deletions AdvancedCooking/ModEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -119,67 +119,67 @@ private void GameLoop_GameLaunched(object sender, StardewModdingAPI.Events.GameL
);
configMenu.AddKeybind(
mod: ModManifest,
name: () => "Cook All Mod Key",
name: () => ModEntry.SHelper.Translation.Get("GMCM_Option_CookAllModKey_Name"),
getValue: () => Config.CookAllModKey,
setValue: value => Config.CookAllModKey = value
);
configMenu.AddBoolOption(
mod: ModManifest,
name: () => "Store Held Item On Cook",
name: () => ModEntry.SHelper.Translation.Get("GMCM_Option_StoreOtherHeldItemOnCook_Name"),
getValue: () => Config.StoreOtherHeldItemOnCook,
setValue: value => Config.StoreOtherHeldItemOnCook = value
);
configMenu.AddBoolOption(
mod: ModManifest,
name: () => "Consume Ingredients On Fail",
name: () => ModEntry.SHelper.Translation.Get("GMCM_Option_ConsumeIngredientsOnFail_Name"),
getValue: () => Config.ConsumeIngredientsOnFail,
setValue: value => Config.ConsumeIngredientsOnFail = value
);
configMenu.AddBoolOption(
mod: ModManifest,
name: () => "Consume Excess On Success",
name: () => ModEntry.SHelper.Translation.Get("GMCM_Option_ConsumeExtraIngredientsOnSucceed_Name"),
getValue: () => Config.ConsumeExtraIngredientsOnSucceed,
setValue: value => Config.ConsumeExtraIngredientsOnSucceed = value
);
configMenu.AddBoolOption(
mod: ModManifest,
name: () => "Give Trash On Fail",
name: () => ModEntry.SHelper.Translation.Get("GMCM_Option_GiveTrashOnFail_Name"),
getValue: () => Config.GiveTrashOnFail,
setValue: value => Config.GiveTrashOnFail = value
);
configMenu.AddBoolOption(
mod: ModManifest,
name: () => "Allow Unknown Recipes",
name: () => ModEntry.SHelper.Translation.Get("GMCM_Option_AllowUnknownRecipes_Name"),
getValue: () => Config.AllowUnknownRecipes,
setValue: value => Config.AllowUnknownRecipes = value
);
configMenu.AddBoolOption(
mod: ModManifest,
name: () => "Learn Unknown Recipes",
name: () => ModEntry.SHelper.Translation.Get("GMCM_Option_LearnUnknownRecipes_Name"),
getValue: () => Config.LearnUnknownRecipes,
setValue: value => Config.LearnUnknownRecipes = value
);
configMenu.AddBoolOption(
mod: ModManifest,
name: () => "Show Product Info",
name: () => ModEntry.SHelper.Translation.Get("GMCM_Option_ShowProductInfo_Name"),
getValue: () => Config.ShowProductInfo,
setValue: value => Config.ShowProductInfo = value
);
configMenu.AddBoolOption(
mod: ModManifest,
name: () => "Show Cook Tooltip",
name: () => ModEntry.SHelper.Translation.Get("GMCM_Option_ShowCookTooltip_Name"),
getValue: () => Config.ShowCookTooltip,
setValue: value => Config.ShowCookTooltip = value
);
configMenu.AddBoolOption(
mod: ModManifest,
name: () => "Show Products In Tooltip",
name: () => ModEntry.SHelper.Translation.Get("GMCM_Option_ShowProductsInTooltip_Name"),
getValue: () => Config.ShowProductsInTooltip,
setValue: value => Config.ShowProductsInTooltip = value
);
configMenu.AddNumberOption(
mod: ModManifest,
name: () => "Height Offset",
name: () => ModEntry.SHelper.Translation.Get("GMCM_Option_YOffset_Name"),
getValue: () => Config.YOffset,
setValue: value => Config.YOffset = value
);
Expand All @@ -198,7 +198,8 @@ private static void DrawCookButtonTooltip()
text.Add(string.Format(SHelper.Translation.Get("plus-x-more"), keys.Length - i));
break;
}
text.Add(string.Format(SHelper.Translation.Get("x-of-y"), !SHelper.Input.IsDown(Config.CookAllModKey) ? 1 : currentCookables[keys[i]], keys[i]));
string[] recipeInfo = CraftingRecipe.cookingRecipes[keys[i]].Split('/');
text.Add(string.Format(SHelper.Translation.Get("x-of-y"), !SHelper.Input.IsDown(Config.CookAllModKey) ? 1 : currentCookables[keys[i]], (recipeInfo.Length > 4) ? recipeInfo[4] : keys[i]));
if (!SHelper.Input.IsDown(Config.CookAllModKey))
break;
}
Expand Down Expand Up @@ -475,7 +476,12 @@ private static void UpdateActualInventory(CraftingPage instance)
}
private static bool IsCorrectIngredient(Item item, int key)
{
return item is not null && !(item as Object).bigCraftable.Value && (((Object)item).ParentSheetIndex == key || ((Object)item).Category == key || CraftingRecipe.isThereSpecialIngredientRule((Object)item, key));
Object obj = item as Object;

if (obj is null)
return false;
else
return !obj.bigCraftable.Value && (obj.ParentSheetIndex == key || obj.Category == key || CraftingRecipe.isThereSpecialIngredientRule(obj, key));
}
}
}
15 changes: 14 additions & 1 deletion AdvancedCooking/i18n/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,18 @@
"cook": "Cook",
"x-of-y": "{0} {1}",
"player": "Player",
"fridge-x": "Fridge {0}"
"fridge-x": "Fridge {0}",

// GMCM
"GMCM_Option_CookAllModKey_Name": "Cook All Mod Key",
"GMCM_Option_StoreOtherHeldItemOnCook_Name": "Store Held Item On Cook",
"GMCM_Option_ConsumeIngredientsOnFail_Name": "Consume Ingredients On Fail",
"GMCM_Option_ConsumeExtraIngredientsOnSucceed_Name": "Consume Excess On Success",
"GMCM_Option_GiveTrashOnFail_Name": "Give Trash On Fail",
"GMCM_Option_AllowUnknownRecipes_Name": "Allow Unknown Recipes",
"GMCM_Option_LearnUnknownRecipes_Name": "Learn Unknown Recipes",
"GMCM_Option_ShowProductInfo_Name": "Show Product Info",
"GMCM_Option_ShowCookTooltip_Name": "Show Cook Tooltip",
"GMCM_Option_ShowProductsInTooltip_Name": "Show Products In Tooltip",
"GMCM_Option_YOffset_Name": "Height Offset"
}
26 changes: 26 additions & 0 deletions AdvancedCooking/i18n/fr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"new-recipe-x": "Vous avez appris à cuisiner {0} !",
"cooking-failed": "Vous n'avez pas réussi à cuisiner quoi que ce soit de comestible...",
"ingredients": "Ingrédients :",
"will-cook-1": "(cuisinera {0} objet)",
"will-cook-x": "(cuisinera {0} objets)",
"plus-x-more": "et {0} de plus",
"cannot-cook": "Impossible de cuisiner en tenant un autre objet !",
"cook": "Cuisiner",
"x-of-y": "{0} {1}",
"player": "Joueur",
"fridge-x": "Réfrigérateur {0}",

// GMCM
"GMCM_Option_CookAllModKey_Name": "Touche pour tout cuisiner",
"GMCM_Option_StoreOtherHeldItemOnCook_Name": "Stocker l'objet tenu lors de la cuisine",
"GMCM_Option_ConsumeIngredientsOnFail_Name": "Consommer les ingrédients en cas d'échec",
"GMCM_Option_ConsumeExtraIngredientsOnSucceed_Name": "Consommer l'excédent en cas de succès",
"GMCM_Option_GiveTrashOnFail_Name": "Donner des déchets en cas d'échec",
"GMCM_Option_AllowUnknownRecipes_Name": "Autoriser les recettes inconnues",
"GMCM_Option_LearnUnknownRecipes_Name": "Apprendre les recettes inconnues",
"GMCM_Option_ShowProductInfo_Name": "Afficher les informations sur les produits",
"GMCM_Option_ShowCookTooltip_Name": "Afficher l'infobulle de cuisine",
"GMCM_Option_ShowProductsInTooltip_Name": "Afficher les produits dans l'infobulle",
"GMCM_Option_YOffset_Name": "Décalage en hauteur"
}
4 changes: 2 additions & 2 deletions AdvancedDrumBlocks/ModEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ private void GameLoop_GameLaunched(object sender, StardewModdingAPI.Events.GameL

configMenu.AddBoolOption(
mod: ModManifest,
name: () => "Mod Enabled?",
name: () => ModEntry.SHelper.Translation.Get("GMCM_Option_ModEnabled_Name"),
getValue: () => Config.EnableMod,
setValue: value => Config.EnableMod = value
);
configMenu.AddKeybind(
mod: ModManifest,
name: () => "Index Mod Key",
name: () => ModEntry.SHelper.Translation.Get("GMCM_Option_IndexModKey_Name"),
getValue: () => Config.IndexModKey,
setValue: value => Config.IndexModKey = value
);
Expand Down
5 changes: 5 additions & 0 deletions AdvancedDrumBlocks/i18n/default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
// GMCM
"GMCM_Option_ModEnabled_Name": "Mod Enabled",
"GMCM_Option_IndexModKey_Name": "Index Mod Key"
}
5 changes: 5 additions & 0 deletions AdvancedDrumBlocks/i18n/fr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
// GMCM
"GMCM_Option_ModEnabled_Name": "Activer le Mod",
"GMCM_Option_IndexModKey_Name": "Touche pour modifier le timbre"
}
10 changes: 5 additions & 5 deletions AdvancedFluteBlocks/ModEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -125,29 +125,29 @@ private void GameLoop_GameLaunched(object sender, StardewModdingAPI.Events.GameL

configMenu.AddBoolOption(
mod: ModManifest,
name: () => "Mod Enabled?",
name: () => ModEntry.SHelper.Translation.Get("GMCM_Option_ModEnabled_Name"),
getValue: () => Config.EnableMod,
setValue: value => Config.EnableMod = value
);
configMenu.AddSectionTitle(
mod: ModManifest,
text: () => "Key Binds"
text: () => ModEntry.SHelper.Translation.Get("GMCM_SectionTitle_KeyBinds_Text")
);
configMenu.AddKeybind(
mod: ModManifest,
name: () => "Pitch Mod Key",
name: () => ModEntry.SHelper.Translation.Get("GMCM_Option_PitchModKey_Name"),
getValue: () => Config.PitchModKey,
setValue: value => Config.PitchModKey = value
);
configMenu.AddKeybind(
mod: ModManifest,
name: () => "Tone Mod Key",
name: () => ModEntry.SHelper.Translation.Get("GMCM_Option_ToneModKey_Name"),
getValue: () => Config.ToneModKey,
setValue: value => Config.ToneModKey = value
);
configMenu.AddNumberOption(
mod: ModManifest,
name: () => "Pitch Step",
name: () => ModEntry.SHelper.Translation.Get("GMCM_Option_PitchStep_Name"),
getValue: () => Config.PitchStep,
setValue: value => Config.PitchStep = value
);
Expand Down
8 changes: 8 additions & 0 deletions AdvancedFluteBlocks/i18n/default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
// GMCM
"GMCM_Option_ModEnabled_Name": "Mod Enabled",
"GMCM_SectionTitle_KeyBinds_Text": "Key Binds",
"GMCM_Option_PitchModKey_Name": "Pitch Mod Key",
"GMCM_Option_ToneModKey_Name": "Tone Mod Key",
"GMCM_Option_PitchStep_Name": "Pitch Step"
}
8 changes: 8 additions & 0 deletions AdvancedFluteBlocks/i18n/fr.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
// GMCM
"GMCM_Option_ModEnabled_Name": "Activer le Mod",
"GMCM_SectionTitle_KeyBinds_Text": "Raccourcis clavier",
"GMCM_Option_PitchModKey_Name": "Touche pour modifier la hauteur",
"GMCM_Option_ToneModKey_Name": "Touche pour modifier le timbre",
"GMCM_Option_PitchStep_Name": "Intervalle de la hauteur"
}

0 comments on commit 170ce36

Please sign in to comment.