Quantcast

Error Frame mover and stuff

Darthpred [01-14-15 - 00:53]
Error Frame mover and stuff
Filename
ElvUI_SLE/core/modules.lua
ElvUI_SLE/defaults/profile.lua
ElvUI_SLE/locales/russian.lua
ElvUI_SLE/modules/errorframe.lua
ElvUI_SLE/modules/load_modules.xml
ElvUI_SLE/options/errorframe_c.lua
ElvUI_SLE/options/load_options.xml
diff --git a/ElvUI_SLE/core/modules.lua b/ElvUI_SLE/core/modules.lua
index 3bac6cd..77e60d7 100644
--- a/ElvUI_SLE/core/modules.lua
+++ b/ElvUI_SLE/core/modules.lua
@@ -25,6 +25,7 @@ local modules = {
 	['SLE_InstDif'] = {'AceHook-3.0', 'AceEvent-3.0'},
 	['SLE_ScreenSaver'] = { 'AceHook-3.0', 'AceEvent-3.0' },
 	['SLE_Garrison'] = { 'AceEvent-3.0' },
+	['SLE_ErrorFrame'] = { },
 	['SLE'] = {'AceHook-3.0', 'AceEvent-3.0'},
 }

diff --git a/ElvUI_SLE/defaults/profile.lua b/ElvUI_SLE/defaults/profile.lua
index 63ba57e..cc9da37 100644
--- a/ElvUI_SLE/defaults/profile.lua
+++ b/ElvUI_SLE/defaults/profile.lua
@@ -460,6 +460,11 @@ P['sle'] = {
 		['autoTrade'] = false,
 		['showOrderButton'] = true,
 	},
+
+	['errorframe'] = {
+		['height'] = 60,
+		['width'] = 512,
+	},
 }

 P.chat.editboxhistory = 5
