Skip to content

Commit

Permalink
Updates for new versions, some 3.0 compat stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Sakorona committed Dec 24, 2018
1 parent 3c9e04c commit b550f47
Show file tree
Hide file tree
Showing 11 changed files with 124 additions and 15 deletions.
5 changes: 2 additions & 3 deletions BetterShippingBox/BetterShippingBox/BetterShippingBox.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,17 @@
using StardewModdingAPI.Events;
using StardewValley;
using StardewValley.Menus;
using System;

namespace BetterShippingBox
{
public class BetterShippingBox : Mod
{
public override void Entry(IModHelper helper)
{
MenuEvents.MenuChanged += MenuEvents_OnMenuChanged;
helper.Events.Display.MenuChanged += Display_MenuChanged; ;
}

private void MenuEvents_OnMenuChanged(object sender, EventArgsClickableMenuChanged e)
private void Display_MenuChanged(object sender, MenuChangedEventArgs e)
{
if ((e.NewMenu is ItemGrabMenu menu) && (menu.shippingBin))
{
Expand Down
1 change: 1 addition & 0 deletions ClimatesOfFerngill/ClimatesOfFerngill.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
<Compile Include="Integrations\ISafeLightningAPI.cs" />
<Compile Include="Patches\GameLocationPatches.cs" />
<Compile Include="Patches\SGamePatches.cs" />
<Compile Include="TestClimate.cs" />
<Compile Include="WeatherData\WeatherData.cs" />
<Compile Include="Weathers\FerngillCustomRain.cs" />
<Compile Include="Weathers\FerngillThunderFrenzy.cs" />
Expand Down
4 changes: 1 addition & 3 deletions ClimatesOfFerngill/ClimatesOfFerngillRebuild.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
using PyTK.CustomTV;
using Harmony;
using System.Reflection;
using ClimatesOfFerngillRebuild.Patches;
using ClimatesOfFerngillRebuild.Patches;

namespace ClimatesOfFerngillRebuild
{
Expand Down Expand Up @@ -95,8 +95,6 @@ public override void Entry(IModHelper helper)

if (Disabled) return;

//Harmony patcher
HarmonyInstance.DEBUG = true;
var harmony = HarmonyInstance.Create("koihimenakamura.climatesofferngill");
harmony.PatchAll(Assembly.GetExecutingAssembly());

Expand Down
8 changes: 8 additions & 0 deletions ClimatesOfFerngill/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,17 @@ This mod uses harmony to patch functions to allow it to draw custom rain and sno


## Changelog
v1.5
- is coming

v1.4.2
- removed extra Harmony debug line
- Corrected issue with checking the TV before the wedding tomorrow (badly formatted line)

v1.4.1
- Updated for SDV 1.3.32
- Updated for newest LunarDisturbances API
- Updated TV lines.

v1.4
- lighter fog implemented
Expand Down
20 changes: 20 additions & 0 deletions ClimatesOfFerngill/TestClimate.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ClimatesOfFerngillRebuild
{
class TestClimate
{
List<string> ZonesAffected;

}

class TestWeather
{
string StartDate;
string EndDate;
}
}
44 changes: 44 additions & 0 deletions ClimatesOfFerngill/data/weather/sample.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{
"LocationsForWeather": [ ],
"AllowStormsInS1Y1": false,
"AllowSnowOnFall28": true,
"AvgTimeOfHighTemp": "1440",
"AvgTimeOnLowTemp": "2600",
"FogInMorningMultiplier": "2",
"Weathers": [
{
"StartDate": "Spring 1",
"EndDate": "Spring 9",
"FogChance": ".50 - .026d",
"FogVariability": "-.08,.05",
"FogDuration": "40,360",
"EveningFog": ".50 - .055d",
"RainChance": ".25 - .04d",
"RainVariability": "0",
"WindyChance": ".06 + .028d",
"WindVariability": "0",
"StormConversionChance": ".04 + .038d",
"ColdSnapChance": ".38 - .04d",
"TemperatureHigh": "8.5+.45d",
"TemperatureLow": "4.1+.23d",
"TemperatureVariability": "-2,2.3",
},
{
"StartDate": "Spring 10",
"EndDate": "Spring 19",
"FogChance": ".26 - .021d",
"FogVariability": ".02",
"FogDuration": "40,240",
"EveningFog": ".50 - .09d",
"RainChance": ".25 - .04d",
"RainVariability": "0",
"WindyChance": ".06 + .028d",
"WindVariability": "0",
"StormConversionChance": ".04 + .038d",
"ColdSnapChance": ".38 - .04d",
"TemperatureHigh": "8.5+.45d",
"TemperatureLow": "4.1+.23d",
"TemperatureVariability": "-2,2.3",
}
]
}
2 changes: 1 addition & 1 deletion ClimatesOfFerngill/i18n/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"weat-wedToday.0": "Today, in Stardew Valley, for the wedding, expect {{weather}}.#Tomorrow, expect {{tomorrowWeather}} with a high of {{tomorrowHigh}} and low {{tomorrowLow}}",

//And Tomorrow
"weat-wedTomorrow.0": "Today, expect {{weather}} with high:{{high}} and low:{{low}}#Tommorow, for the wedding, expect {{tomorrowWeather}}",
"weat-wedTomorrow.0": "Today, expect {{descWeather}} with high:{{todayHigh}} and low:{{todayLow}}#Tommorow, for the wedding, expect {{tomorrowWeather}}",
"weat-wedTomorrow.BM.0": "Today, PANIC! PANIC! THE BLOOD MOON HAS DESCENDED!!!!#I mean, expect {{descWeather}} with high:{{todayHigh}} and low:{{todayLow}}#Tommorow, for the wedding, expect {{tomorrowWeather}}",

//Weather - Condition Strings
Expand Down
2 changes: 1 addition & 1 deletion ClimatesOfFerngill/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"Name": "Climates of Ferngill [Rebuild]",
"Author": "KoihimeNakamura",
"Version": "1.4.1",
"Version": "1.4.2",
"Description": "Create a unique climate system with custom weathers, a moon and stamina changes, as well as add weather related events and commands.",
"UniqueID": "KoihimeNakamura.ClimatesOfFerngill",
"EntryDll": "ClimatesOfFerngill.dll",
Expand Down
3 changes: 3 additions & 0 deletions CustomizableCartRedux/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ Unzip the archive into the Mods folder
This mod will only work for the main player (i.e the host) in an MP game.

## Changelog
1.3
- Updated to SDV 1.3.22
- Added manifest key
1.3-beta.3
- Fixed a duplicate bug
1.3-beta2
Expand Down
5 changes: 3 additions & 2 deletions CustomizableCartRedux/manifest.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
{
"Name": "Customizable Cart Redux",
"Author": "KoihimeNakamura",
"Version": "1.3-beta.4",
"Version": "1.3",
"Description": "Allows you to alter the chances of the traveling cart appearing. Credit to Yyeahdude for the original idea.",
"UniqueID": "KoihimeNakamura.CCR",
"EntryDll": "CustomizableCartRedux.dll",
"MinimumApiVersion": "2.6-beta.15"
"UpdateKeys": [ "Nexus:1402" ],
"MinimumApiVersion": "2.8"
}
45 changes: 40 additions & 5 deletions DynamicNightTime/DynamicNightTime.cs
Original file line number Diff line number Diff line change
Expand Up @@ -177,22 +177,57 @@ public static Color GetLunarLightDifference(int timeOfDay)
//gibbeous + 17
//crescent +5

//light added is only going to be visible in certain times, determined by the code.
//Full light is when it's angle is between.. 30 and 150 degrees. For us, that should be the middle of 70% of the time.

int timeRise = MoonAPI.GetMoonRise();
int timeSet = MoonAPI.GetMoonSet();
int timeElapsed = SDVTime.MinutesBetweenTwoIntTimes(Game1.timeOfDay, timeRise);
int totalMinutes = SDVTime.MinutesBetweenTwoIntTimes(timeRise, timeSet);

if (timeRise > Game1.timeOfDay)
return new Color(0,0,0);
if (Game1.timeOfDay > timeSet)
return new Color(0,0,0);

float multiply = (float)timeElapsed/totalMinutes;
if (multiply >= .15 && multiply <= .85)
multiply = 1;
else
{

}


byte colorValR, colorValG, colorValB, val;

switch (MoonAPI.GetCurrentMoonPhase())
{
case "Third Quarter":
case "First Quarter":
return new Color(11,11,0);
val = (byte)(Math.Floor(11 * multiply));
colorValB = colorValG = colorValR = val;
break;
case "Full Moon":
return new Color(22,22,0);
val = (byte)(Math.Floor(22 * multiply));
colorValB = colorValG = colorValR = val;
break;
case "Waning Gibbeous":
case "Waxing Gibbeous":
return new Color(17,17,0);
val = (byte)(Math.Floor(17 * multiply));
colorValB = colorValG = colorValR = val;
break;
case "Waning Crescent":
case "Waxing Crescent":
return new Color(5,5,0);
val = (byte)(Math.Floor(5 * multiply));
colorValB = colorValG = colorValR = val;
break;
default:
return new Color(0,0,0);
colorValR = colorValG = colorValB = 0;
break;
}

return new Color(colorValR, colorValG, colorValB);
}

public static int GetSunriseTime() => GetSunrise().ReturnIntTime();
Expand Down

0 comments on commit b550f47

Please sign in to comment.