mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-01-18 03:21:47 +02:00
commit
ab2b3edb63
@ -10,7 +10,7 @@ global.config = {
|
||||
-- The title of the map
|
||||
map_name_key = 'This Map has no name',
|
||||
-- The long description of the map, typically 1 paragraph
|
||||
map_description_key = "This section is supposed to be filled out on a per map basis. If you're seeing this message, ping the admin team to get a description added for this map. A 20 coin bonus is available to the first person to point this out.",
|
||||
map_description_key = "This section is supposed to be filled out on a per map basis.\nIf you're seeing this message, ping the admin team to get a description\nadded for this map. 20 coins is rewarded to the first person that points this out.",
|
||||
-- The feature list of the map
|
||||
map_extra_info_key = 'This map has no extra information',
|
||||
-- New Scenario Features, appears in the "What's new" tab
|
||||
|
@ -17,6 +17,7 @@ local config_prewards = config.player_rewards
|
||||
|
||||
local normal_color = Color.white
|
||||
local focus_color = Color.dark_orange
|
||||
local unfocus_color = Color.black
|
||||
|
||||
local reward_amount = 2
|
||||
local reward_plural_indicator = reward_amount > 1 and 's' or ''
|
||||
@ -80,7 +81,8 @@ end
|
||||
local changelog_callback = Token.register(process_changelog)
|
||||
|
||||
local function prepare_title()
|
||||
local welcome_title = [[
|
||||
local welcome_title =
|
||||
[[
|
||||
111111 1111111 111111 111 111 1111111 11 11
|
||||
11 11 11 11 11 1111 1111 11 11 11
|
||||
111111 11111 11 11 11 1111 11 11111 11 1 11
|
||||
@ -167,7 +169,9 @@ local pages = {
|
||||
end,
|
||||
content = function(parent)
|
||||
local parent_style = parent.style
|
||||
parent_style.right_padding = 2
|
||||
parent_style.right_padding = 0
|
||||
parent_style.left_padding = 0
|
||||
parent_style.top_padding = 1
|
||||
|
||||
parent =
|
||||
parent.add {
|
||||
@ -176,9 +180,9 @@ local pages = {
|
||||
horizontal_scroll_policy = 'never'
|
||||
}
|
||||
parent_style = parent.style
|
||||
parent_style.vertically_stretchable = true
|
||||
parent_style.vertically_stretchable = false
|
||||
|
||||
header_label(parent, 'Welcome to the Redmew Server!')
|
||||
header_label(parent, 'Welcome to Redmew!')
|
||||
centered_label(
|
||||
parent,
|
||||
[[
|
||||
@ -189,14 +193,26 @@ We are a friendly bunch, our objective is to have as much fun as possible and we
|
||||
)
|
||||
|
||||
header_label(parent, 'How To Chat')
|
||||
centered_label(parent, [[
|
||||
centered_label(
|
||||
parent,
|
||||
[[
|
||||
To chat with other players, press the "grave" key on your keyboard.
|
||||
It is below the ESC key on English keyboards and looks like ~ or `
|
||||
This can be changed in options -> controls -> "toggle lua console".
|
||||
]])
|
||||
]]
|
||||
)
|
||||
|
||||
if config_prewards.enabled and config_prewards.info_player_reward then
|
||||
local string = format('You have been given %s %s%s for looking at the welcome tab.\nChecking each tab will reward you %s more %s%s.\n', reward_amount, reward_token, reward_plural_indicator, reward_amount, reward_token, reward_plural_indicator)
|
||||
local string =
|
||||
format(
|
||||
'You have been given %s %s%s for looking at the welcome tab.\nChecking each tab will reward you %s more %s%s.\n',
|
||||
reward_amount,
|
||||
reward_token,
|
||||
reward_plural_indicator,
|
||||
reward_amount,
|
||||
reward_token,
|
||||
reward_plural_indicator
|
||||
)
|
||||
header_label(parent, 'Free Coins')
|
||||
centered_label(parent, string)
|
||||
end
|
||||
@ -208,16 +224,21 @@ This can be changed in options -> controls -> "toggle lua console".
|
||||
discord_textbox_flow_style.horizontal_align = 'center'
|
||||
discord_textbox_flow_style.horizontally_stretchable = true
|
||||
discord_textbox_flow.add({type = 'label', caption = 'Discord: '}).style.font = 'default-bold'
|
||||
local discord_textbox = discord_textbox_flow.add {type = 'text-box', text = 'redmew.com/discord '}
|
||||
local discord_textbox =
|
||||
discord_textbox_flow.add {type = 'text-box', text = 'https://www.redmew.com/discord '}
|
||||
discord_textbox.read_only = true
|
||||
discord_textbox.style.width = 235
|
||||
discord_textbox.style.height = 28
|
||||
centered_label(parent, 'Contribute to our Patreon to receive special perks and help maintain our servers.')
|
||||
local patreon_flow = parent.add {type = 'flow', direction = 'horizontal'}
|
||||
local patreon_flow_style = patreon_flow.style
|
||||
patreon_flow_style.horizontal_align = 'center'
|
||||
patreon_flow_style.horizontally_stretchable = true
|
||||
patreon_flow.add({type = 'label', caption = 'Patreon:'}).style.font = 'default-bold'
|
||||
local patreon_textbox = patreon_flow.add {type = 'text-box', text = 'patreon.com/redmew '}
|
||||
local patreon_textbox = patreon_flow.add {type = 'text-box', text = 'https://www.patreon.com/redmew '}
|
||||
patreon_textbox.read_only = true
|
||||
patreon_textbox.style.width = 235
|
||||
patreon_textbox.style.height = 28
|
||||
centered_label(parent, 'Download our maps, start and finish state, from our website.')
|
||||
local save_textbox_flow = parent.add {type = 'flow'}
|
||||
local save_textbox_flow_style = save_textbox_flow.style
|
||||
@ -226,15 +247,19 @@ This can be changed in options -> controls -> "toggle lua console".
|
||||
save_textbox_flow.add({type = 'label', caption = 'Saves: '}).style.font = 'default-bold'
|
||||
local save_textbox = save_textbox_flow.add {type = 'text-box', text = 'http://www.redmew.com/saves/ '}
|
||||
save_textbox.read_only = true
|
||||
|
||||
save_textbox.style.width = 235
|
||||
save_textbox.style.height = 28
|
||||
centered_label(parent, 'View our past maps as a Google Map.')
|
||||
local maps_textbox_flow = parent.add {type = 'flow'}
|
||||
local maps_textbox_flow_style = maps_textbox_flow.style
|
||||
maps_textbox_flow_style.horizontal_align = 'center'
|
||||
maps_textbox_flow_style.horizontally_stretchable = true
|
||||
maps_textbox_flow.add({type = 'label', caption = 'Maps: '}).style.font = 'default-bold'
|
||||
local maps_textbox = maps_textbox_flow.add {type = 'text-box', text = 'https://factoriomaps.com/browse/redmew.html '}
|
||||
local maps_textbox =
|
||||
maps_textbox_flow.add {type = 'text-box', text = 'https://factoriomaps.com/browse/redmew.html '}
|
||||
maps_textbox.read_only = true
|
||||
maps_textbox.style.width = 315
|
||||
maps_textbox.style.height = 28
|
||||
|
||||
parent.add({type = 'flow'}).style.height = 24
|
||||
end
|
||||
@ -245,6 +270,20 @@ This can be changed in options -> controls -> "toggle lua console".
|
||||
return button
|
||||
end,
|
||||
content = function(parent)
|
||||
local parent_style = parent.style
|
||||
parent_style.right_padding = 0
|
||||
parent_style.left_padding = 0
|
||||
parent_style.top_padding = 1
|
||||
|
||||
parent =
|
||||
parent.add {
|
||||
type = 'flow',
|
||||
direction = 'vertical'
|
||||
}
|
||||
parent_style = parent.style
|
||||
parent_style.vertically_stretchable = false
|
||||
parent_style.width = 600
|
||||
|
||||
header_label(parent, 'Rules')
|
||||
|
||||
centered_label(
|
||||
@ -266,14 +305,14 @@ If you suspect someone is griefing, notify the admin team by using /report or by
|
||||
end,
|
||||
content = function(parent, player)
|
||||
local read_only = not player.admin
|
||||
local text_width = 480
|
||||
local text_width = 490
|
||||
|
||||
local top_flow = parent.add {type = 'flow'}
|
||||
local top_flow_style = top_flow.style
|
||||
top_flow_style.horizontal_align = 'center'
|
||||
top_flow_style.horizontally_stretchable = true
|
||||
|
||||
local top_label = top_flow.add {type = 'label', caption = 'Map Infomation'}
|
||||
local top_label = top_flow.add {type = 'label', caption = 'Map Information'}
|
||||
local top_label_style = top_label.style
|
||||
top_label_style.font = 'default-dialog-button'
|
||||
|
||||
@ -289,11 +328,11 @@ If you suspect someone is griefing, notify the admin team by using /report or by
|
||||
text = editable_info[map_name_key]
|
||||
}
|
||||
map_name_textbox.read_only = read_only
|
||||
map_name_textbox.word_wrap = true
|
||||
--map_name_textbox.word_wrap = true
|
||||
|
||||
local map_name_textbox_style = map_name_textbox.style
|
||||
map_name_textbox_style.width = text_width
|
||||
map_name_textbox_style.maximal_height = 27
|
||||
map_name_textbox_style.maximal_height = 30
|
||||
|
||||
Gui.set_data(map_name_textbox, map_name_key)
|
||||
|
||||
@ -305,11 +344,13 @@ If you suspect someone is griefing, notify the admin team by using /report or by
|
||||
text = editable_info[map_description_key]
|
||||
}
|
||||
map_description_textbox.read_only = read_only
|
||||
map_description_textbox.word_wrap = true
|
||||
--map_description_textbox.word_wrap = true
|
||||
|
||||
local map_description_textbox_style = map_description_textbox.style
|
||||
map_description_textbox_style.width = text_width
|
||||
map_description_textbox_style.maximal_height = 72
|
||||
map_description_textbox_style.minimal_height = 80
|
||||
map_description_textbox_style.vertically_stretchable = true
|
||||
map_description_textbox_style.maximal_height = 100
|
||||
|
||||
Gui.set_data(map_description_textbox, map_description_key)
|
||||
|
||||
@ -321,7 +362,7 @@ If you suspect someone is griefing, notify the admin team by using /report or by
|
||||
text = editable_info[map_extra_info_key]
|
||||
}
|
||||
map_extra_info_textbox.read_only = read_only
|
||||
map_extra_info_textbox.word_wrap = true
|
||||
--map_extra_info_textbox.word_wrap = true
|
||||
|
||||
local map_extra_info_textbox_style = map_extra_info_textbox.style
|
||||
map_extra_info_textbox_style.width = text_width
|
||||
@ -337,7 +378,9 @@ If you suspect someone is griefing, notify the admin team by using /report or by
|
||||
end,
|
||||
content = function(parent, player)
|
||||
local parent_style = parent.style
|
||||
parent_style.right_padding = 2
|
||||
parent_style.right_padding = 0
|
||||
parent_style.left_padding = 0
|
||||
parent_style.top_padding = 1
|
||||
|
||||
parent =
|
||||
parent.add {
|
||||
@ -517,7 +560,7 @@ Shows number of rockets launched and biters liberated.]]
|
||||
|
||||
header_label(parent, 'New Features')
|
||||
|
||||
local new_info_flow = parent.add {type = 'flow'}
|
||||
local new_info_flow = parent.add {name = 'whatsNew_new_info_flow', type = 'flow'}
|
||||
new_info_flow.style.horizontal_align = 'center'
|
||||
|
||||
local new_info_textbox =
|
||||
@ -529,8 +572,9 @@ Shows number of rockets launched and biters liberated.]]
|
||||
new_info_textbox.read_only = read_only
|
||||
|
||||
local new_info_textbox_style = new_info_textbox.style
|
||||
new_info_textbox_style.width = 590
|
||||
new_info_textbox_style.height = 300
|
||||
new_info_textbox_style.width = 600
|
||||
new_info_textbox_style.height = 360
|
||||
new_info_textbox_style.left_margin = 2
|
||||
|
||||
Gui.set_data(new_info_textbox, new_info_key)
|
||||
end
|
||||
@ -558,6 +602,7 @@ local function draw_main_frame(center, player)
|
||||
local ele
|
||||
if char then
|
||||
ele = title_grid.add {type = 'sprite', sprite = 'virtual-signal/signal-red'}
|
||||
ele.style.stretch_image_to_widget_size = true
|
||||
else
|
||||
ele = title_grid.add {type = 'label', caption = ' '}
|
||||
end
|
||||
@ -739,7 +784,7 @@ Gui.on_click(
|
||||
local tab_buttons = data.tab_buttons
|
||||
local old_button = tab_buttons[active_tab]
|
||||
|
||||
old_button.style.font_color = normal_color
|
||||
old_button.style.font_color = unfocus_color
|
||||
button.style.font_color = focus_color
|
||||
|
||||
data.active_tab = index
|
||||
@ -748,7 +793,13 @@ Gui.on_click(
|
||||
Gui.clear(content)
|
||||
|
||||
pages[index].content(content, player)
|
||||
local string = format('%s %s%s awarded for reading a tab on the info screen.', reward_amount, reward_token, reward_plural_indicator)
|
||||
local string =
|
||||
format(
|
||||
'%s %s%s awarded for reading a tab on the info screen.',
|
||||
reward_amount,
|
||||
reward_token,
|
||||
reward_plural_indicator
|
||||
)
|
||||
if rewarded_players[player.index] then
|
||||
reward_player(player, index, string)
|
||||
end
|
||||
|
@ -354,7 +354,7 @@ local function draw_main_frame(left, player)
|
||||
|
||||
local announcements_textbox = frame.add {type = 'text-box', text = announcements.text}
|
||||
announcements_textbox.read_only = true
|
||||
announcements_textbox.word_wrap = true
|
||||
--announcements_textbox.word_wrap = true
|
||||
local announcements_textbox_style = announcements_textbox.style
|
||||
announcements_textbox_style.width = 450
|
||||
announcements_textbox_style.height = 100
|
||||
@ -694,7 +694,7 @@ Gui.on_click(
|
||||
local editing_players_label = top_flow.add {type = 'label'}
|
||||
|
||||
local textbox = frame.add {type = 'text-box', name = edit_announcements_textbox_name, text = announcements.edit_text}
|
||||
textbox.word_wrap = true
|
||||
--textbox.word_wrap = true
|
||||
local textbox_style = textbox.style
|
||||
textbox_style.width = 450
|
||||
textbox_style.height = 100
|
||||
|
Loading…
x
Reference in New Issue
Block a user