SMAPI - Stardew Modding API

SMAPI - Stardew Modding API

971k Downloads

Add option to hide the SMAPI console

M-AlNoaimi opened this issue ยท 6 comments

commented

Not exactly sure if this was already made or not but here I go.

The console in my preference should be either removed or create a config to enable/disable it.

commented

Wouldn't it be theoretically possible to run SMAPI in the background and create an icon in the system tray and make the console window hidden behind a command line option?
Edit: It's just an idea, I have zero experience with .NET, I just know it's pretty easy in the rust world, Idk how difficult this would be here.

commented

Not sure how similar SMAPI code is to Baldur's Gate 3 Script Editor I figured I'd mention it since it is a modding API and has a console but everything runs in the background by default and you have to enable the console window in the config file if you want it to show. My whole point being that it does seem like it could be possible.

commented

@pipedream420 There are two main console differences between SMAPI and BG3SE:

  • SMAPI launches Stardew Valley within its own process, whereas Baldur's Gate 3 loads BG3SE. That means BG3SE can just avoid creating a console window, but that's not an option for SMAPI which is fundamentally a console application (with the window created automatically before any SMAPI code runs).

  • The SMAPI console is meant for players by default (unless you get the 'SMAPI for developers' version). That's the only place that shows whether your mods are loaded along with any errors, warnings, and update alerts. It's already filtered by default to hide technical logs that may not be relevant to players.

    There are also cases where you can't launch the game without seeing the console (e.g. the confirmation prompt after a hard game crash); hiding the console in those cases would make the game unlaunchable.

So we could link to unofficial methods to hide it (e.g. minimize to tray tools), but an official option to hide it wouldn't really make sense for SMAPI's design.

commented

@darrenoc3 Sure! The approach used on Linux/macOS wouldn't work on Windows, but I'm open to a PR to add an explicit opt-in CLI argument.

commented

Claiming that it doesn't really make sense for SMAPI's design doesn't stand up to scrutiny considering --no-terminal works the way the user expects on Linux and MacOS. There's dozens of discussions on Google Search over the years about folks wanting to hide the console so it's strange that you are so opposed to a similar solution for Windows using a log file.

Full disclosure: I am saying this as a guy whose partner left the room in a flood of tears because she accidentally closed the console window and lost our entire day's progress, so I'm inherently biased. But there seems to have been many requests for this to be added over the years. If you're amenable I could probably raise a PR to add a command line flag for it myself.

commented

The console window is SMAPI, so unfortunately adding an option to hide it isn't really feasible.