/
local origChatEdit_OnTextChanged = ChatEdit_OnTextChanged |
local origChatEdit_OnTabPressed = ChatEdit_OnTabPressed |
local origChatEdit_UpdateHeader = ChatEdit_UpdateHeader |
local origFCF_OpenTemporaryWindow = FCF_OpenTemporaryWindow |
local origSendChatMessage = SendChatMessage |
local origBNSendWhisper = BNSendWhisper |
local _G = _G |
-- Save number of chars to identify delete |
hebChat.lastText = "" |
-- Saved variables |
--------------- |
-- Delay Frame |
--------------- |
if type(hebChatDB[k]) ~= type(v) then |
hebChatDB[k] = v |
end |
end |
end |
-- Register to PLAYER_ENTERING_WORLD |
hebChat:RegisterEvent("PLAYER_ENTERING_WORLD") |
ChatEdit_UpdateHeader = hebChat.ChatEdit_UpdateHeader |
-- Hook FCF_OpenTemporaryWindow |
FCF_OpenTemporaryWindow = hebChat.FCF_OpenTemporaryWindow |
hooksecurefunc("FCF_OpenTemporaryWindow", function(...) |
hebChatDelayFrame:delay(0.1, hebChat.setChatFont) |
end) |
-- Init font Dropdown list |
-- Init font objects list |
hebChat:createFontObjects() |
-- Graphic button enable button |
LibStub("AceConfig-3.0"):RegisterOptionsTable("hebChat", self.options) |
hebChat.configPanel = AceConfigDialog:AddToBlizOptions("hebChat", "hebChat") |
end |
end |
-- PLAYER_ENTERING_WORLD event |
function hebChat.PLAYER_ENTERING_WORLD(...) |
end |
function hebChat:toggleLanguage() |
if (hebChatDB.currentLang == "EN") then |
hebChatDB.currentLang = "HE" |
else |
hebChatDB.currentLang = "EN" |
if hebChatDB.graphicButtonEN then |
if (hebChatDB.currentLang == "EN") then |
hebChatDB.currentLang = "HE" |
else |
hebChatDB.currentLang = "EN" |
end |
hebChatLangButton:SetText(hebChatDB.currentLang) |
end |
hebChatLangButton:SetText(hebChatDB.currentLang) |
end |
----------------------- |
end |
end |
-- Selecting a font from dropdown list |
function hebChat:hebChatDropDownList_OnClick(arg1) |
-- Selecting a chat frame font from fonts list |
function hebChat:hebChatFontList_OnClick(value) |
hebChatDB.currentFont = arg1 |
hebChatDB.currentFont = value |
if (hebChatDB.globalEn) then |
hebChatDB.hebFont = arg1 |
hebChatDB.hebFont = value |
else |
hebChatDB.defaultFont = arg1 |
hebChatDB.defaultFont = value |
end |
hebChat:setChatFont() |
hebChat.lastText = newString; |
end -- function text2Heb (editBox) |
-- Fix editBox wrapping for Hebrew text |
-- Fix chat frame text wrapping for Hebrew text |
function hebChat.hebChatFixWrap(chatFrame, event, msg, author, ...) |
local _, _, _, _, _, _, _, _, _, _, _, isMobile = ... |
local remainingString = "" |
return origChatEdit_UpdateHeader(self, ...) |
end |
-- Hook FCF_OpenTemporaryWindow - set chat font when new chat window is created. |
function hebChat.FCF_OpenTemporaryWindow(...) |
hebChatDelayFrame:delay(0.1, hebChat.setChatFont) |
return origFCF_OpenTemporaryWindow(...) |
end |
-- Hook WIM history viewer |
function hebChat:ShowHistoryViewer(...) |
origWIMShowHistoryViewer(...) |
end, |
}, |
graphicButtonEN = { |
langButtonEN = { |
order = 3, |
type = "toggle", |
name = "Enable language toggle button (recommended)", |
name = "Font settings", |
}, |
fontDropDownList = { |
fontList = { |
order = 7, |
type = "select", |
name = "Font:", |
desc = "Set a font for the chat frame.", |
get = function() return hebChatDB.currentFont end, |
set = function(info, value) |
hebChat:hebChatDropDownList_OnClick(value) |
hebChat:hebChatFontList_OnClick(value) |
end, |
values = hebChat.fontsName, |
style = "radio", |
## Interface: 50001 |
## Author: Animor |
## Title: hebChat |
## Version: 2.1 |
## Version: 2.11 |
## Notes: Support Hebrew characters in chat |
## X-Category: Chat/Communication |
## SavedVariablesPerCharacter: hebChatDB |