Update AardClock2.0_Beta

Made changes, clock saves position.
pull/2/head
AardCrowley 6 years ago
parent 0b10a2ccb1
commit 31a87ea920

@ -6,32 +6,14 @@
<!-- Plugin "Aardwolf_Clock" generated by Plugin Wizard --> <!-- Plugin "Aardwolf_Clock" generated by Plugin Wizard -->
<muclient> <muclient>
<plugin <plugin name="Aardwolf_Clock" author="Crowley" 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="1.0">
name="Aardwolf_Clock"
author="Crowley"
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="1.0"
>
</plugin> </plugin>
<!-- Triggers --> <!-- Triggers -->
<triggers> <triggers>
<trigger <trigger enabled="n" match="^\s+\*\s+It is ((?:\d+|Noon|Midnight))((?:p|a))?m? on the (\d+)(?:rd|th|nd|st) day of the Season of (?:the )?(\w+).*$" script="getTime" regexp="y" sequence="100" omit_from_output="n" name="GetTime">
enabled="n"
match="^\s+\*\s+It is ((?:\d+|Noon|Midnight))((?:p|a))?m? on the (\d+)(?:rd|th|nd|st) day of the Season of (?:the )?(\w+).*$"
script="getTime"
regexp="y"
sequence="100"
omit_from_output="n"
name="GetTime"
>
</trigger> </trigger>
</triggers> </triggers>
@ -48,7 +30,7 @@
<script> <script>
<![CDATA[ <![CDATA[
require "mw_theme_base" require 'mw_theme_base'
require 'movewindow' require 'movewindow'
background_colour = Theme.PRIMARY_BODY background_colour = Theme.PRIMARY_BODY
@ -76,7 +58,29 @@ require "mw_theme_base"
Magi = {138, 6, 19, 20, "Magic"}, Magi = {138, 6, 19, 20, "Magic"},
} }
clock_season_order = {"Sun", "Scourge", "River", "Song", "Energy", "Nature", "Snake", "Sword", "Freeze", "Thought", "Darkness", "Corrosion", "Dagger", "Storm", "Piety", "Suffering", "Burning", "Tornado", "Stone", "Magi"} clock_season_order = {
"Sun",
"Scourge",
"River",
"Song",
"Energy",
"Nature",
"Snake",
"Sword",
"Freeze",
"Thought",
"Darkness",
"Corrosion",
"Dagger",
"Storm",
"Piety",
"Suffering",
"Burning",
"Tornado",
"Stone",
"Magi"
}
clock_current = {Season = "Sun", day = 1, order = 1} clock_current = {Season = "Sun", day = 1, order = 1}
local win = "AardClock_" .. GetPluginID() local win = "AardClock_" .. GetPluginID()
@ -87,8 +91,24 @@ require "mw_theme_base"
checked_time = false checked_time = false
local footer_text = {} local footer_text = {}
local font_families = utils.getfontfamilies()
if font_families["Monoid"] then
font_name = "Monoid"
font_size = 8
elseif font_families["Dina"] then
font_name = "Dina"
font_size = 8
elseif font_families["Lucida Sans Console"] then
font_name = "Lucida Sans Console"
font_size = 10
else
font_name = "Consolas"
font_size = 10
end
WindowCreate(win, 0, 0, 0, 0, 1, 0, 0) WindowCreate(win, 0, 0, 0, 0, 1, 0, 0)
WindowFont(win, font, "Monoid", 10, true) WindowFont(win, font, font_name, font_size, true)
local font_height = WindowFontInfo(win, font, 1) local font_height = WindowFontInfo(win, font, 1)
local font_width = WindowTextWidth(win, font, " ", 1) local font_width = WindowTextWidth(win, font, " ", 1)
@ -191,7 +211,6 @@ require "mw_theme_base"
WindowCreate(win, windowinfo.window_left, windowinfo.window_top, window_width, window_height, windowinfo.window_mode, windowinfo.window_flags + miniwin.create_keep_hotspots, ColourNameToRGB(Theme.SECONDARY_BODY)) WindowCreate(win, windowinfo.window_left, windowinfo.window_top, window_width, window_height, windowinfo.window_mode, windowinfo.window_flags + miniwin.create_keep_hotspots, ColourNameToRGB(Theme.SECONDARY_BODY))
WindowLoadImage(win, "background", GetInfo(66) .. "/worlds/plugins/images/" .. bgImage .. ".png")
WindowDrawImage(win, "background", 0, 0, WindowInfo(win, 3), WindowInfo(win, 4), miniwin.image_stretch) WindowDrawImage(win, "background", 0, 0, WindowInfo(win, 3), WindowInfo(win, 4), miniwin.image_stretch)
local x = 5 local x = 5
@ -313,6 +332,8 @@ require "mw_theme_base"
sunsetColour = textColour sunsetColour = textColour
bgImage = "darkstone" bgImage = "darkstone"
end end
WindowLoadImage(win, "background", GetInfo(66) .. "/worlds/plugins/images/" .. bgImage .. ".png")
end end
function getTime(name, line, args) function getTime(name, line, args)
@ -411,7 +432,6 @@ require "mw_theme_base"
canRedraw = true canRedraw = true
print("Mouseup!") print("Mouseup!")
end end
]]> ]]>
</script> </script>

Loading…
Cancel
Save