mirror of
https://github.com/Refactorio/RedMew.git
synced 2025-01-26 03:52:00 +02:00
added print to settime
implemented /clock updated info.lua removed rail_grid from generating
This commit is contained in:
parent
26e4b599a2
commit
8946486e6a
@ -71,6 +71,7 @@ function set_time(d, month, h, m)
|
||||
current_day = d
|
||||
current_h = h
|
||||
current_m = m
|
||||
game.print(game.player.name .. " set the clock to " .. format_time(game.tick) .. ". Type /clock to check the time.")
|
||||
end
|
||||
|
||||
Event.register(defines.events.on_console_command, player_send_command)
|
||||
|
@ -173,6 +173,10 @@ function on_set_time(cmd)
|
||||
end
|
||||
set_time(params_numeric[1], params_numeric[2], params_numeric[3], params_numeric[4])
|
||||
end
|
||||
|
||||
local function clock()
|
||||
game.player.print(format_time(game.tick))
|
||||
end
|
||||
commands.add_command("kill", "Will kill you.", kill)
|
||||
commands.add_command("detrain", "<player> - Kicks the player off a train.", detrain)
|
||||
commands.add_command("tpplayer", "<player> - Teleports you to the player.", teleport_player)
|
||||
@ -180,3 +184,4 @@ commands.add_command("invoke", "<player> - Teleports the player to you.", invoke
|
||||
commands.add_command("tppos", "Teleports you to a selected entity.", teleport_location)
|
||||
commands.add_command("walkabout", '<player> <"close", "far", "very far", number> - Send someone on a walk.', walkabout)
|
||||
commands.add_command("settime", '<day> <month> <hour> <minute> - Sets the clock', on_set_time)
|
||||
commands.add_command("clock", 'Look at the clock', clock)
|
||||
|
47
info.lua
47
info.lua
@ -1,8 +1,8 @@
|
||||
local function create_info_button(event)
|
||||
local player = game.players[event.player_index]
|
||||
|
||||
|
||||
if player.gui.top.info_button == nil then
|
||||
local button = player.gui.top.add({ type = "sprite-button", name = "info_button", sprite = "item/raw-fish" })
|
||||
local button = player.gui.top.add({ type = "sprite-button", name = "info_button", sprite = "item/raw-fish" })
|
||||
button.style.minimal_height = 38
|
||||
button.style.minimal_width = 38
|
||||
button.style.top_padding = 2
|
||||
@ -18,23 +18,16 @@ local function info_show(player)
|
||||
|
||||
local infotext = [===[
|
||||
Hi stranger, I'm a fish..
|
||||
|
||||
And this is what you ought to know:
|
||||
|
||||
- Please be nice and don't grief.
|
||||
|
||||
- Fix personal confrontations diplomatically.
|
||||
|
||||
- Please be nice and don't grief. Or else.. ;)
|
||||
- Don't fight with other players for silly things.
|
||||
- No political, racist, or misogynistic content.
|
||||
|
||||
- If you suspect you desync while connecting,
|
||||
close and relaunch Factorio ASAP. Very bad for us.
|
||||
|
||||
- Join our community on https://discord.gg/gKyDpQE
|
||||
for questions and feedback. Also on /r/redmew (reddit)
|
||||
|
||||
- You can contribute to server costs and upgrades
|
||||
with bitcoin: 13qh5uJh3UDUiWKyQaybkpxC1gfLVDB1ww
|
||||
- If you suspect you desync, restart the game.
|
||||
- You can join our community on discord.me/redmew
|
||||
- View the chatlog on: log.mewmew.net
|
||||
- Contribute to server costs and upgrades with
|
||||
bitcoin: 13qh5uJh3UDUiWKyQaybkpxC1gfLVDB1ww
|
||||
]===]
|
||||
|
||||
player.gui.left.direction = "horizontal"
|
||||
@ -48,7 +41,7 @@ with bitcoin: 13qh5uJh3UDUiWKyQaybkpxC1gfLVDB1ww
|
||||
headline_label.style.font = "default-listbox"
|
||||
headline_label.style.font_color = { r=0.98, g=0.66, b=0.22}
|
||||
|
||||
|
||||
|
||||
local text_box = info_table.add { type = "text-box", text = infotext, name = "text_box" }
|
||||
text_box.read_only = true
|
||||
text_box.selectable = true
|
||||
@ -57,21 +50,21 @@ with bitcoin: 13qh5uJh3UDUiWKyQaybkpxC1gfLVDB1ww
|
||||
text_box.style.top_padding = 5
|
||||
text_box.style.left_padding = 5
|
||||
text_box.style.bottom_padding = 5
|
||||
|
||||
|
||||
local info_table_2 = info_table.add { type = "table", colspan = 2, name = "info_table" }
|
||||
info_table_2.add { type = "label", caption = " " }
|
||||
local close_button = info_table_2.add { type = "button", caption = "CLOSE", name = "info_close_button" }
|
||||
close_button.style.font = "default-listbox"
|
||||
local close_button = info_table_2.add { type = "button", caption = "CLOSE", name = "info_close_button" }
|
||||
close_button.style.font = "default-listbox"
|
||||
end
|
||||
|
||||
|
||||
local function on_gui_click(event)
|
||||
if not (event and event.element and event.element.valid) then return end
|
||||
|
||||
|
||||
local player = game.players[event.element.player_index]
|
||||
local name = event.element.name
|
||||
local frame = player.gui.left["info_panel"]
|
||||
|
||||
local name = event.element.name
|
||||
local frame = player.gui.left["info_panel"]
|
||||
|
||||
if (name == "info_button") and (frame == nil) then
|
||||
info_show(player)
|
||||
else
|
||||
@ -79,13 +72,13 @@ local function on_gui_click(event)
|
||||
frame.destroy()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if (name == "info_close_button") then
|
||||
frame.destroy()
|
||||
end
|
||||
|
||||
|
||||
end
|
||||
|
||||
|
||||
Event.register(defines.events.on_gui_click, on_gui_click)
|
||||
Event.register(defines.events.on_player_joined_game, create_info_button)
|
||||
Event.register(defines.events.on_player_joined_game, create_info_button)
|
||||
|
@ -11,7 +11,7 @@ notes:
|
||||
--]]
|
||||
|
||||
require "perlin_noise"
|
||||
require "rail_grid"
|
||||
--require "rail_grid"
|
||||
perlin:load( )
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user