+---------------------------------------------------------------------------------------------------
+Version: 2.0.1
+Date: 2024-10-23
+
+ Changed:
+ - Global storage should work again.
+ - Language file update.
+
---------------------------------------------------------------------------------------------------
Version: 2.0.0
Date: 2024-10-21
-
-local cmd = ""
-
function exec_command(player)
if not player.admin then
player.print('You are not an admin. You may not use this mod. :(')
return
end
- local f, err
+ local f, err, cmd
if player.gui.screen.some_luaconsole then
- cmd = player.gui.screen.some_luaconsole.input.text
+ storage.cmd = player.gui.screen.some_luaconsole.input.text
end
+ cmd = storage.cmd or ""
cmd = cmd:gsub('game%.player([^s])', 'game.players['..player.index..']%1')
f, err = loadstring(cmd)
function toggleGui (player)
if player.gui.screen.some_luaconsole then
- cmd = player.gui.screen.some_luaconsole.input.text
+ storage.cmd = player.gui.screen.some_luaconsole.input.text
player.gui.screen.some_luaconsole.destroy()
else
frame = player.gui.screen.add{type = 'frame',
}
input.word_wrap = true
input.style.maximal_height = (player.display_resolution.height/player.display_scale*0.6)
- input.text = cmd
+ input.text = storage.cmd or ""
horizontal_flow = frame.add{type='flow', direction='horizontal'}
horizontal_flow.add{type = 'button',
end
+
script.on_event(defines.events.on_gui_click, function(event)
if event.element.name == 'some_luaconsole_exec' then
exec_command(game.players[event.player_index])
{
"name": "some-luaconsole",
- "version": "2.0.0",
+ "version": "2.0.1",
"title": "Someone's LUA-Console",
"author": "someone1337",
"homepage": "https://git.somenet.org/factorio/some-luaconsole.git",
"description": "Run lua commands without losing achievements. Now remembers input-script. 'game.player' works. By default opens with CONTROL + RIGHTBRACKET. Execute last input-script with CONTROL + ENTER.",
"factorio_version": "2.0",
- "dependencies": ["base>=2.0.0"]
+ "dependencies": [
+ "base>=2.0.0"
+ ]
}