Skip to content

Commit

Permalink
ContentLibrary
Browse files Browse the repository at this point in the history
  • Loading branch information
RedstoneWizard08 committed Sep 10, 2024
1 parent c15ce32 commit 9cec55f
Show file tree
Hide file tree
Showing 85 changed files with 139 additions and 70 deletions.
13 changes: 0 additions & 13 deletions API.md

This file was deleted.

1 change: 1 addition & 0 deletions Build/Source/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public static class Program {
public static int Main(string[] args) {
return new CakeHost()
.InstallTool(new Uri("nuget:?package=tcli&version=0.2.3"))
.InstallTool(new Uri("nuget:?package=docfx&version=2.77.0"))
.UseContext<BuildContext>()
.Run(args);
}
Expand Down
2 changes: 1 addition & 1 deletion Build/Source/Tasks/BuildTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Build.Tasks;
[TaskName("Build")]
public sealed class BuildTask : FrostingTask<BuildContext> {
public override void Run(BuildContext context) {
context.DotNetBuild("../ConfigurableWarning/ConfigurableWarning.csproj", new DotNetBuildSettings {
context.DotNetBuild("../ContentLibrary/ContentLibrary.csproj", new DotNetBuildSettings {
Configuration = context.MsBuildConfiguration
});

Expand Down
6 changes: 3 additions & 3 deletions Build/Source/Tasks/LaunchTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@ public override void Run(BuildContext context) {
var config = context.MsBuildConfiguration;
var gamePath = context.GamePath;
var profilePath = context.ProfilePath;
var outPath = $"../ConfigurableWarning/bin/{config}/netstandard2.1/RedstoneWizard08.ConfigurableWarning.dll";
var pluginPath = Path.Join(profilePath, "BepInEx/plugins/RedstoneWizard08-ConfigurableWarning");
var outPath = $"../ContentLibrary/bin/{config}/netstandard2.1/RedstoneWizard08.ContentLibrary.dll";
var pluginPath = Path.Join(profilePath, "BepInEx/plugins/RedstoneWizard08-ContentLibrary");
var args = $"--doorstop-enable true --doorstop-target \"{profilePath}/BepInEx/core/BepInEx.Preloader.dll\"";

if (!Path.Exists(Path.Join(outPath, ".."))) {
context.CreateDirectory(Path.Join(outPath, ".."));
}

context.CopyFile(outPath, $"{pluginPath}/RedstoneWizard08.ConfigurableWarning.dll");
context.CopyFile(outPath, $"{pluginPath}/RedstoneWizard08.ContentLibrary.dll");
context.StartProcess(gamePath, args);
}
}
51 changes: 32 additions & 19 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,26 +5,39 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [v1.15.2] - 2024-09-06
## [Unreleased]

## Changed

- We are now called `ContentLibrary`!
- Restructured the project and API
- Finalized legacy `ContentSettings` API
- Added `SkipIntroScreen` option
- Added `VideoSaveLocation` option
- Added `FreeMetaCoins` option
- Added `Gravity` option
- Added face customization options

## [v1.15.2-config] - 2024-09-06

### Changed

- Updated docs
- Corrected namespace

## [v1.15.1] - 2024-09-06
## [v1.15.1-config] - 2024-09-06

### Changed

- Updated readme

## [v1.15.0] - 2024-09-06
## [v1.15.0-config] - 2024-09-06

### Added

- The entire ContentSettings API! (This is the continuation)

## [v1.14.0] - 2024-05-18
## [v1.14.0-config] - 2024-05-18

### Added

Expand All @@ -34,7 +47,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Annotations!
- Much more that I forgor!

## [v1.13.2] - 2024-05-09
## [v1.13.2-config] - 2024-05-09

### Added

Expand Down Expand Up @@ -67,7 +80,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Removed old (legacy) package script
- Removed old days-per-quota patch

## [v1.12.0] - 2024-05-05
## [v1.12.0-config] - 2024-05-05

### Added

Expand All @@ -77,7 +90,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Updated sync

## [v1.11.0] - 2024-05-02
## [v1.11.0-config] - 2024-05-02

### Added

Expand All @@ -90,19 +103,19 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Redid settings packing
- Fixed for CW's new May 2nd release

## [v1.10.2] - 2024-05-01
## [v1.10.2-config] - 2024-05-01

### Changed

- Hopefully fix settings sync

## [v1.10.1] - 2024-05-01
## [v1.10.1-config] - 2024-05-01

### Changed

- Actually fixed the build

## [v1.10.0] - 2024-04-29
## [v1.10.0-config] - 2024-04-29

### Changed

Expand All @@ -112,46 +125,46 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Building in release mode! (Yes, I wasn't before.)
- Removed BepInEx config because it kinda broke stuff

## [v1.9.2] - 2024-04-19
## [v1.9.2-config] - 2024-04-19

### Changed

- Fixed settings sync

## [v1.9.1] - 2024-04-18
## [v1.9.1-config] - 2024-04-18

### Changed

- Nothing, just updated the README. :)

## [v1.9.0] - 2024-04-18
## [v1.9.0-config] - 2024-04-18

### Changed

- Refactored UI
- Moved to using ContentSettings and MyceliumNetworking

## [v1.8.1] - 2024-04-12
## [v1.8.1-config] - 2024-04-12

### Changed

- Fixed a default config value
- Hopefully fix the lobby patch

## [v1.8.0] - 2024-04-12
## [v1.8.0-config] - 2024-04-12

### Changed

- Fixed health & days left HUD to actually reflect the correct value (in real time)

## [v1.7.1] - 2024-04-12
## [v1.7.1-config] - 2024-04-12

### Changed

- Fixed lobby stuff (I actually applied the patch this time!)
- Fixed patches not using `nameof`

## [v1.7.0] - 2024-04-12
## [v1.7.0-config] - 2024-04-12

### Added

Expand All @@ -168,7 +181,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Made the patches better
- We no longer rely on ContentSettings!

## [v1.6.0] - 2024-04-11
## [v1.6.0-config] - 2024-04-11

### Added

Expand All @@ -179,7 +192,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- Changed the sprint multiplier max from 4 to 10

## [v1.5.0] - 2024-04-11
## [v1.5.0-config] - 2024-04-11

### Changed

Expand Down
2 changes: 1 addition & 1 deletion ConfigurableWarning.sln → ContentLibrary.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.0.31903.59
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ConfigurableWarning", "ConfigurableWarning\ConfigurableWarning.csproj", "{EC49DF52-F77B-4A11-96D4-2E5D3736A293}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ContentLibrary", "ContentLibrary\ContentLibrary.csproj", "{EC49DF52-F77B-4A11-96D4-2E5D3736A293}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Build", "Build\Build.csproj", "{E4367673-DDB7-4180-BCB7-958673FE4725}"
EndProject
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

<PropertyGroup>
<TargetFramework>netstandard2.1</TargetFramework>
<PackageId>RedstoneWizard08.ConfigurableWarning</PackageId>
<AssemblyName>RedstoneWizard08.ConfigurableWarning</AssemblyName>
<Description>Makes the game configurable!</Description>
<Version>1.15.2</Version>
<PackageId>RedstoneWizard08.ContentLibrary</PackageId>
<AssemblyName>RedstoneWizard08.ContentLibrary</AssemblyName>
<Description>A library for all of your Content Warning modding needs!</Description>
<Version>0.1.0</Version>
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
<Nullable>enable</Nullable>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using ConfigurableWarning.API.State;
using ContentLibrary;
using MyceliumNetworking;

namespace ConfigurableWarning.API.Internal;
Expand All @@ -16,7 +17,7 @@ public class OptionSyncer {
/// This should only be called by ConfigurableWarning's base API.
/// </summary>
internal OptionSyncer() {
MyceliumNetwork.RegisterNetworkObject(this, ConfigurableWarning.ModID);
MyceliumNetwork.RegisterNetworkObject(this, ContentLibraryPlugin.ModID);
}

/// <summary>
Expand Down Expand Up @@ -50,6 +51,6 @@ public void SyncSettings() {
if (settings == _lastSent) return;
_lastSent = settings;

MyceliumNetwork.RPC(ConfigurableWarning.ModID, nameof(SyncSettingsRecv), ReliableType.Reliable, settings);
MyceliumNetwork.RPC(ContentLibraryPlugin.ModID, nameof(SyncSettingsRecv), ReliableType.Reliable, settings);
}
}
16 changes: 16 additions & 0 deletions ContentLibrary/Source/ConfigurableWarning/CWPluginInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace ConfigurableWarning;

/// <summary>
/// Contains the plugin information for the ConfigurableWarning plugin.
/// </summary>
public static class CWPluginInfo {
/// <summary>
/// The GUID of the plugin.
/// </summary>
public const string PLUGIN_GUID = "RedstoneWizard08.ConfigurableWarning";

/// <summary>
/// The name of the plugin.
/// </summary>
public const string PLUGIN_NAME = "RedstoneWizard08.ConfigurableWarning";
}
31 changes: 31 additions & 0 deletions ContentLibrary/Source/ConfigurableWarning/ConfigurableWarning.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
using BepInEx;
using BepInEx.Logging;
using ConfigurableWarning.API;
using ContentLibrary;

namespace ConfigurableWarning;

/// <summary>
/// ConfigurableWarning's BepInEx entrypoint.
/// </summary>
[ContentWarningPlugin(CWPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_VERSION, false)]
[BepInPlugin(CWPluginInfo.PLUGIN_GUID, CWPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
[BepInDependency(MyceliumNetworking.MyPluginInfo.PLUGIN_GUID)]
public class ConfigurableWarning : BaseUnityPlugin {
/// <summary>
/// Our <see cref="ManualLogSource" />.
/// </summary>
internal new static readonly ManualLogSource Logger = BepInEx.Logging.Logger.CreateLogSource(CWPluginInfo.PLUGIN_GUID);

/// <summary>
/// Initializes the plugin
/// </summary>
public void Awake() {
Logger.LogInfo($"Loading plugin {CWPluginInfo.PLUGIN_GUID} (bundled with {MyPluginInfo.PLUGIN_GUID})...");

ConfigurableWarningAPI.Init();
ConfigurableWarningAPI.Register();

Logger.LogInfo($"Plugin {CWPluginInfo.PLUGIN_GUID} loaded!");
}
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
using BepInEx;
using BepInEx;
using BepInEx.Logging;
using ConfigurableWarning.API;
using HarmonyLib;

namespace ConfigurableWarning;
namespace ContentLibrary;

/// <summary>
/// ConfigurableWarning's BepInEx entrypoint.
/// ContentLibrary's BepInEx entrypoint.
/// </summary>
[ContentWarningPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_VERSION, false)]
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
[BepInDependency(MyceliumNetworking.MyPluginInfo.PLUGIN_GUID)]
public class ConfigurableWarning : BaseUnityPlugin {
public class ContentLibraryPlugin : BaseUnityPlugin {
/// <summary>
/// The ModID for Mycelium.
/// This is: CF + G (in hex = 0x47) + W (in hex = 0x57), for ConFiGurableWarning
/// This is just `CLIB` in hex.
/// </summary>
public const uint ModID = 0xCF4757;
public const uint ModID = 0x434C4942;

/// <summary>
/// Our <see cref="ManualLogSource" />.
Expand All @@ -34,9 +33,7 @@ public class ConfigurableWarning : BaseUnityPlugin {
public void Awake() {
Logger.LogInfo($"Loading plugin {MyPluginInfo.PLUGIN_GUID}...");

ConfigurableWarningAPI.Init();
Patch();
ConfigurableWarningAPI.Register();

Logger.LogInfo($"Plugin {MyPluginInfo.PLUGIN_GUID} loaded!");
}
Expand All @@ -58,4 +55,4 @@ public void Unpatch() {

Harmony.UnpatchAll();
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

using BepInEx;
using BepInEx.Logging;
using ConfigurableWarning;
using ContentLibrary;
using ContentSettings.API;
using ContentSettings.Internal;

Expand Down
File renamed without changes.
File renamed without changes.
16 changes: 13 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,22 @@
# ConfigurableWarning
# ContentLibrary

[![Docs Status](https://img.shields.io/github/actions/workflow/status/RedstoneWizard08/ConfigurableWarning/docs.yml?style=for-the-badge&label=Docs)
](https://redstonewizard08.github.io/ConfigurableWarning/)
[![Thunderstore Downloads](https://img.shields.io/thunderstore/dt/RedstoneWizard08/ConfigurableWarning?style=for-the-badge)](https://thunderstore.io/c/content-warning/p/RedstoneWizard08/ConfigurableWarning/)
[![Thunderstore Version](https://img.shields.io/thunderstore/v/RedstoneWizard08/ConfigurableWarning?style=for-the-badge)](https://thunderstore.io/c/content-warning/p/RedstoneWizard08/ConfigurableWarning/)

Makes the game configurable!
This is a quality-of-life mod to help you make the game as hard (or as easy) as you want!
A library for all of your Content Warning modding needs!

Previously known as `ConfigurableWarning`.

## Features

- [x] An easy-to-use and incredibly powerful configuration system
- [ ] An easy API for creating custom monsters
- [ ] An API for creating and loading your own maps
- [x] Extra built-in configuration options

## Credits

This is the continuation of ContentSettings, originally by @CommanderCat and @dhkatz!
Huge thanks to them for all their hard work! This mod is fully backwards-compatible with
Expand Down
Loading

0 comments on commit 9cec55f

Please sign in to comment.