Hey everyone,
After some discussion about what to do with ulx_motd.txt and our workshop installation a few weeks back, I think it was Mr. President that had the idea of just having some minimal configuration and setup, then have the default MOTD be generated on the fly. So, I started work on implementing this.
Then I may have gotten a teensy bit carried away.

I've just committed all of my latest code for MOTD generation to a new branch, and I'd love to have some
testing and feedback for whatever you guys feel is necessary:
https://github.com/TeamUlysses/ulx/tree/motd-generatorThe general idea is this:
- ulx_showmotd can be disabled, or set to a URL- This functionality has not changed whatsoever.
- Otherwise, instead of sending ulx_motd.txt, some configuration data is sent to the client, and the client will generate the HTML to be displayed.
- These configuration settings include content and some general font/color styling.
- Content generation is mostly static (what they put in is what will display), except for two special types: one that lists workshop/regular addons installed, and another that can list all of the users in specified group(s).
-
Users with customized HTML in ulx_motd.txt must now find a place to host their HTML file (Likely possible with fastDL, but I'm not sure), or use the new HTML generator.
- All settings can be configured within XGUI and saved/previewed on the fly. As with all XGUI things, settings are automatically propagated to all admins as necessary, no "refresh" is needed.
Everything is currently complete and ready to go, except that only the style settings are currently editable in XGUI. The content settings will take only a little bit more work to implement, and I expect to have it done in the next few days, time permitting.
---
Below is everything you may (or may not) want to know about it without having to fire up Gmod. Again, I'd love feedback for any part of this,
especially design, layout, and wording changes for the default content.
Here's my mockup for the HTML and basic design, which is fairly close to the final result:
https://dl.dropboxusercontent.com/u/3804211/motd.htmlHere's the initial settings for the generator:
; These settings describe the default configuration and text to be shown on the MOTD. This only applies if ulx showMotd is set to 1.
; All style configuration is set, and the values must be valid CSS.
; Under info, you may have as many sections as you like. Valid types include "text", "ordered_list", "list".
; Special type "mods" will automatically list workshop and regular addons in an unordered list.
; Special type "admins" will automatically list all users within the groups specified in contents.
; For an example of all of these items, please see the default file generated in ulx\lua\data.lua
"info"
{
"description" "Welcome to our server. Enjoy your stay!"
{
"title" "About This Server"
"type" "text"
"contents"
{
"This server is running ULX."
"To edit this default MOTD, open XGUI->Settings->Server->ULX MOTD, or edit data\ulx\motd.txt."
}
}
{
"title" "Rules"
"type" "ordered_list"
"contents"
{
"DON'T MESS WITH OTHER PLAYERS' STUFF. If they want help, they'll ask!"
"Don't spam."
"Have fun."
}
}
{
"title" "Reporting Rulebreakers"
"type" "list"
"contents"
{
"Contact an available admin on this server and let them know."
"Use @ before typing a chat message to send it to admins."
"If no admin is available, note the players name and the current time, then let an admin know as soon as they are available."
}
}
{
"title" "Installed Addons"
"type" "mods"
}
{
"title" "Our Admins"
"type" "admins"
"contents"
{
"superadmin"
"admin"
}
}
}
"style"
{
"borders"
{
"border_color" "#000000"
"border_thickness" "2px"
}
"colors"
{
"background_color" "#dddddd"
"header_color" "#82a0c8"
"header_text_color" "#ffffff"
"section_text_color" "#000000"
"text_color" "#000000"
}
"fonts"
{
"server_name"
{
"family" "Impact"
"size" "32px"
"weight" "normal"
}
"subtitle"
{
"family" "Impact"
"size" "20px"
"weight" "normal"
}
"section_title"
{
"family" "Impact"
"size" "26px"
"weight" "normal"
}
"regular"
{
"family" "Tahoma"
"size" "12px"
"weight" "normal"
}
}
}
Here's the actual rendered result using the above default file on my server:
https://dl.dropboxusercontent.com/u/3804211/motd_generated.htmlHere's a list of fonts and font weights I've provided for the XGUI editor to give users some options they can start working with:
local fontWeights = { "normal", "bold", "100", "200", "300", "400", "500", "600", "700", "800", "900", "lighter", "bolder" }
local commonFonts = { "Arial", "Arial Black", "Calibri", "Candara", "Cambria", "Consolas", "Courier New", "Fraklin Gothic Medium", "Futura", "Georgia", "Helvetica", "Impact", "Lucida Console", "Segoe UI", "Tahoma", "Times New Roman", "Trebuchet MS", "Verdana" }
And some screenshots of the XGUI settings:
http://ulyssesmod.net/xgui/motd_generator_1.pnghttp://ulyssesmod.net/xgui/motd_generator_2.pnghttp://ulyssesmod.net/xgui/motd_generator_3.pngHere's some relevant code bits as well, if you're interested:
Core templates and renderer:
https://github.com/TeamUlysses/ulx/blob/motd-generator/lua/ulx/modules/cl/motdmenu.lua#L51-L242Code that grabs the list of addons/admins to be displayed:
https://github.com/TeamUlysses/ulx/blob/motd-generator/lua/ulx/modules/sh/menus.lua#L41-L91