Skip to content

Commit

Permalink
patio, teleport
Browse files Browse the repository at this point in the history
  • Loading branch information
aedenthorn committed Jan 23, 2021
1 parent c105c06 commit f64365b
Show file tree
Hide file tree
Showing 15 changed files with 65 additions and 36 deletions.
1 change: 0 additions & 1 deletion CustomSpousePatio/CustomSpousePatioApi.cs
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
using Microsoft.Xna.Framework;
using StardewModdingAPI;
using StardewValley;
using StardewValley.Objects;
using System.Collections.Generic;
using System.IO;

Expand Down
1 change: 0 additions & 1 deletion CustomSpousePatio/ModConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,5 @@ namespace CustomSpousePatio
public class ModConfig
{
public bool EnableMod { get; set; } = true;
public SButton PatioWizardKey { get; set; } = SButton.F8;
}
}
20 changes: 15 additions & 5 deletions CustomSpousePatio/ModEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,15 @@ public static void LoadSpouseAreaData()

}
}
else
else if(!outdoorAreas.ContainsKey(area.Key))
{
outdoorAreas[area.Key] = area.Value;
SMonitor.Log($"Added outdoor area at {area.Value.location} or {area.Value.GetLocation()} for {area.Key}", LogLevel.Debug);
}
else
{
SMonitor.Log($"Outdoor area already exists for {area.Key}, not adding duplicate from content pack", LogLevel.Debug);
}
}
}
if(json.tileSheetsToAdd != null)
Expand Down Expand Up @@ -244,6 +248,7 @@ public static void AddTileSheets()
{
Texture2D tex = SHelper.Content.Load<Texture2D>("Maps/spring_outdoorsTileSheet", ContentSource.GameContent);
farm.map.AddTileSheet(new TileSheet("zzz_custom_spouse_default_patio", farm.map, SHelper.Content.GetActualAssetKey("Maps/spring_outdoorsTileSheet", ContentSource.GameContent), new Size(tex.Width / 16, tex.Height / 16), new Size(16, 16)));
farm.map.LoadTileSheets(Game1.mapDisplayDevice);
SMonitor.Log($"Added default tilesheet zzz_custom_spouse_default_patio to farm map", LogLevel.Debug);
}

Expand Down Expand Up @@ -357,15 +362,14 @@ public static void ShowSpouseAreas() {
specialTiles = new List<SpecialTile>(area.specialTiles);
}

SMonitor.Log($"Adding spouse area for {spouse}: use default tiles: {useDefaultTiles}, special tiles: {specialTiles.Count}", LogLevel.Debug);


SMonitor.Log($"Adding spouse area for {spouse}: use default tiles: {useDefaultTiles}, special tiles: {specialTiles.Count}");

if (farm.map.Layers[0].LayerWidth <= x + 3 || farm.map.Layers[0].LayerHeight <= y + 3)
{
SMonitor.Log($"Invalid spouse area coordinates {x},{y} for {spouse}", LogLevel.Error);
SMonitor.Log($"Invalid spouse area coordinates {x},{y} for {spouse}", LogLevel.Error);
continue;
}

