From 6e6845ae6f060bf281cdf8aa01fb8139573c2e22 Mon Sep 17 00:00:00 2001 From: Darthpred Date: Sat, 25 Oct 2014 00:37:53 +0400 Subject: [PATCH] Not using lib for now. It's pointless with the current state of things. So seriously, there's no way to tell your region client side (C) Sortokk --- ElvUI_SLE/core/toolkit.lua | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/ElvUI_SLE/core/toolkit.lua b/ElvUI_SLE/core/toolkit.lua index e8b5647..0850061 100644 --- a/ElvUI_SLE/core/toolkit.lua +++ b/ElvUI_SLE/core/toolkit.lua @@ -164,12 +164,20 @@ end hooksecurefunc(E, "UpdateAll", UpdateAll) function SLE:GetRegion() - local pid = BNGetInfo() - local rid = select(5, BNGetToonInfo(pid)) - local region = select(6, lib:GetRealmInfo(rid)) - SLE.region = region - - if not SLE.region then SLE.region = format("An error happened while processing your realm. Please report error id, realm and the region you are playing to |cff1784d1Shadow & Light|r authors! Error id: %s. Realm: %s", rid, E.myrealm) end + -- local pid = BNGetInfo() + -- local rid = select(5, BNGetToonInfo(pid)) + -- local region = select(6, lib:GetRealmInfo(rid)) + local rid = GetCurrentRegion() + local region = { + [1] = "US", + [2] = "KR", + [3] = "EU", + [4] = "TW", + [5] = "CN", + } + SLE.region = region[rid] + if not SLE.region then SLE.region = format("An error happened. Your region is unknown. Realm: %s. Please report your realm name and the region you are playing in to |cff1784d1Shadow & Light|r authors.", E.myrealm) end + -- if not SLE.region then SLE.region = format("An error happened while processing your realm. Please report error id, realm and the region you are playing to |cff1784d1Shadow & Light|r authors! Error id: %s. Realm: %s", rid, E.myrealm) end if dev == "" then dev = SLE.Dev[SLE.region] end if not dev then SLE:Print(SLE.region) -- 1.7.9.5