Move greetings to exp_scenario and drop preset colours

The greeting reads the community name and Discord link from the new
community_details feature, which exp_legacy can not depend on, so it moves
to exp_scenario/control/greetings.lua along with its commands and
locale. The custom message still lives in PlayerData for now.

The hardcoded per-player join messages in config/join_messages.lua are
removed with their fallback, as are the preset player colours. Player
sync already restores the colour of returning players, so new players
keep the colour Factorio gives them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
bbassieandClaude Opus 5.5 committed 2026-10-14 22:10:22 +00:00
1 parent a6c453a88e
commit 4d3c4de5b1
15 files changed
+74 -159

No files matched your search

@@ -8,7 +8,5 @@ return {
--- Data
"modules.data.statistics",
"modules.data.player-colours",
"modules.data.greetings",
"modules.data.language",
}
@@ -1,8 +0,0 @@
return {
Cooldude2606 = "Lua lets you set metatables on numbers, did you know that? Cooldude2606 knows this.",
samy115 = "Tremble in fear as the banhammer is now here, its owner: samy115",
XenoCyber = '"Fire Fire Fire" oops wrong game, have no fear XenoCyber is here',
HunterOfGames = "Unable to support HunterOfGames. You must construct additional miners.",
ookl = 'ookl says: "Pineapples are amazing, hello everyone!"',
arty714 = "Arty\'s Potato made it!",
}
@@ -1,33 +0,0 @@
--- Preset colours that players get when they join the server, if not in the list then will be given a random colour (which isnt disallowed)
-- @config Preset-Player-Colours
return {
players = { --- @setting players list of all players and the colour in rgb256 that they will recive upon joining
PHIDIAS0303 = { r = 255, g = 255, b = 255 },
BADgamerNL = { r = 255, g = 20, b = 147 },
arty714 = { r = 150, g = 68, b = 161 },
Cooldude2606 = { r = 57, g = 192, b = 207 },
mark9064 = { r = 99, g = 0, b = 255 },
eissturm = { r = 25, g = 25, b = 112 },
Sakama = { r = 20, g = 213, b = 80 },
freek18 = { r = 50, g = 0, b = 255 },
aldldl = { r = 0, g = 131, b = 255 },
NAD4X4 = { r = 135, g = 206, b = 250 },
cydes = { r = 82, g = 249, b = 155 },
UUBlueFire = { r = 0, g = 204, b = 255 },
CmonMate497 = { r = 103, g = 224, b = 194 },
s4sh = { r = 255, g = 120, b = 0 },
ArPiiX = { r = 0, g = 255, b = 0 },
NextIdea = { r = 255, g = 255, b = 255 },
hamsterbryan = { r = 0, g = 255, b = 0 },
XenoCyber = { r = 0, g = 128, b = 255 },
},
disallow = { --- @setting disallow colours which will not given to players; the value does not matter it is only the key which is checked
black = { r = 0, g = 0, b = 0 },
white = { r = 255, g = 255, b = 255 },
success = { r = 0, g = 255, b = 0 },
warning = { r = 255, g = 255, b = 0 },
fail = { r = 255, g = 0, b = 0 },
info = { r = 255, g = 255, b = 255 },
},
}
@@ -1,11 +0,0 @@
--- Config file for the server detail
-- @config Server
return {
community_name = "Explosive Gaming",
discord = "https://discord.explosivegaming.nl",
website = "https://www.explosivegaming.nl",
status = "https://status.explosivegaming.nl",
github = "https://github.com/explosivegaming/ExpCluster",
patreon = "https://www.patreon.com/ExpGaming"
}
-9
View File
@@ -14,15 +14,6 @@ redmew=We don't talk about redmew here; they beat us to 1000 members ;-;
lhd=All trains must be LHD! This is a long standing rule on our servers, please respect this.
# data
[join-message]
description-add=Sets / Gets your custom join message.
description-remove=Removes you custom join message.
arg-message=Your custom join message.
greet=[color=0,1,0] Welcome to __1__ community server! If you like the server join our discord: __2__ [/color]
message-set=Your join message has been updated.
message-get=Your join message is: __1__
message-cleared=Your join message has been cleared.
[exp-settings]
JoinMessage=Join Message
JoinMessage-tooltip=The message displayed when you join
-9
View File
@@ -14,15 +14,6 @@ redmew=We don't talk about redmew here; they beat us to 1000 members ;-;
lhd=列車必須是左則通行。這是本服務器長久以來的規則。
# data
[join-message]
description-add=設定 / 取得你的加入信息。
description-remove=移除你的加入信息。
arg-message=你的加入信息。
greet=[color=0,1,0] 歡迎來到 __1__ 的服務器! 若果你喜歡本服務器可加入 Discord: __2__ [/color]
message-set=你的加入信息已更新。
message-get=你的加入信息為: __1__
message-cleared=你的加入信息已清除。
[exp-settings]
JoinMessage=加入信息
JoinMessage-tooltip=你加入時所顯示的信息
-9
View File
@@ -14,15 +14,6 @@ redmew=We don't talk about redmew here; they beat us to 1000 members ;-;
lhd=列車必須是左則通行。這是本服務器長久以來的規則。
# data
[join-message]
description-add=設定 / 取得你的加入信息。
description-remove=移除你的加入信息。
arg-message=你的加入信息。
greet=[color=0,1,0] 歡迎來到 __1__ 的服務器! 若果你喜歡本服務器可加入 Discord: __2__ [/color]
message-set=你的加入信息已更新。
message-get=你的加入信息為: __1__
message-cleared=你的加入信息已清除。
[exp-settings]
JoinMessage=加入信息
JoinMessage-tooltip=你加入時所顯示的信息
@@ -1,50 +0,0 @@
--- Greets players on join
-- @data Greetings
local config = require("modules.exp_legacy.config.join_messages") --- @dep config.join_messages
local config_server_detail = require("modules.exp_legacy.config.server_detail") --- @dep config.server_detail
local Commands = require("modules/exp_commands")
--- Stores the join message that the player have
local PlayerData = require("modules.exp_legacy.expcore.player_data") --- @dep expcore.player_data
local CustomMessages = PlayerData.Settings:combine("JoinMessage")
CustomMessages:set_metadata{
permission = "exp_scenario.command.set_join_message",
}
--- When a players data loads show their message
CustomMessages:on_load(function(player_name, player_message)
local player = game.players[player_name]
local custom_message = player_message or config[player_name]
if custom_message then
game.print(custom_message, { color = player.color })
else
player.print{
"join-message.greet",
config_server_detail["community_name"],
config_server_detail["discord"]
}
end
end)
--- Set your custom join message
Commands.new("set-join-message", { "join-message.description-add" })
:optional("message", false, Commands.types.string_max_length(255))
:enable_auto_concatenation()
:add_aliases{ "join-message" }
:register(function(player, message)
--- @cast message string?
if message then
CustomMessages:set(player, message)
return Commands.status.success{ "join-message.message-set" }
else
return Commands.status.success{ "join-message.message-get", CustomMessages:get(player) }
end
end)
--- Removes your custom join message
Commands.new("remove-join-message", { "join-message.description-remove" })
:register(function(player)
CustomMessages:remove(player)
return Commands.status.success{ "join-message.message-cleared" }
end)
@@ -1,28 +0,0 @@
--- Gives players random colours when they are created, also applies preset colours to those who have them
--- Inventory sync restores the colour of players who have played before
-- @data Player-Colours
local Event = require("modules/exp_legacy/utils/event") --- @dep utils.event
local Colours = require("modules/exp_util/include/color")
local config = require("modules.exp_legacy.config.preset_player_colours") --- @dep config.preset_player_colours
--- Returns a colour that is a bit lighter than the one given
local function lighten(c)
return { r = 255 - (255 - c.r) * 0.5, g = 255 - (255 - c.g) * 0.5, b = 255 - (255 - c.b) * 0.5, a = 255 }
end
--- Apply the preset colour of the player, or a random one if there is none
Event.add(defines.events.on_player_created, function(event)
local player = game.players[event.player_index]
local colour = config.players[player.name]
if not colour then
local colour_name = "white"
while config.disallow[colour_name] do
colour_name = table.get_random(Colours, true)
end
colour = Colours[colour_name]
end
player.color = colour
player.chat_color = lighten(colour)
end)
+1
View File
@@ -52,6 +52,7 @@ add(require("modules/exp_scenario/control/discord_alerts"))
add(require("modules/exp_scenario/control/features"))
add(require("modules/exp_scenario/control/extra_logging"))
add(require("modules/exp_scenario/control/fast_deconstruction"))
add(require("modules/exp_scenario/control/greetings"))
add(require("modules/exp_scenario/control/help_bubbles"))
add(require("modules/exp_scenario/control/inserter_pickup"))
add(require("modules/exp_scenario/control/inventory_clear"))
+46
View File
@@ -0,0 +1,46 @@
--[[-- Control - Greetings
Greets players when they join, players can set a message shown to everyone instead
]]
local Commands = require("modules/exp_commands")
local community_details = require("modules/exp_scenario/config/community_details").config
local PlayerData = require("modules.exp_legacy.expcore.player_data")
local CustomMessages = PlayerData.Settings:combine("JoinMessage")
CustomMessages:set_metadata{
permission = "exp_scenario.command.set_join_message",
}
--- Show the message of a player once their data loads, or greet them
CustomMessages:on_load(function(player_name, player_message)
local player = assert(game.get_player(player_name))
if player_message then
game.print(player_message, { color = player.color })
else
player.print{ "exp_greetings.greet", community_details.community_name, community_details.discord }
end
end)
--- Set your custom join message
Commands.new("set-join-message", { "exp_greetings.description-set" })
:optional("message", { "exp_greetings.arg-message" }, Commands.types.string_max_length(255))
:enable_auto_concatenation()
:add_aliases{ "join-message" }
:register(function(player, message)
--- @cast message string?
if message then
CustomMessages:set(player, message)
return Commands.status.success{ "exp_greetings.message-set" }
else
return Commands.status.success{ "exp_greetings.message-get", CustomMessages:get(player) or "" }
end
end)
--- Removes your custom join message
Commands.new("remove-join-message", { "exp_greetings.description-remove" })
:register(function(player)
CustomMessages:remove(player)
return Commands.status.success{ "exp_greetings.message-cleared" }
end)
return {}
+9
View File
@@ -586,6 +586,15 @@ chat-enabled=enabled
chat-disabled=disabled
chat-toggle=Fast decon has been __1__
[exp_greetings]
description-set=Sets / Gets your custom join message.
description-remove=Removes you custom join message.
arg-message=Your custom join message.
greet=[color=0,1,0] Welcome to __1__ community server! If you like the server join our discord: __2__ [/color]
message-set=Your join message has been updated.
message-get=Your join message is: __1__
message-cleared=Your join message has been cleared.
[exp_nuke-protection]
chat-found=You cannot have __1__ in your inventory, so it was placed into the chests at spawn.
+9
View File
@@ -578,6 +578,15 @@ chat-enabled=啟用
chat-disabled=停用
chat-toggle=樹木快速拆除已 __1__
[exp_greetings]
description-set=設定 / 取得你的加入信息。
description-remove=移除你的加入信息。
arg-message=你的加入信息。
greet=[color=0,1,0] 歡迎來到 __1__ 的服務器! 若果你喜歡本服務器可加入 Discord: __2__ [/color]
message-set=你的加入信息已更新。
message-get=你的加入信息為: __1__
message-cleared=你的加入信息已清除。
[exp_nuke-protection]
chat-found=你的用戶組不允許你有 __1__ ,所以該物品已放在出生點的箱子。
+9
View File
@@ -578,6 +578,15 @@ chat-enabled=啟用
chat-disabled=停用
chat-toggle=樹木快速拆除已 __1__
[exp_greetings]
description-set=設定 / 取得你的加入信息。
description-remove=移除你的加入信息。
arg-message=你的加入信息。
greet=[color=0,1,0] 歡迎來到 __1__ 的服務器! 若果你喜歡本服務器可加入 Discord: __2__ [/color]
message-set=你的加入信息已更新。
message-get=你的加入信息為: __1__
message-cleared=你的加入信息已清除。
[exp_nuke-protection]
chat-found=你的用戶組不允許你有 __1__ ,所以該物品已放在出生點的箱子。