]> git.somenet.org - factorio/some-luaconsole.git/commitdiff
RELEASE 2.0.1 - Global storage should work again + Language file update master
authorSomeone <someone@somenet.org>
Wed, 23 Oct 2024 14:09:12 +0000 (16:09 +0200)
committerSomeone <someone@somenet.org>
Wed, 23 Oct 2024 14:09:12 +0000 (16:09 +0200)
changelog.txt
control.lua
info.json

index a47fe43867b5530b3e80ac77c14901bf05a36888..e0aa2d16e7408cd4b2d47bfb779f0665a95808ae 100644 (file)
@@ -1,3 +1,11 @@
+---------------------------------------------------------------------------------------------------
+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
 ---------------------------------------------------------------------------------------------------
 Version: 2.0.0
 Date: 2024-10-21
index f47ec25de4c3a6783c7912a3aa341358222f8870..c884a25f0a2f9d32cf63ed0600ee578f8b2c76ba 100644 (file)
@@ -1,18 +1,16 @@
-
-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
 
 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
 
     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
 
     end
 
+    cmd = storage.cmd or ""
     cmd = cmd:gsub('game%.player([^s])', 'game.players['..player.index..']%1')
 
     f, err = loadstring(cmd)
     cmd = cmd:gsub('game%.player([^s])', 'game.players['..player.index..']%1')
 
     f, err = loadstring(cmd)
@@ -31,7 +29,7 @@ end
 
 function toggleGui (player)
     if player.gui.screen.some_luaconsole then
 
 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',
         player.gui.screen.some_luaconsole.destroy()
     else
         frame = player.gui.screen.add{type = 'frame',
@@ -47,7 +45,7 @@ function toggleGui (player)
         }
         input.word_wrap = true
         input.style.maximal_height = (player.display_resolution.height/player.display_scale*0.6)
         }
         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',
 
         horizontal_flow = frame.add{type='flow', direction='horizontal'}
         horizontal_flow.add{type = 'button',
@@ -72,6 +70,7 @@ function toggleGui (player)
 end
 
 
 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])
 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])
index bd936517efa970a838234402cbb8370f791bf7cb..72bf03da8cfa2b9e556be50980d7ca51bcc27438 100644 (file)
--- a/info.json
+++ b/info.json
@@ -1,10 +1,12 @@
 {
     "name": "some-luaconsole",
 {
     "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",
     "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"
+    ]
 }
 }