-
Notifications
You must be signed in to change notification settings - Fork 58
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- The Harmony library now comes included - All detour-related functionality has been removed. Please use Harmony for your patching needs. - Removed GUI injection feature (use Harmony) - Added full Harmony patch information to the log publisher - Dropped some junk lines from the published logs for better readability - Added optional platform information to the log publisher (CPU, RAM, OS) - Added automatic Harmony patching for ModBase mods - Added MapDiscarded callback to ModBase - ModBase.OnGUI is now called during UIRoot.UIRootOnGUI and already has UI scaling applied - ModBase.ComponentsInitializing is now called after all components have been instantiated - Added error and warning prefixes to the logger for better readability on text logs - Moved controller initialization to the earliest point possible - Integrated vanilla mod settings into the HugsLib Mod Settings dialog. - Removed mods dialog auto-restarter (included in vanilla) - Added automatic restart on language change - Removed short hash collision resolver (included in vanilla) - Added IntVec3 extension methods for designations - Long settings handle names will now wrap around and display properly - Removed Log window copy button - Removed WindowReplacer (use Harmony) - Added EntryName parameter to ModSettingsManager.GetModSettings for external mods - Fixed exception if a map failed to load due to an error in another mod - Converted all comments to XML docs for reading during code completion
- Loading branch information
UnlimitedHugs
committed
May 9, 2017
1 parent
730e273
commit a62e362
Showing
44 changed files
with
531 additions
and
394 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<VersionData> | ||
<overrideVersion>2.4.3</overrideVersion> | ||
<overrideVersion>3.0.0</overrideVersion> | ||
<gitHubRepository>UnlimitedHugs/RimworldHugsLib</gitHubRepository> | ||
</VersionData> |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,25 @@ | ||
![HugsLib logo](http://i.imgur.com/1d35OiC.png) | ||
|
||
![Version](https://img.shields.io/badge/Rimworld-A17-brightgreen.svg) | ||
|
||
A lightweight shared mod library for Rimworld. Provides a foundation for mods and delivers shared functionality. | ||
|
||
**Notice:** HugsLib has changed and must now be installed as a separate mod by the players. The library itself is no longer to be included with your mods. You can, however, include the checker assembly to ensure that the player will be notified if they are missing the necessary version of the library ([RimworldHugsLibChecker](https://github.com/UnlimitedHugs/RimworldHugsLibChecker)). | ||
**Notice:** HugsLib must be installed as a separate mod by the players. The library itself is no longer to be included with your mods. You can, however, include the checker assembly to ensure that the player will be notified if they are missing the necessary version of the library ([RimworldHugsLibChecker](https://github.com/UnlimitedHugs/RimworldHugsLibChecker)). | ||
|
||
## Current features | ||
- Mod foundation: Base class to build mods on. Extending classes have access to custom logging, settings, and receive the following events from the library controller: Initialize, Tick, Update, FixedUpdate, OnGUI, WorldLoaded, MapComponentsInitializing, MapLoaded, SceneLoaded, SettingsChanged, DefsLoaded. | ||
- Mod foundation: Base class to build mods on. Extending classes have access to custom logging, settings, and receive the following events from the library controller: Initialize, DefsLoaded, Tick, Update, FixedUpdate, OnGUI, WorldLoaded, MapComponentsInitializing, MapLoaded, MapDiscarded, SceneLoaded, SettingsChanged. | ||
- Persistent in-game settings: Implementing mods can create custom settings of various types that can be changed by the player in the new Mod Settings menu. Settings are stored in a file in the user folder. | ||
- Mod update news: Mods can provide a message for each version they release, highlighting new features. These messages will be shown once to the player the next time he starts the game. This is a good way to ensure that new mod features do not go unnoticed by the majority of players. This is especially true on Steam, where the player may not have even read the description before subscribing. Messages include support for images and basic formatting. | ||
- Log publisher: Adds a keyboard shortcut (**Ctrl+F12**) to publish the logs from within the game. Returns a URL that you can share with others or send to a mod author. The published logs also include the list of running mods and their versions. This is a great way for a mod author to get the logs from a player who is experiencing an issue with his mod. | ||
- Log publisher: Adds a keyboard shortcut (**Ctrl+F12**) to publish the logs from within the game. Returns a URL that you can share with others or send to a mod author. The published logs also include the list of running mods and their versions, as well as the full list of active Harmony patches. This is a great way for a mod author to get the logs from a player who is experiencing an issue with his mod. | ||
- Checker assembly: A small dll designed to be included with your mod, that ensures the player is running at least the version of the library you specify. A dialog is displayed if a problem is detected, helping the player to resolve the issue. This is how the library stays up to date. See [RimworldHugsLibChecker](https://github.com/UnlimitedHugs/RimworldHugsLibChecker) for more info. | ||
- UtilityWorldObjects: A convenient way to store your data in a save file. Since A16 MapComponents are no longer a reliable way to store your data, and UWO's are designed to be a drop-in replacement. | ||
- Custom tick scheduling: Includes tools for executing callbacks with a specified tick delay, and registering recurring ticks with non-standard intervals. Recurring ticks are distributed uniformly across the time spectrum, to minimize the performance impact of the ticking entity. | ||
- Detouring: provides special attributes for more convenient detouring. Detours are safety-checked to prevent improper use. Repeated detours of the same method are not allowed and will generate an error. Mods can implement special methods to handle detouring errors, which allows for graceful failure and easier pinpointing of player issues. | ||
- GUI injection: provides a special attribute that allows a method to be executed whenever a given window type is drawn. This allows to inject drawing code for any window in the game. | ||
- Auto-restarter: adds a prompt to the Mods dialog to restart the game when changes to the mod configuration have been made. Mod load order changes are also detected. | ||
- Log window additions: adds buttons to copy the selected log message and activate the log publisher. Also adds a menu to find common files: open the log file and browse the user data and mods folders. | ||
- Auto-restarter: Automatically restarts the game when the language is changed. | ||
- Log window additions: Adds a menu to find common files: open the log file and browse the user data and mods folders. | ||
- Harmony library: HugsLib includes the [Harmony library](https://github.com/pardeike/Harmony) by Andreas Pardeike. | ||
|
||
## Compatibility | ||
The only detour by the library itself is the `Window.WindowOnGUI` method, used to power the GUI injection system. | ||
There are no known compatibility issues at this time. Please use the [Harmony library](https://github.com/pardeike/Harmony) for your detouring needs and everything should work well together. | ||
|
||
## Usage | ||
This is a public library similar to CCL, designed to be easily updateable between Rimworld versions. Feel free to use it for your own projects. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using Verse; | ||
|
||
namespace HugsLib.Core { | ||
/// <summary> | ||
/// Entry point for the library. | ||
/// Instantiated by the game at the start of DoPlayLoad(). | ||
/// </summary> | ||
public class HugsLibMod : Mod { | ||
public HugsLibMod(ModContentPack content) : base(content) { | ||
HugsLibController.EarlyInitialize(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
using Verse; | ||
|
||
namespace HugsLib.Core { | ||
/// <summary> | ||
/// Provides an entry point for late controller setup during static constructor initialization. | ||
/// </summary> | ||
[StaticConstructorOnStartup] | ||
internal static class StaticInitalizer { | ||
static StaticInitalizer() { | ||
HugsLibController.Instance.LateInitalize(); | ||
} | ||
} | ||
} |
Oops, something went wrong.