Skip to content

Conversation

@MorquinDevlar
Copy link
Contributor

Description

This adds support for the GoMud UI for the Mudlet client.

The UI is split in two parts, the actual UI and a mapper script. If anyone wants to write their own UI, they can use the mapper script by itself.

This update also adds a mudletui command to the game, as well as a few other functions to enable detection, installation, removal and updating the Mudlet UI directly with in-game commands.

Also added is support for an ENV variable CONSOLE_GMCP_OUTPUT to enable/disable GMCP console output.

Still to do:

  • Add Discord Rich Presence support for Mudlet (I did not want to make this PR too big)
  • Add support for sending messages back to the game engine form the UI using GMCP
  • Add support for re-sending GMCP messages on request from the UI
  • Several additions to the UI and mapper script will be forthcoming, but they will auto-update as they are released.
  • And much more to come...

Changes

  • Added mudletui game command to install/remove/update Mudlet UI

  • Added checkclient game command (sends login message about detecting Mudlet)

  • Added special UI supported GMCP messages (for removal and update)

  • Added auto-install of custom mapper script (non user controllable)

  • Added small default map of some of Frostfang to get the player started

  • Added helpfiles for everything

  • Changed GMCP console output to using ENV variable CONSOLE_GMCP_OUTPUT (0/1) to control if admin user GMCP messages are sent to console. Defaults to off (0).

@MorquinDevlar MorquinDevlar requested a review from Volte6 as a code owner May 6, 2025 06:57
@MorquinDevlar MorquinDevlar self-assigned this May 6, 2025
Copy link
Member

@Volte6 Volte6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Only a couple small changes needed.

The main blocker is around how the config file is being loaded.

Comment on lines 6 to 10
information:
- client
- checkclient
- mudletmap
- mudletui
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CONSIDER: A new category, instead of information, we can use interface or something - we can then put other stuff in there too, like the screenreader mode.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea. I'll set that up 👍


<ansi fg="command">checkclient</ansi> - Shows details about detected client features and available enhancements

<ansi fg="subtitle">NOTES:</ansi>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a custom ansi class - can you include afiles/data-overlays/ansi-aliases.yaml? See an example in auctions here: https://github.com/GoMudEngine/GoMud/blob/master/modules/auctions/files/data-overlays/ansi-aliases.yaml

Shouldn't require any code changes, just the datafile with the color class definition.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't even realize I left that in. I create a new one or use an existing one.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Create a new ansi-aliases.yaml within your module folder (in files/data-overlays/. This will allow you to either override or define new ansi alises that will be used by your module.

Comment on lines 69 to 73
configData, err := files.ReadFile("files/data-overlays/mudlet-config.yaml")
if err == nil {
// Only try to unmarshal if we successfully read the file
_ = yaml.Unmarshal(configData, &g.config)
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pattern you want to use here is:

if mapURL, ok := g.plug.Config.Get(`MapperURL`).(string); ok {
  // Do something with mapURL
}

I do see how this pattern of loading all the config file into a struct could be useful though. I'll try and think how we can support that with some changes down the line.

But this implementation you have is looking for the read-only config file that will embedded within the binary. We should never be trying to do that, since any user changes via the config-overrides.yaml or the server set command will be ignored.

The g.plug.Config.Get(... will give you the override, or the default if overrides not set.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the clarification. I'm constantly learning.

@MorquinDevlar MorquinDevlar requested a review from Volte6 May 6, 2025 18:30
@MorquinDevlar
Copy link
Contributor Author

Should be all fixed now.

There are still some changes I probably would want to make, but as you mentioned. Done is better then perfect :)

I'll push some minor changes in a new PR later.

Copy link
Member

@Volte6 Volte6 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

@MorquinDevlar MorquinDevlar merged commit 31e5425 into GoMudEngine:master May 6, 2025
2 checks passed
@MorquinDevlar MorquinDevlar deleted the mudlet-gmcp branch May 6, 2025 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants