-
Notifications
You must be signed in to change notification settings - Fork 42
Mudlet UI and Mapper support #369
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Volte6
left a comment
There was a problem hiding this 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.
| information: | ||
| - client | ||
| - checkclient | ||
| - mudletmap | ||
| - mudletui |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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> |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
modules/gmcp/gmcp.Mudlet.go
Outdated
| 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) | ||
| } |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
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. |
Volte6
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good
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:
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).