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

Stardew Valley GSI Mod support #2021

Merged
merged 23 commits into from
May 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
c43dcfd
Merge remote-tracking branch 'antonpup/dev' into feature/StardewValle…
gitmacer Apr 3, 2020
b0a615c
First version of Stardew Valley GSI
gitmacer Apr 4, 2020
c302545
Merge remote-tracking branch 'antonpup/dev' into feature/StardewValle…
gitmacer Apr 4, 2020
6c29c8c
Change a lot on the Nodes
gitmacer Apr 4, 2020
f206ad3
Add more Vars
gitmacer Apr 7, 2020
9d96842
changed Location
gitmacer Apr 12, 2020
4a9dfac
Merge branch 'dev' into feature/StardewValleySupport
gitmacer May 1, 2020
4e3f8c3
Start creating default profile
gitmacer May 4, 2020
a773041
Merge remote-tracking branch 'antonpup/dev' into feature/StardewValle…
gitmacer May 6, 2020
b8dd0a1
Changed GSI Data + Added default profile
gitmacer May 14, 2020
f9f2513
Add Debris/Fall effect
gitmacer May 15, 2020
6cd63c7
Changed Mod download link + Fixed default Fall layer
gitmacer May 16, 2020
5e0fba8
Merge remote-tracking branch 'antonpup/dev' into feature/StardewValle…
gitmacer May 16, 2020
46df65c
only activate profile when the Modloader is used
gitmacer May 16, 2020
358459c
Improve Snow Layer + New Damage Layer
gitmacer May 17, 2020
5ff04d0
Color tweak the Background
gitmacer May 18, 2020
22cd8bd
Merge 'antonpup/dev'
gitmacer May 18, 2020
9578104
Fix Merge conflicts
gitmacer May 18, 2020
d4c559d
Merge remote-tracking branch 'antonpup/dev' into feature/StardewValle…
gitmacer May 18, 2020
fe5e525
Changes after feedback
gitmacer May 25, 2020
701dc11
Update default profile
gitmacer May 25, 2020
b9206d9
Merge remote-tracking branch 'antonpup/dev' into feature/StardewValle…
gitmacer May 26, 2020
388d47b
Update Desert check
gitmacer May 26, 2020
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
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<UserControl x:Class="Aurora.Profiles.StardewValley.Control_StardewValley"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Aurora.Settings"
xmlns:System="clr-namespace:System;assembly=mscorlib"
xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="850" Height="Auto" Width="Auto">

<Grid>
<TabControl>
<TabItem Header="Overview for Stardew Valley">
<StackPanel Margin="10">
<CheckBox x:Name="GameEnabled" Content="Enable Aurora to provide lighting effects with Stardew Valley. Ensure you have read the below text." Checked="GameEnabled_Checked" Unchecked="GameEnabled_Checked" />
<TextBlock HorizontalAlignment="Left" Margin="0,10" TextWrapping="Wrap" MaxWidth="824">
<Run Text="Support for Stardew Valley requires a mod so that Aurora is able to fetch the variables from the game. This mod requires SMAPI." />
<Run Text="These mods are not authored by the main Aurora developers and any issues with these mods should not be directed at them, but posted on the relevant Github/Nexus Mods site for the mod." />
</TextBlock>
<Button Content="SMAPI download" HorizontalAlignment="Left" Margin="0,0,0,0" Padding="10,2" Click="GoToSMAPIPage_Click" Width="233" />
<Button Content="Aurora GSI for Stardew Valley download" HorizontalAlignment="Left" Margin="0,5,0,0" Padding="10,2" Click="GoToModDownloadPage_Click" />
</StackPanel>
</TabItem>
</TabControl>
</Grid>
</UserControl>
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
using Aurora.Profiles.StardewValley.GSI;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Net.Http;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Xceed.Wpf.Toolkit;

