Update Aardwolf_Clock.xml

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

@ -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.6"> <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> </plugin>
@ -37,11 +37,8 @@
<script> <script>
<![CDATA[ <![CDATA[
require 'mw_theme_base'
require 'movewindow' require 'movewindow'
background_colour = Theme.PRIMARY_BODY
clock_seasons = { clock_seasons = {
Sun = {138, 3, 19, 1, "Light"}, Sun = {138, 3, 19, 1, "Light"},
Scourge = {168, 9, 18, 2, "Disease"}, Scourge = {168, 9, 18, 2, "Disease"},
@ -183,8 +180,6 @@ require 'mw_theme_base'
local x1 = 1 + round(tcx + 0.1 * r * s) local x1 = 1 + round(tcx + 0.1 * r * s)
local y1 = 1 + round(tcy + 0.1 * r * c) local y1 = 1 + round(tcy + 0.1 * r * c)
--local x1 = cx
--local y1 = cy
local x2 = 1 + round(tcx - 0.9 * r * s) local x2 = 1 + round(tcx - 0.9 * r * s)
local y2 = 1 + round(tcy - 0.9 * r * c) local y2 = 1 + round(tcy - 0.9 * r * c)
@ -209,8 +204,8 @@ require 'mw_theme_base'
WindowText(win, font, seasonEnd, center(seasonEnd), font_height/2, 0, 0, ColourNameToRGB(textColour)) WindowText(win, font, seasonEnd, center(seasonEnd), font_height/2, 0, 0, ColourNameToRGB(textColour))
local sunr = clock_seasons[clock_current.Season][2] .. "am" local sunr = (clock_seasons[clock_current.Season][2] or 1) .. "am"
local suns = (tonumber(clock_seasons[clock_current.Season][3]) - 12) .. "pm" local suns = ((tonumber(clock_seasons[clock_current.Season][3]) - 12) or 12) .. "pm"
WindowText(win, font, sunr, x, font_height*1.5, 0, 0, ColourNameToRGB(textColour)) WindowText(win, font, sunr, x, font_height*1.5, 0, 0, ColourNameToRGB(textColour))
@ -247,7 +242,7 @@ require 'mw_theme_base'
end end
WindowText(win, font, dTime, center(dTime), y, 0, 0, ColourNameToRGB(textColour)) WindowText(win, font, (dTime or ""), center((dTime or "")), y, 0, 0, ColourNameToRGB(textColour))
y = y + font_height y = y + font_height
WindowText(win, font, string.format("[ Day %d of %d ]", footer_text.Day, footer_text.Cycle), center(string.format("[ Day %d of %d ]", footer_text.Day, footer_text.Cycle)), y, 0, 0, ColourNameToRGB(textColour)) WindowText(win, font, string.format("[ Day %d of %d ]", footer_text.Day, footer_text.Cycle), center(string.format("[ Day %d of %d ]", footer_text.Day, footer_text.Cycle)), y, 0, 0, ColourNameToRGB(textColour))
y = y + font_height y = y + font_height
@ -256,7 +251,7 @@ require 'mw_theme_base'
WindowText(win, font, string.format("[ %s ]", footer_text.DamType), center(string.format("[ %s ]", footer_text.DamType)), y, 0, 0, ColourNameToRGB(textColour)) WindowText(win, font, string.format("[ %s ]", footer_text.DamType), center(string.format("[ %s ]", footer_text.DamType)), y, 0, 0, ColourNameToRGB(textColour))
WindowRectOp(win, 4, 1, 1, WindowInfo(win, 3)-1, WindowInfo(win, 4)-1, Theme.PRIMARY_BODY, Theme.SECONDARY_BODY) -- 9, 15 + 0x1000 + 0x4000) WindowRectOp(win, 4, 1, 1, WindowInfo(win, 3)-1, WindowInfo(win, 4)-1, ColourNameToRGB("black"), ColourNameToRGB("black")) -- 9, 15 + 0x1000 + 0x4000)
WindowSetZOrder(win, 50) WindowSetZOrder(win, 50)
WindowShow(win, true) WindowShow(win, true)
end end
@ -426,6 +421,8 @@ require 'mw_theme_base'
PLUGIN_VERSION = GetPluginInfo(GetPluginID(), 19) PLUGIN_VERSION = GetPluginInfo(GetPluginID(), 19)
PLUGIN_NAME = GetPluginInfo(GetPluginID(), 1) PLUGIN_NAME = GetPluginInfo(GetPluginID(), 1)
seasonEnd = ""
clock_numbers = {} clock_numbers = {}
for i = 1,12 do for i = 1,12 do
table.insert(clock_numbers, {text = i, pos = findPos(i)}) table.insert(clock_numbers, {text = i, pos = findPos(i)})
@ -435,7 +432,7 @@ require 'mw_theme_base'
local starty = clock_numbers[12].pos.posy local starty = clock_numbers[12].pos.posy
local window_height = font_height + 5 + endy + starty + (font_height * (#footer_text + 2)) -- font_height * 10 local window_height = font_height + 5 + endy + starty + (font_height * (#footer_text + 2)) -- font_height * 10
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("black"))
movewindow.add_drag_handler (win, 0, 0, 0, window_height) movewindow.add_drag_handler (win, 0, 0, 0, window_height)
end end

Loading…
Cancel
Save