diff --git a/ElvUI_SLE/locales/russian.lua b/ElvUI_SLE/locales/russian.lua
index 86013dd..50d3df2 100644
--- a/ElvUI_SLE/locales/russian.lua
+++ b/ElvUI_SLE/locales/russian.lua
@@ -42,6 +42,7 @@ L['Oh lord, you have got ElvUI Enhanced and Shadow & Light both enabled at the s
 L['You have got Loot Confirm and Shadow & Light both enabled at the same time. Select an addon to disable.'] = "Одновременно активны Loot Confirm и Shadow & Light. Выберите что из них отключить."
 L["Enabling mouse over will make ElvUI's raid utility show on mouse over instead of always showing."] = "Отображать кнопку управления рейдом только при наведении мыши."
 L['Adjust the position of the threat bar to any of the datatext panels in ElvUI & S&L.'] = "Позволяет поместить полосу угрозы на любой панели инфо-текстов."
+L["This option have been moved by Shadow & Light. Click to access it's new place."] = "Shadow & Light переместил эту опцию. Кликните для перехода к ее новому расположению."

 --Chat--
 L["Reset Chat History"] = "Сбросить историю чата"
@@ -496,6 +497,11 @@ L["Show Max Order Button"] = "Кнопка максимума"
 L["Show the button to queue maximum number of work orders in building's UI."] = "Отображать кнопку для выполнения максимума заказов в интерфейсе зданий."
 L["Max"] = "Макс."

+--Error Frame--
+L["Error Frame"] = "Фрейм ошибок"
+L["Set the width of Error Frame. Too narrow frame may cause messages to be split in several lines"] = "Устанавливает ширину фрейма ошибок. Если фрейм окажется слишком узким, текст будет разделен на несколько строк."
+L["Set the height of Error Frame. Higher frame can show more lines at once."] = "Устанавливает высоту фрейма ошибок. Чем выше фрейм, тем больше строк может быть показано одновременно."
+
 --Credits--
 L["Submodules and Coding:"] = "Субмодули и помощь с кодом:"
 L["Other Support:"] = "Прочая поддержка:"
diff --git a/ElvUI_SLE/modules/errorframe.lua b/ElvUI_SLE/modules/errorframe.lua
new file mode 100644
index 0000000..d4cfe73
--- /dev/null
+++ b/ElvUI_SLE/modules/errorframe.lua
@@ -0,0 +1,11 @@
+local E, L, V, P, G = unpack(ElvUI);
+local F = E:GetModule('SLE_ErrorFrame');
+
+function F:SetSize()
+	UIErrorsFrame:SetSize(E.db.sle.errorframe.width, E.db.sle.errorframe.height) --512 x 60
+end
+
+function F:Initialize()
+	F:SetSize()
+	E:CreateMover(UIErrorsFrame, "UIErrorsFrameMover", L["Error Frame"], nil, nil, nil, "ALL,S&L,S&L MISC")
+end
\ No newline at end of file
diff --git a/ElvUI_SLE/modules/load_modules.xml b/ElvUI_SLE/modules/load_modules.xml
index 19cec56..b168fbb 100644
--- a/ElvUI_SLE/modules/load_modules.xml
+++ b/ElvUI_SLE/modules/load_modules.xml
@@ -26,4 +26,5 @@
 	<Script file='uibuttons.lua'/>
 	<Script file='unitframes.lua'/>
 	<Script file='vehicle.lua'/>
+	<Script file='errorframe.lua'/>
 </Ui>
diff --git a/ElvUI_SLE/options/errorframe_c.lua b/ElvUI_SLE/options/errorframe_c.lua
new file mode 100644
index 0000000..79199ae
--- /dev/null
+++ b/ElvUI_SLE/options/errorframe_c.lua
@@ -0,0 +1,59 @@
+local E, L, V, P, G = unpack(ElvUI);
+local F = E:GetModule('SLE_ErrorFrame');
+local ACD = LibStub("AceConfigDialog-3.0")
+
+local function configTable()
+	E.Options.args.sle.args.options.args.general.args.errorframe = {
+		type = "group",
+		name = L["Error Frame"],
+		order = 75,
+		args = {
+			header = {
+				order = 1,
+				type = "header",
+				name = L["Error Frame"],
+			},
+			hideErrorFrame = {
+				order = 2,
+				name = L["Hide Error Text"],
+				desc = L["Hides the red error text at the top of the screen while in combat."],
+				type = "toggle",
+				get = function(info) return E.db.general[ info[#info] ] end,
+				set = function(info, value) E.db.general[ info[#info] ] = value end,
+			},
+			space = {
+				type = "description",
+				order = 3,
+				name = '',
+			},
+			width = {
+				order = 4,
+				name = L["Width"],
+				desc = L["Set the width of Error Frame. Too narrow frame may cause messages to be split in several lines"],
+				type = "range",
+				min = 100, max = 1000, step = 1,
+				get = function(info) return E.db.sle.errorframe.width end,
+				set = function(info, value) E.db.sle.errorframe.width = value; F:SetSize() end
+			},
+			height = {
+				order = 5,
+				name = L["Height"],
+				desc = L["Set the height of Error Frame. Higher frame can show more lines at once."],
+				type = "range",
+				min = 30, max = 300, step = 15,
+				get = function(info) return E.db.sle.errorframe.height end,
+				set = function(info, value) E.db.sle.errorframe.height = value; F:SetSize() end
+			},
+		},
+	}
+
+	E.Options.args.general.args.general.args.hideErrorFrame = {
+		order = 13,
+		name = L["Hide Error Text"],
+		desc = L["This option have been moved by Shadow & Light. Click to access it's new place."],
+		type = "execute",
+		func = function() ACD:SelectGroup("ElvUI", "sle", "options", "general", "errorframe") end,
+	}
+end
+
+table.insert(E.SLEConfigs, configTable)
\ No newline at end of file
diff --git a/ElvUI_SLE/options/load_options.xml b/ElvUI_SLE/options/load_options.xml
index 773b6cb..7cadc81 100644
--- a/ElvUI_SLE/options/load_options.xml
+++ b/ElvUI_SLE/options/load_options.xml
@@ -25,5 +25,6 @@
 	<Script file='uibuttons_c.lua'/>
 	<Script file='unitframes_c.lua'/>
 	<Script file='vehicle_c.lua'/>
+	<Script file='errorframe_c.lua'/>
 	<Script file='dev_c.lua'/>
 </Ui>
\ No newline at end of file