/*
farm.removeTile(x + 1, y + 3, "Buildings");
farm.removeTile(x + 2, y + 3, "Buildings");
Expand All @@ -388,6 +392,12 @@ public static void ShowSpouseAreas() {
{
TileSheet defaultTilesheet = farm.Map.GetTileSheet("zzz_custom_spouse_default_patio");
int sheetIdx = farm.Map.TileSheets.IndexOf(defaultTilesheet);
SMonitor.Log($"Default custom tilesheet index: {sheetIdx}");
if(sheetIdx == -1)
{
AddTileSheets();
sheetIdx = farm.Map.TileSheets.IndexOf(defaultTilesheet);
}

string which = area.useTilesOf != null ? area.useTilesOf : spouse;

Expand Down
2 changes: 1 addition & 1 deletion CustomSpousePatio/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Name": "Custom Spouse Patio",
"Author": "aedenthorn",
"Version": "0.7.0",
"Version": "0.7.2",
"Description": "Lets you create a custom spouse patio.",
"UniqueID": "aedenthorn.CustomSpousePatio",
"EntryDll": "CustomSpousePatio.dll",
Expand Down
2 changes: 1 addition & 1 deletion CustomSpousePatioWizard/ICustomSpousePatioApi.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ public interface ICustomSpousePatioApi
Dictionary<string, object> GetCurrentSpouseAreas();
Dictionary<string, int[]> GetDefaultSpouseOffsets();
void RemoveAllSpouseAreas();
void ReloadSpouseAreaData();
void ReloadSpouseAreaData();
void AddTileSheets();
void ShowSpouseAreas();
void ReloadPatios();
Expand Down
2 changes: 1 addition & 1 deletion MapTeleport/ModConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ namespace MapTeleport
public class ModConfig
{
public bool EnableMod { get; set; } = true;
public SButton TeleportKey { get; set; } = SButton.W;
public SButton TeleportKey { get; set; } = SButton.MouseLeft;
}
}
5 changes: 2 additions & 3 deletions MapTeleport/ModEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,10 @@ public override void Entry(IModHelper helper)
else
coordinates = Helper.Data.ReadJsonFile<CoordinatesList>("assets/coordinates.json");

Helper.Events.Input.ButtonReleased += Input_ButtonReleased;
Helper.Events.Input.ButtonPressed += Input_ButtonPressed;
}


private void Input_ButtonReleased(object sender, ButtonReleasedEventArgs e)
private void Input_ButtonPressed(object sender, ButtonPressedEventArgs e)
{
if (Game1.activeClickableMenu is GameMenu && (Game1.activeClickableMenu as GameMenu).currentTab == GameMenu.mapTab && e.Button == Config.TeleportKey)
{
Expand Down
2 changes: 1 addition & 1 deletion MapTeleport/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Name": "Map Teleport",
"Author": "aedenthorn",
"Version": "0.1.3",
"Version": "0.2.0",
"Description": "Teleport using the map.",
"UniqueID": "aedenthorn.MapTeleport",
"EntryDll": "MapTeleport.dll",
Expand Down
2 changes: 1 addition & 1 deletion MultipleSpouses/Misc.cs
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ public static Vector2 GetSpouseBedPosition(FarmHouse fh, List<string> allBedmate
{
int bedWidth = GetBedWidth(fh);
Point bedStart = GetBedStart(fh);
int x = 64 + (int)((allBedmates.IndexOf(name)) / (float)(allBedmates.Count) * (bedWidth - 1) * 64);
int x = 64 + (int)((allBedmates.IndexOf(name) + 1) / (float)(allBedmates.Count + 1) * (bedWidth - 1) * 64);
return new Vector2(bedStart.X * 64 + x, bedStart.Y * 64 + ModEntry.bedSleepOffset - (GetTopOfHeadSleepOffset(name) * 4));
}
public static Vector2 GetFarmerBedPosition(FarmHouse fh)
Expand Down
2 changes: 1 addition & 1 deletion SMAPILogGetter/ModConfig.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace CustomChestTypes
namespace SMAPILogGetter
{
public class ModConfig
{
Expand Down
41 changes: 36 additions & 5 deletions SMAPILogGetter/ModEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
using System.Reflection;
using Object = StardewValley.Object;

namespace CustomChestTypes
namespace SMAPILogGetter
{
public class ModEntry : Mod
{
Expand All @@ -33,15 +33,46 @@ public override void Entry(IModHelper helper)

private void GetLogFile(string arg1, string[] arg2)
{
string logPath = Path.Combine(Constants.DataPath, "SMAPI-latest.txt");
string logPath = Path.Combine(Constants.DataPath, "ErrorLogs", "SMAPI-latest.txt");

if (!Directory.Exists(logPath))
if (!File.Exists(logPath))
{
Monitor.Log($"SMAPI log not found at {logPath}.", LogLevel.Error);
return;
}
File.Copy(logPath, Helper.DirectoryPath);
Monitor.Log($"SMAPI log not found at {logPath}.", LogLevel.Error);

if (arg2.Length == 0)
{
File.Copy(logPath, Environment.CurrentDirectory);
Monitor.Log($"Copied SMAPI log to game folder {Environment.CurrentDirectory}.", LogLevel.Alert);

}
else
{
string cmd = arg2[0].ToLower();
switch (cmd)
{
case "desktop":
case "dt":
File.Copy(logPath, Environment.GetFolderPath(Environment.SpecialFolder.Desktop));
Monitor.Log($"Copied SMAPI log to Desktop {Environment.GetFolderPath(Environment.SpecialFolder.Desktop)}.", LogLevel.Alert);
break;
case "copy":
case "cp":
string log = File.ReadAllText(logPath);
if (DesktopClipboard.SetText(log))
{
Monitor.Log($"Copied SMAPI log to Clipboard.", LogLevel.Alert);
}
else
{
Monitor.Log($"Coulding copy SMAPI log to Clipboard!", LogLevel.Error);
}

break;
}
}

}

}
Expand Down
10 changes: 5 additions & 5 deletions SMAPILogGetter/manifest.json
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
{
"Name": "CustomChestTypes",
"Name": "SMAPI Log Getter",
"Author": "aedenthorn",
"Version": "0.2.0",
"Description": "Creates custom chest types.",
"UniqueID": "aedenthorn.CustomChestTypes",
"EntryDll": "CustomChestTypes.dll",
"Description": "Get the current SMAPI log.",
"UniqueID": "aedenthorn.SMAPILogGetter",
"EntryDll": "SMAPILogGetter.dll",
"MinimumApiVersion": "3.8.0",
"UpdateKeys": ["Nexus:"],
"ModUpdater": {
"Repository": "StardewValleyMods",
"User": "aedenthorn",
"Directory": "_releases",
"ModFolder": "CustomChestTypes"
"ModFolder": "SMAPILogGetter"
},
"Dependencies": [
{
Expand Down
10 changes: 0 additions & 10 deletions StardewValleyMods.sln
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,6 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomChestTypes", "CustomC
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QuickLoad", "QuickLoad\QuickLoad.csproj", "{BFD18E09-430C-46A7-A9A3-2C394B95BE44}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SMAPILogGetter", "SMAPILogGetter\SMAPILogGetter.csproj", "{810A9C88-312C-4AFD-A3D8-1C2B155AC581}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CustomSpousePatioWizard", "CustomSpousePatioWizard\CustomSpousePatioWizard.csproj", "{71A75702-CEC2-4BF0-8961-0C5C733B8721}"
EndProject
Global
Expand Down Expand Up @@ -560,14 +558,6 @@ Global
{BFD18E09-430C-46A7-A9A3-2C394B95BE44}.Release|Any CPU.Build.0 = Release|Any CPU
{BFD18E09-430C-46A7-A9A3-2C394B95BE44}.Release|x86.ActiveCfg = Release|Any CPU
{BFD18E09-430C-46A7-A9A3-2C394B95BE44}.Release|x86.Build.0 = Release|Any CPU
{810A9C88-312C-4AFD-A3D8-1C2B155AC581}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{810A9C88-312C-4AFD-A3D8-1C2B155AC581}.Debug|Any CPU.Build.0 = Debug|Any CPU
{810A9C88-312C-4AFD-A3D8-1C2B155AC581}.Debug|x86.ActiveCfg = Debug|Any CPU
{810A9C88-312C-4AFD-A3D8-1C2B155AC581}.Debug|x86.Build.0 = Debug|Any CPU
{810A9C88-312C-4AFD-A3D8-1C2B155AC581}.Release|Any CPU.ActiveCfg = Release|Any CPU
{810A9C88-312C-4AFD-A3D8-1C2B155AC581}.Release|Any CPU.Build.0 = Release|Any CPU
{810A9C88-312C-4AFD-A3D8-1C2B155AC581}.Release|x86.ActiveCfg = Release|Any CPU
{810A9C88-312C-4AFD-A3D8-1C2B155AC581}.Release|x86.Build.0 = Release|Any CPU
{71A75702-CEC2-4BF0-8961-0C5C733B8721}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{71A75702-CEC2-4BF0-8961-0C5C733B8721}.Debug|Any CPU.Build.0 = Debug|Any CPU
{71A75702-CEC2-4BF0-8961-0C5C733B8721}.Debug|x86.ActiveCfg = Debug|Any CPU
Expand Down
Binary file added _releases/MapTeleport 0.2.0.zip
Binary file not shown.
1 change: 1 addition & 0 deletions _releases/_releases.projitems
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<None Include="$(MSBuildThisFileDirectory)MapTeleport 0.1.0.zip" />
<None Include="$(MSBuildThisFileDirectory)MapTeleport 0.1.2.zip" />
<None Include="$(MSBuildThisFileDirectory)MapTeleport 0.1.3.zip" />
<None Include="$(MSBuildThisFileDirectory)MapTeleport 0.2.0.zip" />
<None Include="$(MSBuildThisFileDirectory)MobileArcade 0.1.2.zip" />
<None Include="$(MSBuildThisFileDirectory)MobileAudioPlayer 0.4.1.zip" />
<None Include="$(MSBuildThisFileDirectory)MobileCalendar 0.2.0.zip" />
Expand Down

0 comments on commit f64365b

Please sign in to comment.