Update Aardwolf_Clock.xml

pull/4/head
AardCrowley 6 years ago
parent 1c9e863388
commit c027897c21

@ -6,7 +6,7 @@
<!-- Plugin "Aardwolf_Clock" generated by Plugin Wizard --> <!-- Plugin "Aardwolf_Clock" generated by Plugin Wizard -->
<muclient> <muclient>
<plugin name="Aardwolf_Clock" author="Crowley, with help from Fiendish" id="28a36788fa20aa062e760ee2" language="Lua" purpose="Displays a realtime clock based on Aardwolf game time" save_state="y" date_written="2018-05-15 11:43:22" requires="4.90" version="2.7"> <plugin name="Aardwolf_Clock" author="Crowley, with help from Fiendish" id="28a36788fa20aa062e760ee2" language="Lua" purpose="Displays a realtime clock based on Aardwolf game time" save_state="y" date_written="2018-05-15 11:43:22" requires="4.90" version="2.8">
</plugin> </plugin>
@ -90,7 +90,7 @@
local win = "AardClock_" .. GetPluginID() local win = "AardClock_" .. GetPluginID()
local font = "f" local font = "f"
windowinfo = movewindow.install(win, 7, miniwin.create_absolute_location, true, nil, {mouseup = MoveMouseUp, mousedown = MoveMouseDown}) windowinfo = movewindow.install(win, 7, miniwin.create_absolute_location, true, nil)
checked_time = false checked_time = false
local footer_text = {} local footer_text = {}
@ -119,7 +119,6 @@
window_width = (20 * font_width) + 11 window_width = (20 * font_width) + 11
local cx = math.floor((window_width-5)/2) + 3 local cx = math.floor((window_width-5)/2) + 3
local cy = cx + font_height local cy = cx + font_height
canRedraw = true
bgDay = 'khaki' bgDay = 'khaki'
bgNight = 'navy' bgNight = 'navy'
@ -366,17 +365,15 @@
end end
function onTimer() function onTimer()
if canRedraw then if checked_time then
if checked_time then last_tick = last_tick or os.clock()
last_tick = last_tick or os.clock() local s = os.clock() - last_tick
local s = os.clock() - last_tick updateTime()
updateTime() drawFace()
drawFace() drawHand(math.min(30, s), 60, 30)
drawHand(math.min(30, s), 60, 30) hourHandTime = hourTime + s/30
hourHandTime = hourTime + s/30 drawHand(hourHandTime, 45, 12)
drawHand(hourHandTime, 45, 12) Redraw()
Redraw()
end
end end
end end
@ -407,14 +404,8 @@
movewindow.save_state(win) movewindow.save_state(win)
end end
function MoveMouseDown() function OnPluginClose()
canRedraw = false OnPluginDisable()
print("Mousedown!")
end
function MoveMouseUp()
canRedraw = true
print("Mouseup!")
end end
function OnPluginInstall() function OnPluginInstall()

Loading…
Cancel
Save