vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 --------------------------------------------------------------------------
2 -- TitanClockOffsetFix.lua
3 --------------------------------------------------------------------------
4 --[[
5 Titan Panel [ClockOffsetFix]
6  
7 author: Vimrasha <vimrasha@fastmail.fm>
8  
9 Fixes the Titan Panel Clock so that its offset is stored per server not per character.
10  
11 ]]--
12  
13 function TitanClockOffsetFix_OnLoad()
14 -- register events
15 this:RegisterEvent("PLAYER_ENTERING_WORLD");
16 this:RegisterEvent("PLAYER_LEAVING_WORLD");
17  
18 end
19  
20 function TitanClockOffsetFix_OnEvent(event)
21 if ( event == "PLAYER_ENTERING_WORLD" ) then
22 if ( not ServerTimeOffsets ) then
23 ServerTimeOffsets = {};
24 end
25  
26 local realmName = GetCVar("realmName");
27  
28 if ( ServerTimeOffsets[realmName] ) then
29 TitanSetVar(TITAN_CLOCK_ID, "OffsetHour", ServerTimeOffsets[realmName]);
30 end
31 end
32  
33 if ( event == "PLAYER_LEAVING_WORLD" ) then
34 local realmName = GetCVar("realmName");
35 ServerTimeOffsets[realmName] = TitanGetVar(TITAN_CLOCK_ID, "OffsetHour");
36 end
37 end
38