Skip to content

HugsLib 7.2 Update Notes

UnlimitedHugs edited this page May 21, 2020 · 2 revisions

Compatibility

This update contains no breaking changes and should not require recompiling any mods using the library.
I can't guarantee full reflection or patch compatibility, but internal changes are mostly limited to UpdateFeatureManager, Dialog_ModSettings and Dialog_UpdateFeatures. I trust you have the necessary fallbacks and error messages in place if you access the internals of other mods.

Changes

Quickstarter

  • Status box on startup: There is now a fancy status window that shows the pending quickstarter operation (when enabled). Canceling the quickstart is now a lot more responsive- it's enough to press the button instead of having to hold it down until loading completes.
  • Load most recent save: A new quickstart mode.
  • "Load now" and "Generate now" tweak: The buttons will no longer switch the quickstarter into the respective mode. Hold the Shift key while clicking to do that.

Mod update news

  • News no longer shown to first-time players by default: In other words, if a player just installed your mod, they will not see a popup with all past update news. This can be customized via the targetAudience field of your UpdateFeatureDefs. See the updated wiki page for details.
  • Extended news window: When opened via Options > Mod Settings > All mod update news or the shortcut key, the news window will have a button for filtering news by mod, and a tools menu when dev mode is on.
  • Update news dev tools: Accessed via the extended news window- look for the hamburger menu button in the titles of the news items. The tools include setting the last seen news version for your mod, opening the news popup, and setting the first-time player state. The purpose is to make sure your news will appear correctly to the players.
  • News defs live reload: Press F5 in the extended update news window to reload all UpdateFeatureDefs. Very handy when authoring news content, as it will save you a few restarts while getting the layout of your content right.
  • Shortcut: open update news window: Unassigned by default.
  • Update news background loading: News XML files are now loaded in a background thread for faster game startup. Def parsing still happens in the loading thread, so thread safety should be preserved.

Mod settings

  • Hover menu: the mod settings window now shows two buttons when hovering over a setting entry: info and menu. Info will show an immediate tooltip with the setting description when hovered, and menu will open a customizable context menu, which includes the reset option.
  • Custom context actions: SettingHandle and ModSettingsPack can now be assigned custom entries that will appear when their context menu is opened. Menus with custom entries show a special icon to attract the attention of the player. See the updated wiki page for details.
  • Reset all settings for a mod: This can be done in the mod settings window, via the context menu in the entry of the mod. Hidden settings will also be reset if the player checks the option in the confirm dialog. The CanBeReset property is, of course, respected.
  • SettingHandle.CustomDrawerFullWidth: A new setting drawer that gives full control over how a setting appears in the mod setting window. See the updated wiki page for details.
  • Save settings on exit: Unsaved settings are now automatically saved when the game closes. This is fairly reliable, but changes will, of course, be lost if the game crashes.
  • SettingHandle.CustomDrawer auto-flags modified: When drawing a custom control for a SettingHandleConvertible, the handle will be automatically flagged as modified when the custom drawer returns true. Before this change, flagging had to be done manually via HasUnsavedChanges for the modified value to be saved.
  • Shortcut: open mod settings window: Unassigned by default.
  • Improved performance: The mod settings window should now be significantly more responsive, especially when a lot of settings are visible.

Other stuff

  • Mod Spotter: A way for mods to identify when they are run by the player for the first time. See the new wiki page for details.
  • ModBase.ApplicationQuit event: Called when the game is about to exit. See the updated wiki page for details.
  • HugsLib version check: Mods can specify a minimum version of the library they require. The player will be shown an update prompt if the requirement is not met. See the new wiki page for details.
    This feature has been moved from the now defunct HugsLib checker.
  • Slight OnGUI event timing change: One of the additions in this update required the OnGUI event hook to be moved to a later point. This might affect mods that interact with the map or world camera during the OnGUI callback, but any issues are unlikely.
    7.2.1 update: this change has been reverted: the timing change had other unintended side effects.
  • Manifest.xml version in log publisher: If your mod is using the About/Manifest.xml for versioning (hey Fluffy), that version will now appear in the log publisher with an [mv:1.2.3] tag.
  • Full paths for nested patches: The log publisher will now include the full paths to nested patched methods. What used to be reported as <>c.<MakeNewToils>b__4_2 now becomes JobDriver_Repair.<>c.<MakeNewToils>b__4_2. Contributed by LecrisUT.
  • Fixed log publisher on MacOS