diff --git a/LICENSE b/LICENSE index 95acf2c..e7f1ee9 100644 --- a/LICENSE +++ b/LICENSE @@ -1 +1 @@ -Copyright 2014 Arne Rantzen +Copyright 2015 Arne Rantzen diff --git a/data/gui.lua b/data/gui.lua index 6a0adb6..69a556e 100644 --- a/data/gui.lua +++ b/data/gui.lua @@ -212,7 +212,8 @@ local function AddLook() getFunc = function() return cl.st.GetLook("style") end, setFunc = function(value) cl.st.SetLook("style", value) end }, - --[[ [4] = { + --[[ + [4] = { type = "dropdown", name = loc.nBg, tooltip = loc.tBg, @@ -232,6 +233,53 @@ local function AddLook() getFunc = function() return cl.st.GetLook("size") end, setFunc = function(value) cl.st.SetLook("size", value) end }, + --[[ + [5] = { + type = "checkbox", + name = loc.nSepLR, + tooltip = loc.tSepLR, + getFunc = function() return cl.st.SepLR() end, + setFunc = function(value) cl.st.SetSepLR(value) end, + disabled = function() return not cl.st.IsActive() end, + }, + [6] = { + type = "colorpicker", + name = loc.nRColPick, + tooltip = loc.tRColPick, + getFunc = function() return cl.st.GetRColor() end, + setFunc = function(r, g, b, a) cl.st.SetRColor(r, g, b, a) end, + disabled = function() return not cl.st.SepLR() end, + }, + [7] = { + type = "dropdown", + name = loc.nRFont, + tooltip = loc.tRFont, + choices = LMP:List('font'), + getFunc = function() return cl.st.GetRLook("font") end, + setFunc = function(value) cl.st.SetRLook("font", value) end, + disabled = function() return not cl.st.SepLR() end, + }, + [8] = { + type = "dropdown", + name = loc.nRStyle, + tooltip = loc.tRStyle, + choices = ui.styles, + getFunc = function() return cl.st.GetRLook("style") end, + setFunc = function(value) cl.st.SetRLook("style", value) end, + disabled = function() return not cl.st.SepLR() end, + }, + [9] = { + type = "slider", + name = loc.nRSize, + tooltip = loc.tRSize, + min = 10, + max = 70, + step = 2, + getFunc = function() return cl.st.GetRLook("size") end, + setFunc = function(value) cl.st.SetRLook("size", value) end, + disabled = function() return not cl.st.SepLR() end, + }, + --]] [5] = { type = "description", title = loc.descEditLookY, @@ -247,7 +295,7 @@ local function AddLook() title = loc.descEditLookE, text = loc.descEditLookETxt, }, - [9] = { + [8] = { type = "editbox", name = loc.nELore, tooltip = loc.tELore, @@ -255,7 +303,7 @@ local function AddLook() setFunc = function(value) cl.st.SetFormat("lore", value) end, isMultiline = true, }, - [8] = { + [9] = { type = "editbox", name = loc.nEReal, tooltip = loc.tEReal, diff --git a/data/settings.lua b/data/settings.lua index c5fb558..a5842a4 100644 --- a/data/settings.lua +++ b/data/settings.lua @@ -24,6 +24,7 @@ local defaults = { show_rt = false, show_bg = true, show_hz = false, + sep_lr = true, time = { start = 1398044126, -- exact unix time at the calculated game time start in s daytime = 20955, -- length of one day in s (default 5.75h right now) @@ -31,7 +32,7 @@ local defaults = { name = "noon", }, moon = { - start = 1407553200, -- Unix time of the start of the full moon phase in s + start = 1425169441, --Phinix sync ... Unix time of the start of the full moon phase in s - old 1407553200 full = 10, -- length of a full moon phase in real time in s -> TRY IN NIGHTS FOR DAYLENGTH OFFSET new = 5, -- length of a new moon phase in real time in s way = 85, -- length of the way between full moon and new moon in s @@ -42,20 +43,33 @@ local defaults = { y = 70, }, look = { - color = { - r = 1, - g = 1, - b = 1, - a = 0.75, + lore = { + color = { + r = 1, + g = 1, + b = 1, + a = 0.75, + }, + font = "ESO Book Font", + style = "thin_shadow", + size = 24, + }, + real = { + color = { + r = 1, + g = 1, + b = 1, + a = 0.75, + }, + font = "ESO Book Font", + style = "thin_shadow", + size = 24, }, - font = "ESO Book Font", - style = "thin_shadow", - size = 24, - bg = "Solid", format = { lore = "_DDD, _D. _MMM _YY _hh:_mm:_ss", real = "_DDD, _D. _MMM _YY _hh:_mm:_ss", }, + bg = "Solid", } } @@ -136,6 +150,11 @@ function st.SetShowHz(hz) cl.vi.UpdateClock() end +function st.SetSepLR(lr) + cl.settings.sep_lr = lr + cl.vi.UpdateClock() +end + ---------------------------------- ----------- @@ -156,8 +175,11 @@ end ----------- -- view ----------- + +-- lore date + function st.SetColor(r, g, b, a) - local c = cl.settings.look.color + local c = cl.settings.look.lore.color c.r = r c.g = g c.b = b @@ -166,7 +188,23 @@ function st.SetColor(r, g, b, a) end function st.SetLook(name, value) - cl.settings.look[name] = value + cl.settings.look.lore[name] = value + cl.vi.UpdateClock() +end + +-- Real date + +function st.SetRColor(r, g, b, a) + local c = cl.settings.look.real.color + c.r = r + c.g = g + c.b = b + c.a = a + cl.vi.UpdateClock() +end + +function st.SetRLook(name, value) + cl.settings.look.real[name] = value cl.vi.UpdateClock() end @@ -253,6 +291,10 @@ function st.ShowHz() return cl.settings.show_hz end +function st.SepLR() + return cl.settings.sep_lr +end + ----------- -- moon ----------- @@ -282,13 +324,26 @@ function st.GetColorHex() return RGBToHex(st.GetColor()) end +-- lore + function st.GetColor() - local c = cl.settings.look.color + local c = cl.settings.look.lore.color return c.r, c.g, c.b, c.a end function st.GetLook(name) - return cl.settings.look[name] + return cl.settings.look.lore[name] +end + +-- real + +function st.GetRColor() + local c = cl.settings.look.real.color + return c.r, c.g, c.b, c.a +end + +function st.GetRLook(name) + return cl.settings.look.real[name] end function st.GetFormat(name) @@ -367,7 +422,7 @@ end ------------------ SLASH_COMMANDS["/cl"] = function(com) com = com:lower() - local lang = st.GetLanguage() + -- local lang = st.GetLanguage() local loc = cl.ln.com if com == "show" then d(cl.vi.DBToString()) diff --git a/local/de.lua b/local/de.lua index 5680119..24b7ed8 100644 --- a/local/de.lua +++ b/local/de.lua @@ -116,6 +116,17 @@ cl.ln = { tStyle = "Verändere die Design der Clock.", nSize = "Größe", tSize = "Verändere die Größe der Clock.", + --real + nSepLR = "Different Looks", + tSepLR = "Choose if you want your real date have an other look than your lore date.", + nRColPick = "Color", + tRColPick = "Change the color of the Clock.", + nRFont = "Font", + tRFont = "Change the font of the Clock.", + nRStyle = "Style", + tRStyle = "Change the style of the Clock.", + nRSize = "Size", + tRSize = "Change the size of the Clock.", nBg = "Hintergrund", tBg = "Wählen Sie den Hintergrund aus.", descEditLookY = "Verändere das Format der Clock: Benutze '_' bevor einer Variablen!\n" diff --git a/local/en.lua b/local/en.lua index 696d05d..7cc4631 100644 --- a/local/en.lua +++ b/local/en.lua @@ -111,6 +111,17 @@ cl.ln = { tStyle = "Change the style of the Clock.", nSize = "Size", tSize = "Change the size of the Clock.", + --real + nSepLR = "Different Looks", + tSepLR = "Choose if you want your real date have an other look than your lore date.", + nRColPick = "Color", + tRColPick = "Change the color of the Clock.", + nRFont = "Font", + tRFont = "Change the font of the Clock.", + nRStyle = "Style", + tRStyle = "Change the style of the Clock.", + nRSize = "Size", + tRSize = "Change the size of the Clock.", nBg = "Background", tBg = "Choose a background for the Clock.", sHor = "Horizontal", diff --git a/local/fr.lua b/local/fr.lua index f09b44e..2adef85 100644 --- a/local/fr.lua +++ b/local/fr.lua @@ -111,6 +111,17 @@ cl.ln = { tStyle = "Change the style of the Clock.", nSize = "Size", tSize = "Change the size of the Clock.", + --real + nSepLR = "Different Looks", + tSepLR = "Choose if you want your real date have an other look than your lore date.", + nRColPick = "Color", + tRColPick = "Change the color of the Clock.", + nRFont = "Font", + tRFont = "Change the font of the Clock.", + nRStyle = "Style", + tRStyle = "Change the style of the Clock.", + nRSize = "Size", + tRSize = "Change the size of the Clock.", nBg = "Background", tBg = "Choose a background for the Clock.", sHor = "Horizontal",