Skip to content

Commit 53042fb

Browse files
committed
Initial implementation of API
1 parent 448365d commit 53042fb

2 files changed

Lines changed: 77 additions & 0 deletions

File tree

DynamicReflections/DynamicReflections.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,14 @@
1919
using DynamicReflections.Framework.External.GenericModConfigMenu;
2020
using StardewValley.Locations;
2121
using StardewValley.Menus;
22+
using DynamicReflections.Framework.Interfaces.Internal;
2223

2324
namespace DynamicReflections
2425
{
2526
public class DynamicReflections : Mod
2627
{
2728
// Shared static helpers
29+
internal static Api api;
2830
internal static IMonitor monitor;
2931
internal static IModHelper modHelper;
3032
internal static Multiplayer multiplayer;
@@ -93,6 +95,7 @@ public class DynamicReflections : Mod
9395
public override void Entry(IModHelper helper)
9496
{
9597
// Set up the monitor, helper and multiplayer
98+
api = new Api();
9699
monitor = Monitor;
97100
modHelper = helper;
98101
multiplayer = helper.Reflection.GetField<Multiplayer>(typeof(Game1), "multiplayer").GetValue();
@@ -136,6 +139,11 @@ public override void Entry(IModHelper helper)
136139
helper.Events.GameLoop.GameLaunched += OnGameLaunched;
137140
}
138141

142+
public override object GetApi()
143+
{
144+
return api;
145+
}
146+
139147
private void OnWindowResized(object sender, StardewModdingAPI.Events.WindowResizedEventArgs e)
140148
{
141149
LoadRenderers();
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
using Microsoft.Xna.Framework.Graphics;
2+
using StardewValley.Buildings;
3+
using StardewValley.Locations;
4+
using StardewValley;
5+
using System;
6+
using System.Collections.Generic;
7+
using System.Linq;
8+
using System.Text;
9+
using System.Threading.Tasks;
10+
11+
namespace DynamicReflections.Framework.Interfaces.Internal
12+
{
13+
public interface IApi
14+
{
15+
public bool IsDrawAnyReflection();
16+
public bool IsDrawingWaterReflection();
17+
public bool IsDrawingPuddleReflection();
18+
public bool IsDrawingMirrorReflection();
19+
20+
public bool IsFilteringWater();
21+
public bool IsFilteringPuddles();
22+
public bool IsFilteringMirrors();
23+
public bool IsFilteringStars();
24+
}
25+
26+
public class Api : IApi
27+
{
28+
public bool IsDrawAnyReflection()
29+
{
30+
return DynamicReflections.isDrawingWaterReflection || DynamicReflections.isDrawingWaterReflection || DynamicReflections.isDrawingPuddles;
31+
}
32+
33+
public bool IsDrawingWaterReflection()
34+
{
35+
return DynamicReflections.isDrawingWaterReflection;
36+
}
37+
38+
public bool IsDrawingPuddleReflection()
39+
{
40+
return DynamicReflections.isDrawingPuddles;
41+
}
42+
43+
public bool IsDrawingMirrorReflection()
44+
{
45+
return DynamicReflections.isDrawingMirrorReflection;
46+
}
47+
48+
49+
public bool IsFilteringWater()
50+
{
51+
return DynamicReflections.isFilteringWater;
52+
}
53+
54+
public bool IsFilteringPuddles()
55+
{
56+
return DynamicReflections.isFilteringPuddles;
57+
}
58+
59+
public bool IsFilteringMirrors()
60+
{
61+
return DynamicReflections.isFilteringMirror;
62+
}
63+
64+
public bool IsFilteringStars()
65+
{
66+
return DynamicReflections.isFilteringStar;
67+
}
68+
}
69+
}

0 commit comments

Comments
 (0)