namespace Aurora.Profiles.StardewValley {
public partial class Control_StardewValley : UserControl
{
private Application profile;

public Control_StardewValley(Application profile)
{
this.profile = profile;

InitializeComponent();
SetSettings();

profile.ProfileChanged += (sender, e) => SetSettings();
}

private void SetSettings()
{
GameEnabled.IsChecked = profile.Settings.IsEnabled;
}

private void GameEnabled_Checked(object sender, RoutedEventArgs e)
{
if (IsLoaded)
{
profile.Settings.IsEnabled = GameEnabled.IsChecked ?? false;
profile.SaveProfiles();
}
}

private void GoToSMAPIPage_Click(object sender, RoutedEventArgs e)
{
Process.Start(@"https://www.nexusmods.com/stardewvalley/mods/2400");
}

private void GoToModDownloadPage_Click(object sender, RoutedEventArgs e)
{
Process.Start(@"https://www.nexusmods.com/stardewvalley/mods/6088");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
using Aurora.Profiles.Generic.GSI.Nodes;
using Aurora.Profiles.StardewValley.GSI.Nodes;
using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Aurora.Profiles.StardewValley.GSI {
public class GameState_StardewValley : GameState {
public ProviderNode Provider => NodeFor<ProviderNode>("Provider");

public WorldNode World => NodeFor<WorldNode>("World");
public PlayerNode Player => NodeFor<PlayerNode>("Player");
public InventoryNode Inventory => NodeFor<InventoryNode>("Inventory");

public JournalNode Journal => NodeFor<JournalNode>("Journal");
public GameStatusNode Game => NodeFor<GameStatusNode>("Game");

public GameState_StardewValley() : base() { }

/// <summary>
/// Creates a GameState_StardewValley instance based on the passed JSON data.
/// </summary>
/// <param name="JSONstring"></param>
public GameState_StardewValley(string JSONstring) : base(JSONstring) { }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Aurora.Profiles.StardewValley.GSI.Nodes {
public enum GameStatus
{
Unknown = -1,
TitleScreen = 0,
PlayingGame = 3,
//LogoScreen = 4,
Loading = 6,
}

public class GameStatusNode : AutoJsonNode<GameStatusNode>
{
public GameStatus Status;
public string CurrentMenu;
public string CurrentMinigameCutscene;
public bool IsMultiplayer;
public bool IsChatOpened;

internal GameStatusNode(string json) : base(json) { }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Aurora.Profiles.StardewValley.GSI.Nodes {

public class InventoryNode : AutoJsonNode<InventoryNode>
{
public SelectedSlotNode SelectedSlot => NodeFor<SelectedSlotNode>("SelectedSlot");

internal InventoryNode(string json) : base(json) { }
}
public class SelectedSlotNode : AutoJsonNode<SelectedSlotNode>
{
public int Number;
public string ItemName;
public SelectedSlotColorNode CategoryColor => NodeFor<SelectedSlotColorNode>("CategoryColor");

internal SelectedSlotNode(string JSON) : base(JSON) { }
}

public class SelectedSlotColorNode : AutoJsonNode<SelectedSlotColorNode>
{
public float Red;
public float Green;
public float Blue;

internal SelectedSlotColorNode(string JSON) : base(JSON) { }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Aurora.Profiles.StardewValley.GSI.Nodes {

public class JournalNode : AutoJsonNode<JournalNode>
{
public bool QuestAvailable;
public bool NewQuestAvailable;
gitmacer marked this conversation as resolved.
Show resolved Hide resolved
public int QuestCount;

internal JournalNode(string json) : base(json) { }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Aurora.Profiles.StardewValley.GSI.Nodes
{

public class PlayerNode : AutoJsonNode<PlayerNode>
{
public enum Locations
{
Unknown = -1,
Farm,
Beach,
AnimalHouse,
SlimeHutch,
Shed,
LibraryMuseum,
AdventureGuild,
Woods,
Railroad,
Summit,
Forest,
ShopLocation,
SeedShop,
FishShop,
BathHousePool,
FarmHouse,
Cabin,
Club,
BusStop,
CommunityCenter,
Desert,
FarmCave,
JojaMart,
MineShaft,
Mountain,
Sewer,
WizardHouse,
Town,
Cellar,
Submarine,
MermaidHouse,
BeachNightMarket,
MovieTheater,
ManorHouse,
AbandonedJojaMart,
Mine
}

public HealthNode Health => NodeFor<HealthNode>("Health");
public string LocationName;
public Locations Location;
public bool IsOutdoor;
public EnergyNode Energy => NodeFor<EnergyNode>("Energy");

internal PlayerNode(string json) : base(json){ }

public class HealthNode : AutoJsonNode<HealthNode>
{
public int Current;
public int Max;
public bool BarActive;

internal HealthNode(string JSON) : base(JSON) { }
}

public class EnergyNode : AutoJsonNode<EnergyNode>
{
public int Current;
public int Max;

internal EnergyNode(string JSON) : base(JSON) { }
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Aurora.Profiles.StardewValley.GSI.Nodes {

public enum TimeRange
{
Sunrise, //< 750
Morning, //< 900
Daytime, //< 1200
Evening, //< 1600
Twilight,//< 1750
Night, //< 2100
Midnight//>= 2100
}

public enum Seasons
{
Unknown = -1,
Spring,
Summer,
Fall,
Winter
}

public class WorldNode : AutoJsonNode<WorldNode> {
public Seasons Season;

public TimeNode Time => NodeFor<TimeNode>("Time");
public WeatherNode Weather => NodeFor<WeatherNode>("Weather");

internal WorldNode(string json) : base(json) {}
}

public class TimeNode : AutoJsonNode<TimeNode>
{
public bool Paused;
public bool isFestivalDay;
public bool isWeddingToday;
public int Hour;
public int Minute;
public TimeRange Range;

internal TimeNode(string JSON) : base(JSON) { }
}

public class WeatherNode : AutoJsonNode<WeatherNode>
{
public bool IsSnowing;
public bool IsRaining;
public bool IsDebrisWeather;
public bool IsLightning;

internal WeatherNode(string JSON) : base(JSON) { }
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Aurora.Profiles.StardewValley
{
public class StardewValley : Application {
public StardewValley() : base(new LightEventConfig
{
Name = "Stardew Valley SMAPI",
ID = "stardew_valley",
AppID = "413150",
ProcessNames = new[] { "StardewModdingAPI.exe" },
ProfileType = typeof(StardewValleyProfile),
OverviewControlType = typeof(Control_StardewValley),
GameStateType = typeof(GSI.GameState_StardewValley),
Event = new GameEvent_Generic(),
IconURI = "Resources/stardew_valley_32x32.png"
})
{
}
}
}
Loading