diff --git a/AE_1-4-rc2_20180529.png b/AE_1-4-rc2_20180529.png new file mode 100644 index 0000000..6885467 Binary files /dev/null and b/AE_1-4-rc2_20180529.png differ diff --git a/AwesomeEvents/AwesomeEvents.lua b/AwesomeEvents/AwesomeEvents.lua index ca975e4..09bf3bd 100644 --- a/AwesomeEvents/AwesomeEvents.lua +++ b/AwesomeEvents/AwesomeEvents.lua @@ -3,7 +3,7 @@ Author: @Ze_Mi <zemi@unive.de> Filename: AwesomeEvents.lua - Last Modified: 28.05.18 17:53 + Last Modified: 29.05.18 21:30 Copyright (c) 2018 by Martin Unkel License : CreativeCommons CC BY-NC-SA 4.0 Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) @@ -15,7 +15,7 @@ Awesome_Events = { name = 'AwesomeEvents', panelName = 'AwesomeEventsOptions', title = 'Awesome Events', - version = '1.4-RC2', + version = '1.4-RC3', defaults = { isDefault = true, @@ -219,18 +219,22 @@ end -- Awesome_Events:ImportConfigFromCharacter --- --- create a getFcn function callback for LAM panelOptions -local function __CreateSettingsGetter(mod_id,key) +local function __CreateSettingsGetter(mod_id,key,transformer) if(libAM.modules[mod_id] == nil) then return end local mod = libAM.modules[mod_id] if(key=='spacingPosition')then return function() return Awesome_Events.GetSpacingPositionString(Awesome_Events.vars[mod_id][key]) end else - return function() return Awesome_Events.vars[mod_id][key] end + if(transformer ~= nil)then + return function() return transformer(Awesome_Events.vars[mod_id][key]) end + else + return function() return Awesome_Events.vars[mod_id][key] end + end end end -- __CreateSettingsGetter --- create a setFcn function callback for LAM panelOptions -local function __CreateSettingsSetter(mod_id,key) +local function __CreateSettingsSetter(mod_id,key,transformer) if(libAM.modules[mod_id] == nil) then return end local mod = libAM.modules[mod_id] if(key=='enabled')then @@ -263,6 +267,9 @@ local function __CreateSettingsSetter(mod_id,key) end end return function(value) + if(transformer ~= nil)then + value = transformer(value) + end Awesome_Events.vars[mod_id][key] = value libAM.d('main','Set['..mod_id..']: '..key,value) mod:Set(key,value) @@ -441,8 +448,16 @@ function Awesome_Events:LoadModulesConfiguration() for key,option in mod:option_pairs() do if(option.type~=nil and option.name ~= nil and option.tooltip ~= nil and option.default ~= nil)then self.defaults[mod_id][key] = option.default - option.getFunc = __CreateSettingsGetter(mod_id,key) - option.setFunc = __CreateSettingsSetter(mod_id,key) + if(option.getTransformer ~= nil)then + option.getFunc = __CreateSettingsGetter(mod_id,key,option.getTransformer) + else + option.getFunc = __CreateSettingsGetter(mod_id,key) + end + if(option.setTransformer ~= nil)then + option.setFunc = __CreateSettingsSetter(mod_id,key,option.setTransformer) + else + option.setFunc = __CreateSettingsSetter(mod_id,key) + end option.disabled = __CreateSettingsDisabler(mod_id,'enabled') table.insert( panelOptions, option ) else diff --git a/AwesomeEvents/AwesomeEvents.txt b/AwesomeEvents/AwesomeEvents.txt index 380b7ea..9bafdf1 100644 --- a/AwesomeEvents/AwesomeEvents.txt +++ b/AwesomeEvents/AwesomeEvents.txt @@ -1,7 +1,7 @@ ## APIVersion: 100023 -## Version: 1.4-RC2 +## Version: 1.4-RC3 ## Title: |cFFFFB0Awesome Events|r -## Description: This addon adds many customizable notifications and information to your UI. (Version: 1.4-RC2) +## Description: This addon adds many customizable notifications and information to your UI. (Version: 1.4-RC3) ## Author: Ze_Mi ## OptionalDependsOn: LibStub, LibAddonMenu-2.0, LibAwesomeModule-1.0 ## SavedVariables: AwesomeEvents diff --git a/AwesomeEvents/Language/de.lua b/AwesomeEvents/Language/de.lua index 1ad75b1..64e640c 100644 --- a/AwesomeEvents/Language/de.lua +++ b/AwesomeEvents/Language/de.lua @@ -3,7 +3,7 @@ Author: @Ze_Mi <zemi@unive.de> Filename: de.lua - Last Modified: 28.05.18 17:25 + Last Modified: 29.05.18 21:30 Copyright (c) 2018 by Martin Unkel License : CreativeCommons CC BY-NC-SA 4.0 Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) @@ -79,14 +79,18 @@ SafeAddString(SI_AWEMOD_BUFFFOOD_HIDENOCOMBAT_HINT, "Wenn du keinen Versorgungs- --module-clock SafeAddString(SI_AWEMOD_CLOCK, "Uhrzeit und Datum", 1) SafeAddString(SI_AWEMOD_CLOCK_HINT, "Zeige die aktuelle Uhrzeit und das Datum auf dem Bildschirm an.", 1) -SafeAddString(SI_AWEMOD_CLOCK_DATEFORMAT_SHORT, "day.month", 1) -SafeAddString(SI_AWEMOD_CLOCK_DATEFORMAT_LONG, "day.month.year", 1) +SafeAddString(SI_AWEMOD_CLOCK_DATEFORMAT, "Datumsformat", 1) +SafeAddString(SI_AWEMOD_CLOCK_DATEFORMAT_HINT, "Wähle die gewünschte Darstellung für die Datumsformatierung aus.", 1) +SafeAddString(SI_AWEMOD_CLOCK_DATEFORMAT_DAY, "tag", 1) +SafeAddString(SI_AWEMOD_CLOCK_DATEFORMAT_MONTH, "monat", 1) +SafeAddString(SI_AWEMOD_CLOCK_DATEFORMAT_YEAR, "jahr", 1) +SafeAddString(SI_AWEMOD_CLOCK_DATEFORMAT_DEFAULT, "day.month.year", 1) SafeAddString(SI_AWEMOD_CLOCK_STYLE, "Darstellung", 1) SafeAddString(SI_AWEMOD_CLOCK_STYLE_HINT, "Wähle deine bevorzugte Darstellung.", 1) SafeAddString(SI_AWEMOD_CLOCK_STYLE_TIME, "Nur Uhrzeit", 1) SafeAddString(SI_AWEMOD_CLOCK_STYLE_DATETIME_SHORT, "Datum & Uhrzeit (Einzeilig)", 1) SafeAddString(SI_AWEMOD_CLOCK_STYLE_DATETIME_LONG, "Datum & Uhrzeit (Zweizeilig)", 1) -SafeAddString(SI_AWEMOD_CLOCK_FORMAT, "Format 24-Stunden", 1) +SafeAddString(SI_AWEMOD_CLOCK_FORMAT, "Uhrzeit 24-Stunden-Format", 1) SafeAddString(SI_AWEMOD_CLOCK_FORMAT_HINT, "Schalte auf das 24-Stunden Format statt 12-Stunden (+AM/PM) Format um.", 1) --module-crafting diff --git a/AwesomeEvents/Language/ru.lua b/AwesomeEvents/Language/ru.lua index d0de82c..6c88717 100644 --- a/AwesomeEvents/Language/ru.lua +++ b/AwesomeEvents/Language/ru.lua @@ -3,9 +3,9 @@ Author: Memoraike Filename: ru.lua - Last Modified: 05.07.17 18:24 + Last Modified: 29.05.18 21:30 - Copyright (c) 2017 by Memoraike + Copyright (c) 2018 by Martin Unkel and Memoraike License : CreativeCommons CC BY-NC-SA 4.0 Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) Please read the README file for further information. @@ -83,13 +83,17 @@ SafeAddString(SI_AWEMOD_BUFFFOOD_HIDENOCOMBAT_HINT, "Если у Вас не а --module-clock SafeAddString(SI_AWEMOD_CLOCK, "Время и дата", 1) SafeAddString(SI_AWEMOD_CLOCK_HINT, "Отображать текущее системное время.", 1) -SafeAddString(SI_AWEMOD_CLOCK_DATEFORMAT_SHORT, "day.month", 1) -- do not translate the words, just change the order or the seperator chars between -SafeAddString(SI_AWEMOD_CLOCK_DATEFORMAT_LONG, "day.month.year", 1) -- do not translate the words, just change the order or the seperator chars between +--SafeAddString(SI_AWEMOD_CLOCK_DATEFORMAT, "Date format", 1) +--SafeAddString(SI_AWEMOD_CLOCK_DATEFORMAT_HINT, "Choose your prefered date format.", 1) +SafeAddString(SI_AWEMOD_CLOCK_DATEFORMAT_DAY, "день", 1) +SafeAddString(SI_AWEMOD_CLOCK_DATEFORMAT_MONTH, "месяц", 1) +SafeAddString(SI_AWEMOD_CLOCK_DATEFORMAT_YEAR, "год", 1) +SafeAddString(SI_AWEMOD_CLOCK_DATEFORMAT_DEFAULT, "day.month.year", 1) -- do not translate the words, just change the order or the seperator chars between SafeAddString(SI_AWEMOD_CLOCK_STYLE, "Appearance", 1) -SafeAddString(SI_AWEMOD_CLOCK_STYLE_HINT, "Choose your preferred appearance.", 1) -SafeAddString(SI_AWEMOD_CLOCK_STYLE_TIME, "Time only", 1) -SafeAddString(SI_AWEMOD_CLOCK_STYLE_DATETIME_SHORT, "Date & Time (1-line)", 1) -SafeAddString(SI_AWEMOD_CLOCK_STYLE_DATETIME_LONG, "Date & Time (2-lines)", 1) +--SafeAddString(SI_AWEMOD_CLOCK_STYLE_HINT, "Choose your preferred appearance.", 1) +--SafeAddString(SI_AWEMOD_CLOCK_STYLE_TIME, "Time only", 1) +--SafeAddString(SI_AWEMOD_CLOCK_STYLE_DATETIME_SHORT, "Date & Time (1-line)", 1) +--SafeAddString(SI_AWEMOD_CLOCK_STYLE_DATETIME_LONG, "Date & Time (2-lines)", 1) SafeAddString(SI_AWEMOD_CLOCK_FORMAT, "24 формат времени", 1) SafeAddString(SI_AWEMOD_CLOCK_FORMAT_HINT, "Отображать время в 24 формате или в 12 формате.", 1) diff --git a/AwesomeEvents/Language/strings.lua b/AwesomeEvents/Language/strings.lua index c7f8efe..590f5d9 100644 --- a/AwesomeEvents/Language/strings.lua +++ b/AwesomeEvents/Language/strings.lua @@ -3,7 +3,7 @@ Author: @Ze_Mi <zemi@unive.de> Filename: strings.lua - Last Modified: 28.05.18 17:25 + Last Modified: 29.05.18 20:30 Copyright (c) 2018 by Martin Unkel License : CreativeCommons CC BY-NC-SA 4.0 Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) @@ -79,8 +79,12 @@ local strings = { --module-clock SI_AWEMOD_CLOCK="Time and Date", SI_AWEMOD_CLOCK_HINT="Get a clock on your screen, optionally with the current date.", - SI_AWEMOD_CLOCK_DATEFORMAT_SHORT="month/day", - SI_AWEMOD_CLOCK_DATEFORMAT_LONG="month/day/year", + SI_AWEMOD_CLOCK_DATEFORMAT="Date format", + SI_AWEMOD_CLOCK_DATEFORMAT_HINT="Choose your prefered date format.", + SI_AWEMOD_CLOCK_DATEFORMAT_DAY="day", + SI_AWEMOD_CLOCK_DATEFORMAT_MONTH="month", + SI_AWEMOD_CLOCK_DATEFORMAT_YEAR="year", + SI_AWEMOD_CLOCK_DATEFORMAT_DEFAULT="month/day/year", SI_AWEMOD_CLOCK_STYLE="Appearance", SI_AWEMOD_CLOCK_STYLE_HINT="Choose your preferred appearance.", SI_AWEMOD_CLOCK_STYLE_TIME="Time only", diff --git a/AwesomeEvents/Modules/Clock.lua b/AwesomeEvents/Modules/Clock.lua index 41c6cf6..fb2acf2 100644 --- a/AwesomeEvents/Modules/Clock.lua +++ b/AwesomeEvents/Modules/Clock.lua @@ -3,7 +3,7 @@ Author: @Ze_Mi <zemi@unive.de> Filename: Clock.lua - Last Modified: 28.05.18 17:45 + Last Modified: 29.05.18 21:30 Copyright (c) 2018 by Martin Unkel License : CreativeCommons CC BY-NC-SA 4.0 Attribution-NonCommercial-ShareAlike 4.0 International (CC BY-NC-SA 4.0) @@ -25,22 +25,70 @@ MOD.label = {} MOD.label[LABEL_CLOCK] = {} MOD.label[LABEL_DATE] = {} +local function GetDateString(dateString) + local date = GetDate() + local year,month,day = string.sub(date,1,4), string.sub(date,5,6), string.sub(date,7,8) + dateString = string.gsub(dateString,"year",year,1) + dateString = string.gsub(dateString,"day",day,1) + dateString = string.gsub(dateString,"month",month,1) + return dateString +end -- GetDateString + +local function GetLocalDateString(dateString) + dateString = string.gsub(dateString,"year",GetString(SI_AWEMOD_CLOCK_DATEFORMAT_YEAR),1) + dateString = string.gsub(dateString,"day",GetString(SI_AWEMOD_CLOCK_DATEFORMAT_DAY),1) + dateString = string.gsub(dateString,"month",GetString(SI_AWEMOD_CLOCK_DATEFORMAT_MONTH),1) + return dateString +end +local function GetGlobalDateString(dateString) + dateString = string.gsub(dateString,GetString(SI_AWEMOD_CLOCK_DATEFORMAT_YEAR),"year",1) + dateString = string.gsub(dateString,GetString(SI_AWEMOD_CLOCK_DATEFORMAT_DAY),"day",1) + dateString = string.gsub(dateString,GetString(SI_AWEMOD_CLOCK_DATEFORMAT_MONTH),"month",1) + return dateString +end + +local CONFIG_DATE_FORMAT,DATE_FORMAT = {},{ + "day/month/year", + "day/month", + "month/day/year", + "month/day", + "day.month.year", + "day.month", + "month.day.year", + "month.day", +} + +for k,v in pairs(DATE_FORMAT) do + table.insert(CONFIG_DATE_FORMAT,GetLocalDateString(v) .. ' (' .. GetDateString(v) .. ')') +end + + -- USER SETTINGS MOD.options = { - hoursFormat24 = { - type = "checkbox", - name = GetString(SI_AWEMOD_CLOCK_FORMAT), - tooltip = GetString(SI_AWEMOD_CLOCK_FORMAT_HINT), - default = true, - order = 1, - }, style = { type = 'dropdown', name = GetString(SI_AWEMOD_CLOCK_STYLE), tooltip = GetString(SI_AWEMOD_CLOCK_STYLE_HINT), choices = {GetString(SI_AWEMOD_CLOCK_STYLE_TIME),GetString(SI_AWEMOD_CLOCK_STYLE_DATETIME_SHORT),GetString(SI_AWEMOD_CLOCK_STYLE_DATETIME_LONG)}, default = GetString(SI_AWEMOD_CLOCK_STYLE_TIME), + order = 1, + }, + hoursFormat24 = { + type = "checkbox", + name = GetString(SI_AWEMOD_CLOCK_FORMAT), + tooltip = GetString(SI_AWEMOD_CLOCK_FORMAT_HINT), + default = true, + order = 2, + }, + dateFormat = { + type = "dropdown", + name = GetString(SI_AWEMOD_CLOCK_DATEFORMAT), + tooltip = GetString(SI_AWEMOD_CLOCK_DATEFORMAT_HINT), + choices = CONFIG_DATE_FORMAT, + default = GetLocalDateString(GetString(SI_AWEMOD_CLOCK_DATEFORMAT_DEFAULT)) .. ' (' .. GetDateString(GetString(SI_AWEMOD_CLOCK_DATEFORMAT_DEFAULT)) .. ')', + getTransformer = function(value) return GetLocalDateString(value) .. ' (' .. GetDateString(value) .. ')' end, + setTransformer = function(value) return GetGlobalDateString(string.match(value, "(.*)%s")) end, order = 2, }, } @@ -50,6 +98,7 @@ MOD.fontSize = 5 function MOD:Enable(options) self:d('Enable (in debug-mode)') + self.dataUpdated = true end -- MOD:Enable @@ -85,24 +134,14 @@ end -- MOD:OnTimer -- LABEL HANDLER -local function GetDateString(short) - local date = GetDate() - local year,month,day = string.sub(date,1,4), string.sub(date,5,6), string.sub(date,7,8) - local dateString = short and GetString(SI_AWEMOD_CLOCK_DATEFORMAT_SHORT) or GetString(SI_AWEMOD_CLOCK_DATEFORMAT_LONG) - dateString = string.gsub(dateString,"year",year,1) - dateString = string.gsub(dateString,"day",day,1) - dateString = string.gsub(dateString,"month",month,1) - return dateString -end -- GetDateString - function MOD:Update(options) self:d('Update',options) local labelText = '' if(options.style == GetString(SI_AWEMOD_CLOCK_STYLE_DATETIME_LONG)) then - self.label[LABEL_DATE]:SetText(GetDateString(false)) + self.label[LABEL_DATE]:SetText(GetDateString(options.dateFormat)) elseif(options.style == GetString(SI_AWEMOD_CLOCK_STYLE_DATETIME_SHORT)) then - labelText = GetDateString(true) .. ' - ' + labelText = GetDateString(options.dateFormat) .. ' - ' end local timeFormat = TIME_FORMAT_PRECISION_TWELVE_HOUR diff --git a/AwesomeEventsMod/AwesomeEventsMod.txt b/AwesomeEventsMod/AwesomeEventsMod.txt index ef6efa8..335438f 100644 --- a/AwesomeEventsMod/AwesomeEventsMod.txt +++ b/AwesomeEventsMod/AwesomeEventsMod.txt @@ -1,7 +1,7 @@ ## APIVersion: 100023 -## Version: 1.4-RC2 +## Version: 1.4-RC3 ## Title: |cFFFFB0Awesome Module - Balancing|r -## Description: This AddOn is a balancing module to show you how to add new modules and notifications to the AwesomeEvents AddOn. (Version: 1.4-RC2) +## Description: This AddOn is a balancing module to show you how to add new modules and notifications to the AwesomeEvents AddOn. (Version: 1.4-RC3) ## Author: Ze_Mi ## OptionalDependsOn: LibStub, LibAwesomeModule-1.0 ## diff --git a/esoui_changelog.txt b/esoui_changelog.txt index 364fdeb..70d6c56 100644 --- a/esoui_changelog.txt +++ b/esoui_changelog.txt @@ -3,6 +3,11 @@ [COLOR="Green"][SIZE="5"][B]Changelog (DE)[/B][/SIZE][/COLOR] +[B]1.4-RC3 (29.05.2018):[/B] +[LIST] +[*]Neu: Datumsformat kann aus einer Liste ausgewählt werden +[/LIST] + [B]1.4-RC2 (28.05.2018):[/B] [LIST] [*]Neu: Analysehinweis für Schmuckhandwerk hinzugefügt @@ -114,6 +119,11 @@ [COLOR="Green"][SIZE="5"][B]Changelog (EN)[/B][/SIZE][/COLOR] +[B]1.4-RC3 (29.05.2018):[/B] +[LIST] +[*]Neu: Dateformat can be chosen form a list +[/LIST] + [B]1.4-RC2 (28.05.2018):[/B] [LIST] [*]New: Show jewelry crafting slots and timers