Skip to content

Commit 6bd29ef

Browse files
committed
update for lönn 0.8.0
1 parent 172fe75 commit 6bd29ef

File tree

9 files changed

+19
-35
lines changed

9 files changed

+19
-35
lines changed

Loenn/consts/loenn_version.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
return require("utils.version_parser")("0.7.7")
1+
return require("utils.version_parser")("0.8.0")

Loenn/libraries/modules.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
local modules = {
22
{ name = "coords_view" },
3-
{ name = "texture_browser" },
3+
-- { name = "texture_browser" },
44
{ name = "keyboard_pan" },
55
{ name = "room_mover" },
66
{ name = "snap_to_grid" },

Loenn/libraries/settings.lua

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@ local config = require("utils.config")
44
local logging = require("logging")
55

66
local currentVersion = mods.requireFromPlugin("consts.version")
7-
local alp_utils = mods.requireFromPlugin("libraries.utils")
87

98
---
109

Loenn/libraries/utils.lua

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
local utils = require("utils")
22

3-
local hotkeyStruct = require("structs.hotkey")
4-
local standardHotkeys = require("standard_hotkeys")
5-
local hotkeyHandler = require("hotkey_handler")
6-
73
---
84

95
local alp_utils = {}
@@ -75,11 +71,4 @@ end
7571

7672
---
7773

78-
function alp_utils.addHotkey(activator, callback)
79-
local hotkey = hotkeyStruct.createHotkey(activator, callback)
80-
hotkeyHandler.registerHotkey(hotkey, standardHotkeys)
81-
end
82-
83-
---
84-
8574
return alp_utils

Loenn/modules/coords_view/device.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,7 @@ local loadedState = require("loaded_state")
66
local ui = require("ui")
77
local uie = require("ui.elements")
88

9-
local hotkeys = require("standard_hotkeys")
10-
local hotkeyStruct = require("structs.hotkey")
9+
local hotkeyHandler = require("hotkey_handler")
1110

1211
local settings = mods.requireFromPlugin("modules.coords_view.settings")
1312

@@ -103,7 +102,7 @@ end
103102

104103
---
105104

106-
table.insert(hotkeys, hotkeyStruct.createHotkey(settings.hotkey, function() device.coordsWindow.toggle() end))
105+
hotkeyHandler.addHotkey("global", settings.hotkey, function() device.coordsWindow.toggle() end)
107106

108107
---
109108

Loenn/modules/coords_view/window.lua

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ function coordsWindow.open()
6464
window.titlebar.style.padding = 4
6565

6666
windowPersister.trackWindow(windowPersisterName, window)
67+
widgetUtils.preventOutOfBoundsMovement(window)
6768

6869
coordsWindow.group.parent:addChild(window)
6970
coordsWindow.group:reflow()

Loenn/modules/keyboard_pan/device.lua

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ local mods = require("mods")
33
local viewportHandler = require("viewport_handler")
44
local ui = require("ui.main")
55

6-
local hotkeys = require("standard_hotkeys")
6+
local hotkeyHandler = require("hotkey_handler")
77
local hotkeyStruct = require("structs.hotkey")
88

99
local settings = mods.requireFromPlugin("modules.keyboard_pan.settings")
@@ -43,15 +43,10 @@ end
4343

4444
local function callback() end
4545

46-
keys.left = hotkeyStruct.createHotkey(settings.hotkey_left, callback)
47-
keys.right = hotkeyStruct.createHotkey(settings.hotkey_right, callback)
48-
keys.up = hotkeyStruct.createHotkey(settings.hotkey_up, callback)
49-
keys.down = hotkeyStruct.createHotkey(settings.hotkey_down, callback)
50-
51-
table.insert(hotkeys, keys.left)
52-
table.insert(hotkeys, keys.right)
53-
table.insert(hotkeys, keys.up)
54-
table.insert(hotkeys, keys.down)
46+
keys.left = hotkeyHandler.addHotkey("global", settings.hotkey_left, callback)
47+
keys.right = hotkeyHandler.addHotkey("global", settings.hotkey_right, callback)
48+
keys.up = hotkeyHandler.addHotkey("global", settings.hotkey_up, callback)
49+
keys.down = hotkeyHandler.addHotkey("global", settings.hotkey_down, callback)
5550

5651
---
5752

Loenn/modules/snap_to_grid/device.lua

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ local tools = require("tools")
1212
local toolUtils = require("tool_utils")
1313
local selectionItemUtils = require("selection_item_utils")
1414

15-
local alp_utils = mods.requireFromPlugin("libraries.utils")
15+
local hotkeyHandler = require("hotkey_handler")
16+
1617
local selections = mods.requireFromPlugin("libraries.selection")
1718

1819
---
@@ -292,12 +293,12 @@ end
292293

293294
---
294295

295-
local hotkey_left = alp_utils.addHotkey(settings.hotkey_left, snapLeft)
296-
local hotkey_right = alp_utils.addHotkey(settings.hotkey_right, snapRight)
297-
local hotkey_up = alp_utils.addHotkey(settings.hotkey_up, snapUp)
298-
local hotkey_down = alp_utils.addHotkey(settings.hotkey_down, snapDown)
299-
local hotkey_neutral = alp_utils.addHotkey(settings.hotkey_neutral, snapNeutral)
300-
local hotkey_grid = alp_utils.addHotkey(settings.hotkey_grid, toggle_grid)
296+
local hotkey_left = hotkeyHandler.addHotkey("global", settings.hotkey_left, snapLeft)
297+
local hotkey_right = hotkeyHandler.addHotkey("global", settings.hotkey_right, snapRight)
298+
local hotkey_up = hotkeyHandler.addHotkey("global", settings.hotkey_up, snapUp)
299+
local hotkey_down = hotkeyHandler.addHotkey("global", settings.hotkey_down, snapDown)
300+
local hotkey_neutral = hotkeyHandler.addHotkey("global", settings.hotkey_neutral, snapNeutral)
301+
local hotkey_grid = hotkeyHandler.addHotkey("global", settings.hotkey_grid, toggle_grid)
301302

302303
---
303304

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,6 @@ It also supports the following experimental add-ons, which you should **only put
1919

2020
These features can be configured; see [the wiki](https://github.com/microlith57/AnotherLoennPlugin/wiki) for information.
2121

22-
Note that this will intentionally stop working for newer Lönn (major) versions than it is updated for (currently v0.7.7, so it won't work for v0.8.x), to make sure it doesn't break things.
22+
Note that this will intentionally stop working for newer Lönn (major) versions than it is updated for (currently v0.8.x, so it won't work for v0.9.x), to make sure it doesn't break things.
2323

2424
Some code in this repository is derived from [Lönn](https://github.com/CelestialCartographers/Loenn) under the MIT License.

0 commit comments

Comments
 (0)