vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | ------------------------------------------------------------------------------------------------------ |
2 | -- Necrosis LdC |
||
3 | -- |
||
4 | -- Créateur initial (US) : Infernal (http://www.revolvus.com/games/interface/necrosis/) |
||
5 | -- Implémentation de base (FR) : Tilienna Thorondor |
||
6 | -- Reprise du projet : Lomig & Nyx des Larmes de Cenarius, Kael'Thas |
||
7 | -- |
||
8 | -- Skins et voix Françaises : Eliah, Ner'zhul |
||
9 | -- Version Allemande par Arne Meier et Halisstra, Lothar |
||
10 | -- Remerciements spéciaux pour Sadyre (JoL) |
||
11 | -- Version 30.04.2005-1 |
||
12 | ------------------------------------------------------------------------------------------------------ |
||
13 | |||
14 | |||
15 | |||
16 | ------------------------------------------------------------------------------------------------------ |
||
17 | -- FONCTIONS D'AFFICHAGE (CONSOLE, CHAT, MESSAGE SYSTEME) |
||
18 | ------------------------------------------------------------------------------------------------------ |
||
19 | |||
20 | function Necrosis_Msg(msg, type) |
||
21 | if (msg and type) then |
||
22 | -- Si le type du message est "USER", le message s'affiche sur l'écran... |
||
23 | if (type == "USER") then |
||
24 | -- On colorise astucieusement notre message :D |
||
25 | msg = Necrosis_MsgAddColor(msg); |
||
26 | local Intro = "|CFFFF00FFNe|CFFFF50FFcr|CFFFF99FFos|CFFFFC4FFis|CFFFFFFFF: "; |
||
27 | if NecrosisConfig.ChatType then |
||
28 | -- ...... sur la première fenêtre de chat |
||
29 | ChatFrame1:AddMessage(Intro..msg, 1.0, 0.7, 1.0, 1.0, UIERRORS_HOLD_TIME); |
||
30 | else |
||
31 | -- ...... ou au milieu de l'écran |
||
32 | UIErrorsFrame:AddMessage(Intro..msg, 1.0, 0.7, 1.0, 1.0, UIERRORS_HOLD_TIME); |
||
33 | end |
||
34 | -- Si le type du message est "WORLD", le message sera envoyé en raid, à défaut en groupe, et à défaut en chat local |
||
35 | elseif (type == "WORLD") then |
||
36 | if (GetNumRaidMembers() > 0) then |
||
37 | SendChatMessage(msg, "RAID"); |
||
38 | elseif (GetNumPartyMembers() > 0) then |
||
39 | SendChatMessage(msg, "PARTY"); |
||
40 | else |
||
41 | SendChatMessage(msg, "SAY"); |
||
42 | end |
||
43 | -- Si le type du message est "PARTY", le message sera envoyé en groupe |
||
44 | elseif (type == "PARTY") then |
||
45 | SendChatMessage(msg, "PARTY"); |
||
46 | -- Si le type du message est "RAID", le message sera envoyé en raid |
||
47 | elseif (type == "RAID") then |
||
48 | SendChatMessage(msg, "RAID"); |
||
49 | elseif (type == "SAY") then |
||
50 | -- Si le type du message est "SAY", le message sera envoyé en chat local |
||
51 | SendChatMessage(msg, "SAY"); |
||
52 | end |
||
53 | end |
||
54 | end |
||
55 | |||
56 | |||
57 | ------------------------------------------------------------------------------------------------------ |
||
58 | -- ... ET LE COLORAMA FUT ! |
||
59 | ------------------------------------------------------------------------------------------------------ |
||
60 | |||
61 | -- Remplace dans les chaines les codes de coloration par les définitions de couleur associées |
||
62 | function Necrosis_MsgAddColor(msg) |
||
63 | msg = string.gsub(msg, "<white>", "|CFFFFFFFF"); |
||
64 | msg = string.gsub(msg, "<lightBlue>", "|CFF99CCFF"); |
||
65 | msg = string.gsub(msg, "<brightGreen>", "|CFF00FF00"); |
||
66 | msg = string.gsub(msg, "<lightGreen2>", "|CFF66FF66"); |
||
67 | msg = string.gsub(msg, "<lightGreen1>", "|CFF99FF66"); |
||
68 | msg = string.gsub(msg, "<yellowGreen>", "|CFFCCFF66"); |
||
69 | msg = string.gsub(msg, "<lightYellow>", "|CFFFFFF66"); |
||
70 | msg = string.gsub(msg, "<darkYellow>", "|CFFFFCC00"); |
||
71 | msg = string.gsub(msg, "<lightOrange>", "|CFFFFCC66"); |
||
72 | msg = string.gsub(msg, "<dirtyOrange>", "|CFFFF9933"); |
||
73 | msg = string.gsub(msg, "<darkOrange>", "|CFFFF6600"); |
||
74 | msg = string.gsub(msg, "<redOrange>", "|CFFFF3300"); |
||
75 | msg = string.gsub(msg, "<red>", "|CFFFF0000"); |
||
76 | msg = string.gsub(msg, "<lightRed>", "|CFFFF5555"); |
||
77 | msg = string.gsub(msg, "<lightPurple1>", "|CFFFFC4FF"); |
||
78 | msg = string.gsub(msg, "<lightPurple2>", "|CFFFF99FF"); |
||
79 | msg = string.gsub(msg, "<purple>", "|CFFFF50FF"); |
||
80 | msg = string.gsub(msg, "<darkPurple1>", "|CFFFF00FF"); |
||
81 | msg = string.gsub(msg, "<darkPurple2>", "|CFFB700B7"); |
||
82 | msg = string.gsub(msg, "<close>", "|r"); |
||
83 | return msg; |
||
84 | end |
||
85 | |||
86 | |||
87 | -- Insère dans les timers des codes de coloration en fonction du pourcentage de temps restant |
||
88 | function NecrosisTimerColor(percent) |
||
89 | local color = "<brightGreen>"; |
||
90 | if (percent < 10) then |
||
91 | color = "<red>"; |
||
92 | elseif (percent < 20) then |
||
93 | color = "<redOrange>"; |
||
94 | elseif (percent < 30) then |
||
95 | color = "<darkOrange>"; |
||
96 | elseif (percent < 40) then |
||
97 | color = "<dirtyOrange>"; |
||
98 | elseif (percent < 50) then |
||
99 | color = "<darkYellow>"; |
||
100 | elseif (percent < 60) then |
||
101 | color = "<lightYellow>"; |
||
102 | elseif (percent < 70) then |
||
103 | color = "<yellowGreen>"; |
||
104 | elseif (percent < 80) then |
||
105 | color = "<lightGreen1>"; |
||
106 | elseif (percent < 90) then |
||
107 | color = "<lightGreen2>"; |
||
108 | end |
||
109 | return color; |
||
110 | end |
||
111 | |||
112 | ------------------------------------------------------------------------------------------------------ |
||
113 | -- VARIABLES USER-FRIENDLY DANS LES MESSAGES D'INVOCATION |
||
114 | ------------------------------------------------------------------------------------------------------ |
||
115 | |||
116 | function Necrosis_MsgReplace(msg, target, pet) |
||
117 | msg = string.gsub(msg, "<player>", UnitName("player")); |
||
118 | if target then |
||
119 | msg = string.gsub(msg, "<target>", target); |
||
120 | end |
||
121 | if pet then |
||
122 | msg = string.gsub(msg, "<pet>", NecrosisConfig.PetName[pet]); |
||
123 | end |
||
124 | return msg; |
||
125 | end |