Skip to content

Commit 268a89c

Browse files
committed
Added movewindow stuff
1 parent 8d619d1 commit 268a89c

File tree

1 file changed

+16
-8
lines changed

1 file changed

+16
-8
lines changed

aardwolf/Aardwolf_Inventory_v3.xml

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,7 @@ require "getlines"
220220
require "serialize"
221221
require "pairsbykeys"
222222
require "mw"
223+
require "movewindow"
223224
224225
function capitalize (s)
225226
return string.sub (s, 1, 1):upper () .. string.sub (s, 2):lower ()
@@ -1161,20 +1162,23 @@ function Display_Inventory ()
11611162
end
11621163
11631164
-- recreate the window the correct size
1165+
11641166
check (WindowCreate (win,
1165-
0, 0, -- left, top (auto-positions)
1166-
width, -- width
1167-
height, -- height
1168-
6, -- auto-position: top right
1169-
0, -- flags
1167+
windowinfo.window_left,
1168+
windowinfo.window_top,
1169+
width,
1170+
height,
1171+
windowinfo.window_mode,
1172+
windowinfo.window_flags,
11701173
background_colour) )
1171-
1174+
11721175
max_lines_to_show = math.floor ((height - (font_height * 6)) / font_height)
11731176
11741177
WindowFilter (win, 0, 0, 0, 0, 2, 25) -- monochrome noise in whole window - level 100
11751178
1176-
WindowDeleteAllHotspots (win)
1177-
1179+
WindowDeleteAllHotspots (win)
1180+
movewindow.add_drag_handler (win, 0, 0, 0, font_height, 1)
1181+
11781182
-- title rectangle
11791183
check (WindowRectOp (win, 2, 2, 2, -2, font_height * 3, title_colour))
11801184
@@ -1616,6 +1620,8 @@ function OnPluginInstall ()
16161620
font_id_bold = "inventory_font_bold" -- our internal name
16171621
font_id_large = "inventory_font_large" -- our internal name
16181622
1623+
windowinfo = movewindow.install (win, 6)
1624+
16191625
-- make miniwindow so I can grab the font info
16201626
WindowCreate (win,
16211627
0, 0, 1, 1,
@@ -1693,6 +1699,8 @@ function OnPluginSaveState ()
16931699
16941700
SetVariable ("spells",
16951701
"spells = " .. serialize.save_simple (spells))
1702+
1703+
movewindow.save_state (win)
16961704
16971705
end -- OnPluginSaveState
16981706

0 commit comments

Comments
 (0)