From ede65f84143c9728838794b73471f0f9b707c957 Mon Sep 17 00:00:00 2001 From: Someone Date: Mon, 10 Apr 2023 05:30:14 +0200 Subject: [PATCH] RELEASE 1.1.2 - Make console movable and autocenter on open. --- changelog.txt | 9 ++++++++- control.lua | 17 +++++++++-------- info.json | 2 +- 3 files changed, 18 insertions(+), 10 deletions(-) diff --git a/changelog.txt b/changelog.txt index 8fb3bf6..8c7b031 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,6 +1,13 @@ +--------------------------------------------------------------------------------------------------- +Version: 1.1.2 +Date: 2023-04-10 + + Changed: + - Make console movable and autocenter on open. + --------------------------------------------------------------------------------------------------- Version: 1.1.1 -Date: 2022-01-17 +Date: 2023-01-17 Changed: - Version-Bump. No functional changes. (I am still alive :) diff --git a/control.lua b/control.lua index b5ee73f..0c9398e 100644 --- a/control.lua +++ b/control.lua @@ -6,8 +6,8 @@ function exec_command(player) local f, err, cmd - if player.gui.left.some_luaconsole then - global.cmd = player.gui.left.some_luaconsole.input.text + if player.gui.screen.some_luaconsole then + global.cmd = player.gui.screen.some_luaconsole.input.text end cmd = global.cmd or "" @@ -28,11 +28,11 @@ end function toggleGui (player) - if player.gui.left.some_luaconsole then - global.cmd = player.gui.left.some_luaconsole.input.text - player.gui.left.some_luaconsole.destroy() + if player.gui.screen.some_luaconsole then + global.cmd = player.gui.screen.some_luaconsole.input.text + player.gui.screen.some_luaconsole.destroy() else - frame = player.gui.left.add{type = 'frame', + frame = player.gui.screen.add{type = 'frame', name = 'some_luaconsole', direction = 'vertical', caption = {'some_luaconsole.title'} @@ -61,9 +61,10 @@ function toggleGui (player) } if not player.admin then - player.gui.left.some_luaconsole.input.text = 'You are not an admin. You may not use this mod. :(' - player.gui.left.some_luaconsole.input.enabled = false + player.gui.screen.some_luaconsole.input.text = 'You are not an admin. You may not use this mod. :(' + player.gui.screen.some_luaconsole.input.enabled = false end + frame.force_auto_center() end end diff --git a/info.json b/info.json index d95a160..430ed39 100644 --- a/info.json +++ b/info.json @@ -1,6 +1,6 @@ { "name": "some-luaconsole", - "version": "1.1.1", + "version": "1.1.2", "title": "Someone's LUA-Console", "author": "someone1337", "homepage": "https://git.somenet.org/factorio/some-luaconsole.git", -- 2.43.0