Repository navigation
Expand file tree
/
Copy pathCryolysisMessage.lua
More file actions
189 lines (170 loc) · 7.28 KB
/
Copy pathCryolysisMessage.lua
File metadata and controls
189 lines (170 loc) · 7.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
--[[
Cryolysis
Copyright (C) 2006 Cryolysis: Reborn Team
This file is part of Cryolysis.
Cryolysis is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
Cryolysis is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Cryolysis; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Cryolysis: Reborn Team (Alphabetically sorted)
- Eternally777
- Lom Enfroy
- Thomas Hart II
--]]
------------------------------------------------------------------------------------------------------
-- Cryolysis
--
-- Copyright (c) 2006 Cryolysis: Reborn Team
-- Copyright (c) 2006 Kaeldra (darklyte@gmail.com)
-- Copyright (c) 2005-2006 Lom Enfroy
--
-- Skins: Eliah, Ner'zhul FR
--
-- First changes for the BC Live patch, with all our thanks : Ayumi of Stormscale
--
------------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------------
-- POSTING FUNCTIONS (CONSOLE, CHAT, MESSAGE SYSTEM)
------------------------------------------------------------------------------------------------------
function Cryolysis_Msg(msg, type)
if (msg and type) then
-- If the message type is "USER" then the message is displayed
if (type == "USER") then
-- Colorize the message
msg = Cryolysis_MsgAddColor(msg);
local Intro = "|C2D47E7EECr|C2B7EECEEyo|C2AA2EFEEly|C28C6F4EEsis|CFFFFFFFF: ";
if CryolysisConfig.ChatType then
-- ...... On the first chat window
ChatFrame1:AddMessage(Intro..msg, 0.2, 0.9, 0.95, 1.0, UIERRORS_HOLD_TIME);
else
-- ...... or in the middle of the screen
UIErrorsFrame:AddMessage(Intro..msg, 0.2, 0.9, 0.95, 1.0, UIERRORS_HOLD_TIME);
end
-- If the type of the message is “WORLD”, the message will be sent in raid, failing this in group, and failing this in local chat
elseif (type == "WORLD") then
if (GetNumRaidMembers() > 0) then
SendChatMessage(msg, "RAID");
elseif (GetNumPartyMembers() > 0) then
SendChatMessage(msg, "PARTY");
else
SendChatMessage(msg, "SAY");
end
elseif (type == "GROUP") then
if (GetNumRaidMembers() > 0) then
SendChatMessage(msg, "RAID");
elseif (GetNumPartyMembers() > 0) then
SendChatMessage(msg, "PARTY");
end
-- If the message type is "PARTY", then display to group
elseif (type == "PARTY") then
SendChatMessage(msg, "PARTY");
-- If the message type is "PARTY", then display to raid
elseif (type == "RAID") then
SendChatMessage(msg, "RAID");
elseif (type == "SAY") then
-- Otherwise send to local chat
SendChatMessage(msg, "SAY");
end
end
end
------------------------------------------------------------------------------------------------------
-- ... COLORIZATION!
------------------------------------------------------------------------------------------------------
-- Define Colors easily
function Cryolysis_MsgAddColor(msg)
msg = string.gsub(msg, "<white>", "|CFFFFFFFF");
msg = string.gsub(msg, "<lightBlue>", "|CFF99CCFF");
msg = string.gsub(msg, "<brightGreen>", "|CFF00FF00");
msg = string.gsub(msg, "<lightGreen2>", "|CFF66FF66");
msg = string.gsub(msg, "<lightGreen1>", "|CFF99FF66");
msg = string.gsub(msg, "<yellowGreen>", "|CFFCCFF66");
msg = string.gsub(msg, "<lightYellow>", "|CFFFFFF66");
msg = string.gsub(msg, "<darkYellow>", "|CFFFFCC00");
msg = string.gsub(msg, "<lightOrange>", "|CFFFFCC66");
msg = string.gsub(msg, "<dirtyOrange>", "|CFFFF9933");
msg = string.gsub(msg, "<darkOrange>", "|CFFFF6600");
msg = string.gsub(msg, "<redOrange>", "|CFFFF3300");
msg = string.gsub(msg, "<red>", "|CFFFF0000");
msg = string.gsub(msg, "<lightRed>", "|CFFFF5555");
msg = string.gsub(msg, "<lightPurple1>", "|CFFFFC4FF");
msg = string.gsub(msg, "<lightPurple2>", "|CFFFF99FF");
msg = string.gsub(msg, "<purple>", "|CFFFF50FF");
msg = string.gsub(msg, "<darkPurple1>", "|CFFFF00FF");
msg = string.gsub(msg, "<darkPurple2>", "|CFFB700B7");
msg = string.gsub(msg, "<close>", "|r");
msg = string.gsub(msg, "<darkBlue>", "|C2D59E9FF");
return msg;
end
--[[
function Cryolysis_MsgAddColor(msg)
msg = string.gsub(msg, "<white>", "|CFFFFFFFF");
msg = string.gsub(msg, "<lightBlue>", "|CFF99CCFF");
msg = string.gsub(msg, "<brightGreen>", "|C2D47E7FF");
msg = string.gsub(msg, "<lightGreen2>", "|C2D59E9FF");
msg = string.gsub(msg, "<lightGreen1>", "|C2C6BEBFF");
msg = string.gsub(msg, "<yellowGreen>", "|C2B7EECFF");
msg = string.gsub(msg, "<lightYellow>", "|C2A90EEFF");
msg = string.gsub(msg, "<darkYellow>", "|C2AA2EFFF");
msg = string.gsub(msg, "<lightOrange>", "|CFFFFCC66");
msg = string.gsub(msg, "<dirtyOrange>", "|C29B5F2FF");
msg = string.gsub(msg, "<darkOrange>", "|C28C6F4FF");
msg = string.gsub(msg, "<redOrange>", "|C28D8F5FF");
msg = string.gsub(msg, "<red>", "|C26FBF8FF");
msg = string.gsub(msg, "<lightRed>", "|CFFFF5555");
msg = string.gsub(msg, "<lightPurple1>", "|CFFFFC4FF");
msg = string.gsub(msg, "<lightPurple2>", "|CFFFF99FF");
msg = string.gsub(msg, "<purple>", "|CFFFF50FF");
msg = string.gsub(msg, "<darkPurple1>", "|CFFFF00FF");
msg = string.gsub(msg, "<darkPurple2>", "|CFFB700B7");
msg = string.gsub(msg, "<close>", "|r");
return msg;
end
]]--
-- Insert in the timers of the codes of colouring according to the percentage of remaining time
function CryolysisTimerColor(percent)
local color = "<brightGreen>"; -- |C2D47E7FF
if (percent < 10) then
color = "<red>"; -- |C26FBF8FF
elseif (percent < 20) then
color = "<redOrange>"; -- |C28D8F5FF
elseif (percent < 30) then
color = "<darkOrange>"; -- |C28C6F4FF 350
elseif (percent < 40) then
color = "<dirtyOrange>"; -- |C29B5F2FF 300
elseif (percent < 50) then
color = "<darkYellow>"; -- |C2AA2EFFF
elseif (percent < 60) then
color = "<lightYellow>"; -- |C2A90EEFF
elseif (percent < 70) then
color = "<yellowGreen>"; -- |C2B7EECFF
elseif (percent < 80) then
color = "<lightGreen1>"; -- |C2C6BEBFF
elseif (percent < 90) then
color = "<lightGreen2>"; -- |C2D59E9FF
end
return color;
end
------------------------------------------------------------------------------------------------------
-- USER-FRIENDLY VARIABLES WHEN DISPLAYING CHAT
------------------------------------------------------------------------------------------------------
function Cryolysis_MsgReplace(msg, target, portal, mount)
msg = string.gsub(msg, "<player>", UnitName("player"));
if target then
msg = string.gsub(msg, "<target>", target);
end
if portal then
msg = string.gsub(msg, "<portal>", portal);
end
if mount then
msg = string.gsub(msg, "<mount>", mount);
end
return msg;
end
Cryolysis_UpdateRevisions("CryolysisMessage.lua", "$Rev$")