Skip to content

Commit

Permalink
Format code
Browse files Browse the repository at this point in the history
Simplify API
  • Loading branch information
RuiNtD committed Mar 23, 2024
1 parent d3e0f16 commit 561eab0
Show file tree
Hide file tree
Showing 9 changed files with 413 additions and 496 deletions.
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"csharpier": {
"version": "0.27.3",
"commands": [
"dotnet-csharpier"
]
}
}
}
1 change: 1 addition & 0 deletions .csharpierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
IGenericModConfigMenuApi.cs
1 change: 1 addition & 0 deletions .csharpierrc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
tabWidth: 2
255 changes: 0 additions & 255 deletions .editorconfig

This file was deleted.

21 changes: 12 additions & 9 deletions IRichPresenceAPI.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
using Netcode;
using StardewModdingAPI;
using System;
using System;
using System.Collections.Generic;
using StardewModdingAPI;

namespace SVRichPresence {
public interface IRichPresenceAPI {
namespace SVRichPresence
{
public interface IRichPresenceAPI
{
/// <summary>
/// Defines a tag with a resolver function.
/// </summary>
Expand Down Expand Up @@ -66,9 +67,13 @@ public interface IRichPresenceAPI {
/// <param name="replaceErrors">Text to replace tags that throw an exception. If <c>null</c>, the tag is omitted.</param>
/// <param name="replaceNulls">Text to replace tags that return null. If <c>null</c>, the tag is omitted.</param>
/// <returns>A dictionary using <see cref="FormatTag"/> for each value.</returns>
IDictionary<string, string> FormatAllTags(string replaceErrors = null, string replaceNulls = null);
IDictionary<string, string> FormatAllTags(
string replaceErrors = null,
string replaceNulls = null
);

public interface IResolvedTag {
public interface IResolvedTag
{
bool Success { get; }
string Value { get; }
Exception Exception { get; }
Expand All @@ -92,7 +97,5 @@ public interface IResolvedTag {
/// <param name="replaceNull">Text to replace tags that return null. If <c>null</c>, the tag is untouched.</param>
/// <returns>The formatted text</returns>
string FormatText(string text, string replaceError = null, string replaceNull = null);

Func<string> ReqWorld(Func<string> func);
}
}
21 changes: 13 additions & 8 deletions ModConfig.cs
Original file line number Diff line number Diff line change
@@ -1,32 +1,37 @@
using StardewModdingAPI;

namespace SVRichPresence {
internal class ModConfig {
namespace SVRichPresence
{
internal class ModConfig
{
public SButton ReloadConfigButton = SButton.F5;
public bool ShowGlobalPlayTime = false;
public bool AddGetModButton = true;
public MenuPresence MenuPresence = new();
public GamePresence GamePresence = new();
}

internal class MenuPresence {
internal class MenuPresence
{
public bool ForceSmallImage = false;
public string State = "In Menus";
public string Details = "";
public string LargeImageText = "{Activity}";
public string LargeImageText = "{ Activity }";
public string SmallImageText = "";
}

internal class GamePresence : MenuPresence {
internal class GamePresence : MenuPresence
{
public bool ShowSeason = true;
public bool ShowFarmType = true;
public bool ShowWeather = true;
public bool ShowPlayTime = true;

public GamePresence() {
State = "{GameInfo}";
public GamePresence()
{
State = "{ GameInfo }";
Details = "{Farm} | {Money}";
SmallImageText = "{Date}";
SmallImageText = "{ Date }";
}
}
}
Loading

0 comments on commit 561eab0

Please sign in to comment.