Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 16 additions & 2 deletions StarControl.Gmcm/StarControl.Gmcm.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,22 @@
<ProjectReference Include="..\StarControl\StarControl.csproj" />
</ItemGroup>

<Target Name="Deploy" AfterTargets="Build">
<Copy SourceFiles="$(OutDir)StarControl.Gmcm.dll" DestinationFolder="$(SolutionDir)StarControl\assets\extensions" ContinueOnError="false" />
<!--
StarControl loads this extension at runtime from its deployed mod folder's
assets/extensions/ directory (see ModEntry: Helper.DirectoryPath/assets/extensions/
StarControl.Gmcm.dll). This project doesn't deploy itself (EnableModDeploy=False),
so copy the built DLL straight into StarControl's deployed assets/extensions folder.
The ProjectReference above ensures StarControl is built and deployed first, so the
target folder exists. Only StarControl.Gmcm.dll is needed; its dependencies resolve
against assemblies StarControl has already loaded.
-->
<Target Name="DeployGmcmExtension" AfterTargets="Build" Condition="'$(GameModsPath)' != ''">
<PropertyGroup>
<StarControlExtensionsDir>$(GameModsPath)\Star Control - CustomisationPlus\assets\extensions</StarControlExtensionsDir>
</PropertyGroup>
<MakeDir Directories="$(StarControlExtensionsDir)" />
<Copy SourceFiles="$(OutDir)StarControl.Gmcm.dll" DestinationFolder="$(StarControlExtensionsDir)" SkipUnchangedFiles="true" />
<Message Importance="high" Text="Deployed GMCM extension to $(StarControlExtensionsDir)" />
</Target>

</Project>
7 changes: 7 additions & 0 deletions StarControl/ModEntry.cs
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,13 @@ private void OpenRemappingMenu()
var controller = ViewEngine.OpenRootMenu("Remapping", context);
context.Controller = controller;
controller.PositionSelector = context.GetMenuPosition;
// StardewUI's menu sets Game1.displayHUD = false while it's open and never restores
// it on close, which permanently hides the HUD (and the latched value then poisons
// the radial wheel's own HUD save/restore on the next open). Capture the HUD state
// and restore it when the menu closes. Note: the Closing event (cleanupBeforeExit
// lifecycle) is the one that fires at actual close time; Closed fires at open.
var hudWasVisible = Game1.displayHUD;
controller.Closing += () => Game1.displayHUD = hudWasVisible;
Game1.activeClickableMenu = controller!.Menu;
}

Expand Down