Skip to content

Commit

Permalink
etc
Browse files Browse the repository at this point in the history
  • Loading branch information
aedenthorn committed Feb 13, 2022
1 parent f55f44b commit f9a29e2
Show file tree
Hide file tree
Showing 34 changed files with 546 additions and 98 deletions.
6 changes: 3 additions & 3 deletions FreeLove/LocationPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ public static bool FarmHouse_getSpouseBedSpot_Prefix(FarmHouse __instance, strin
{
try
{
if (!Config.EnableMod)
if (spouseName == null || !Config.EnableMod)
return true;
var spouses = Misc.GetSpouses(__instance.owner, true);

if (!spouses.ContainsKey(spouseName) || spouses[spouseName].isMoving() || !Misc.IsInBed(__instance, spouses[spouseName].GetBoundingBox()))
if (!spouses.TryGetValue(spouseName, out NPC spouse) || spouse is null || spouse.isMoving() || !Misc.IsInBed(__instance, spouse.GetBoundingBox()))
return true;

__result = spouses[spouseName].getTileLocationPoint();
__result = spouse.getTileLocationPoint();
return false;
}
catch (Exception ex)
Expand Down
2 changes: 2 additions & 0 deletions FreeLove/Pregnancy.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ public static bool Utility_pickPersonalFarmEvent_Prefix(ref FarmEvent __result)
}
foreach (NPC spouse in allSpouses)
{
if (spouse == null)
continue;
Farmer f = spouse.getSpouse();
if (!ModEntry.Config.RoommateRomance && f.friendshipData[spouse.Name].RoommateMarriage)
continue;
Expand Down
24 changes: 24 additions & 0 deletions FreeLove/i18n/es.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,28 @@
{
"confrontation-female": "¡Tendrás que casarte con todas nosotras!",
"confrontation-male": "¡Tendrás que casarte con todos nosotros!",
"divorce_who": "¿De quien te quieres divorciar?",
"divorce_complex": "Es complicado...",
"divorce_fault_q": "¿De quien es la culpa del divorcio?",
"divorce_fault_1": "Yo soy culpable.#my_#1",
"divorce_fault_2": "La culpa es de mi esposa.#their_#3",
"divorce_fault_3": "Es todo culpa de Yoba!#yoba_#1",
"divorce_fault_4": "El divorcio no es culpa de nadie.#no_#0",
"divorce_my_reason_q": "¿Porque tienes la culpa?",
"divorce_my_reason_1": "He engañado a mi esposa.#3",
"divorce_my_reason_2": "Me he enamorado de otra persona.#2",
"divorce_my_reason_3": "No amo a mi esposa tanto como me ama a mi.#0",
"divorce_their_reason_q": "¿Quienes son culpable?",
"divorce_their_reason_1": "Mi esposa me ha engañado.#3",
"divorce_their_reason_2": "Creo que mi esposa me esta engañando.#2",
"divorce_their_reason_3": "Mi esposa ya no me quiere.#1",
"divorce_yoba_reason_q": "¿Que te hizo Yoba?",
"divorce_yoba_reason_1": "Yoba tuvo una aventura con mi mujer.#3",
"divorce_yoba_reason_2": "Yoba maldijo mi matrimonio.#0",
"divorce_yoba_reason_3": "Mi mujer quiere a Yoba más que a mi.#1",
"divorce_method_q": "¿Quien debería pagar el divorcio?",
"divorce_method_1": "Yo quiero pagar el divorcio.#100#0",
"divorce_method_2": "Deberíamos ir a medias con los costes del divorcio 50/50.#50#2",
"divorce_method_3": "Quiero hacer que mi esposa pague el divorcio.#0#4",
"divorce_method_4": "Yoba debería pagar el divorcio.#150#0"
}
2 changes: 1 addition & 1 deletion FreeLove/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Name": "Free Love",
"Author": "aedenthorn",
"Version": "0.8.3",
"Version": "0.8.4",
"Description": "Free Love",
"UniqueID": "aedenthorn.FreeLove",
"EntryDll": "FreeLove.dll",
Expand Down
75 changes: 75 additions & 0 deletions InstanceEditor/IGenericModConfigMenuApi.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
using StardewModdingAPI;
using System;

namespace InstanceEditor
{
/// <summary>The API which lets other mods add a config UI through Generic Mod Config Menu.</summary>
public interface IGenericModConfigMenuApi
{
/*********
** Methods
*********/
/****
** Must be called first
****/
/// <summary>Register a mod whose config can be edited through the UI.</summary>
/// <param name="mod">The mod's manifest.</param>
/// <param name="reset">Reset the mod's config to its default values.</param>
/// <param name="save">Save the mod's current config to the <c>config.json</c> file.</param>
/// <param name="titleScreenOnly">Whether the options can only be edited from the title screen.</param>
/// <remarks>Each mod can only be registered once, unless it's deleted via <see cref="Unregister"/> before calling this again.</remarks>
void Register(IManifest mod, Action reset, Action save, bool titleScreenOnly = false);

/// <summary>Add a section title at the current position in the form.</summary>
/// <param name="mod">The mod's manifest.</param>
/// <param name="text">The title text shown in the form.</param>
/// <param name="tooltip">The tooltip text shown when the cursor hovers on the title, or <c>null</c> to disable the tooltip.</param>
void AddSectionTitle(IManifest mod, Func<string> text, Func<string> tooltip = null);

/// <summary>Add a key binding at the current position in the form.</summary>
/// <param name="mod">The mod's manifest.</param>
/// <param name="getValue">Get the current value from the mod config.</param>
/// <param name="setValue">Set a new value in the mod config.</param>
/// <param name="name">The label text to show in the form.</param>
/// <param name="tooltip">The tooltip text shown when the cursor hovers on the field, or <c>null</c> to disable the tooltip.</param>
/// <param name="fieldId">The unique field ID for use with <see cref="OnFieldChanged"/>, or <c>null</c> to auto-generate a randomized ID.</param>
void AddKeybind(IManifest mod, Func<SButton> getValue, Action<SButton> setValue, Func<string> name, Func<string> tooltip = null, string fieldId = null);

/// <summary>Add a boolean option at the current position in the form.</summary>
/// <param name="mod">The mod's manifest.</param>
/// <param name="getValue">Get the current value from the mod config.</param>
/// <param name="setValue">Set a new value in the mod config.</param>
/// <param name="name">The label text to show in the form.</param>
/// <param name="tooltip">The tooltip text shown when the cursor hovers on the field, or <c>null</c> to disable the tooltip.</param>
/// <param name="fieldId">The unique field ID for use with <see cref="OnFieldChanged"/>, or <c>null</c> to auto-generate a randomized ID.</param>
void AddBoolOption(IManifest mod, Func<bool> getValue, Action<bool> setValue, Func<string> name, Func<string> tooltip = null, string fieldId = null);


/// <summary>Add an integer option at the current position in the form.</summary>
/// <param name="mod">The mod's manifest.</param>
/// <param name="getValue">Get the current value from the mod config.</param>
/// <param name="setValue">Set a new value in the mod config.</param>
/// <param name="name">The label text to show in the form.</param>
/// <param name="tooltip">The tooltip text shown when the cursor hovers on the field, or <c>null</c> to disable the tooltip.</param>
/// <param name="min">The minimum allowed value, or <c>null</c> to allow any.</param>
/// <param name="max">The maximum allowed value, or <c>null</c> to allow any.</param>
/// <param name="interval">The interval of values that can be selected.</param>
/// <param name="fieldId">The unique field ID for use with <see cref="OnFieldChanged"/>, or <c>null</c> to auto-generate a randomized ID.</param>
void AddNumberOption(IManifest mod, Func<int> getValue, Action<int> setValue, Func<string> name, Func<string> tooltip = null, int? min = null, int? max = null, int? interval = null, string fieldId = null);

/// <summary>Add a string option at the current position in the form.</summary>
/// <param name="mod">The mod's manifest.</param>
/// <param name="getValue">Get the current value from the mod config.</param>
/// <param name="setValue">Set a new value in the mod config.</param>
/// <param name="name">The label text to show in the form.</param>
/// <param name="tooltip">The tooltip text shown when the cursor hovers on the field, or <c>null</c> to disable the tooltip.</param>
/// <param name="allowedValues">The values that can be selected, or <c>null</c> to allow any.</param>
/// <param name="formatAllowedValue">Get the display text to show for a value from <paramref name="allowedValues"/>, or <c>null</c> to show the values as-is.</param>
/// <param name="fieldId">The unique field ID for use with <see cref="OnFieldChanged"/>, or <c>null</c> to auto-generate a randomized ID.</param>
void AddTextOption(IManifest mod, Func<string> getValue, Action<string> setValue, Func<string> name, Func<string> tooltip = null, string[] allowedValues = null, Func<string, string> formatAllowedValue = null, string fieldId = null);

/// <summary>Remove a mod from the config UI and delete all its options and pages.</summary>
/// <param name="mod">The mod's manifest.</param>
void Unregister(IManifest mod);
}
}
23 changes: 23 additions & 0 deletions InstanceEditor/InstanceEditData.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using HarmonyLib;
using StardewValley;
using System;
using System.Collections.Generic;
using System.Reflection;

namespace InstanceEditor
{
public class InstanceEditData
{
public string className = "";
public Dictionary<string, FieldEditData> matchFields = new Dictionary<string, FieldEditData>();
public Dictionary<string, FieldEditData> changeFields = new Dictionary<string, FieldEditData>();
public string[] checks = new string[] { };
}

public class FieldEditData
{
public object value;
public FieldInfo fieldInfo;
public Dictionary<string, object> fields;
}
}
26 changes: 26 additions & 0 deletions InstanceEditor/InstanceEditor.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Version>1.0.0</Version>
<TargetFramework>net5.0</TargetFramework>
<EnableHarmony>true</EnableHarmony>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Pathoschild.Stardew.ModBuildConfig" Version="4.0.0" />
</ItemGroup>

<ItemGroup>
<None Update="assets\horse.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="assets\numbers.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="assets\tracks.png">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
<None Update="manifest.json">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
10 changes: 10 additions & 0 deletions InstanceEditor/ModConfig.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@

using StardewModdingAPI;

namespace InstanceEditor
{
public class ModConfig
{
public bool EnableMod { get; set; } = true;
}
}
Loading

0 comments on commit f9a29e2

Please sign in to comment.