|
|
Source code |
1 2 3 4 5 |
function Occurrens_Linguae.SubstitueOriginalLink(arg1, originalLinkName, translatedLinkName) DEFAULT_CHAT_FRAME:AddMessage(arg1); DEFAULT_CHAT_FRAME:AddMessage(originalLinkName); DEFAULT_CHAT_FRAME:AddMessage(translatedLinkName); arg1 = string.gsub(arg1, originalLinkName, translatedLinkName); DEFAULT_CHAT_FRAME:AddMessage(arg1); end |
|
|
Source code |
1 2 |
Default output of line 4-5...:[Saber] Say(original event): [Not a name] |
This post has been edited 3 times, last edit by "ftwoplay" (Nov 18th 2015, 4:03am)
Copy the attached file to "<YourROMFolder>\interface\worldxml\" and remove the ".txt" extension (had to rename it to upload it here). If you want to see how I did it exactly, look at lines 448-455 (just some pattern magic)
This post has been edited 2 times, last edit by "hoffmale" (Nov 18th 2015, 7:04am)
This post has been edited 2 times, last edit by "ftwoplay" (Nov 18th 2015, 3:00pm)
I understand what I was doing wrong, and why. This is a solution, but possibly a valid one. I'll have to hook the event most likely, which is not an ideal solution, but is necessary to make sure the solution is easily propogatable, and not illegal. I appreciate the effort you expended, I really do. But I'm sure you understand why I am hesitant to accept this solution. I'm not sure if having a very small WaitTimer.Wait will help. I am unsure of if the event handler for RoM is multi threaded, if it is. We can force mine to fire last via a wait timer. If not, a race condition will have to do...
Edit: If for some reason Players are allowed to modify or use specific modifications to the in game .lua I would be MORE than happy to use this solution and start fixing like every bug that exists in game. I doubt this is the case, but if a GM would kindly let me know where we stand on the issue. This modification is harmless, and I believe should be allowed... My dreams would come true, if GM's said we can do this. My only desire is to fix the game, and modifying files like these would allow me to go well above and beyond addons. I beg of you GM's. Let this solution be acceptable.
). Graphics engine, AI and game logic are mostly hardcoded anyways, so no lua files to modify there either. That's too bad... I mean I guess customizing the interface is a fun project, but oh well... In any case, Thank you for your help, and I don't mid that you solved the problem. Perhaps we could recommend the code to RoM Dev's (RW) itself. This wouldn't be a huge change, and would be very helpful, to some at least. What I was thinking though, was I could fix things like the stupid EoJ timer disappearing like every 30 secondsWell, from what I understand we can customize our interface folder (which means, we can customize the login screen and the standard UI). Sadly, as the name says, there are only interface relevant files in there, so you would only be able to fix interface bugs (like, remove that annoying diamond minimap button). Graphics engine, AI and game logic are mostly hardcoded anyways, so no lua files to modify there either.
. Stuff like that. In any case very helpful, and very informative. I am very grateful for your assistance with this matter. I was hoping there would be a way that they COULD pass the arg by reference, or perhaps a method callback, or even a setter. But alas no such luck. And with that being said. If your above post is true, that we can edit the interface files, this solution is perfectly valid, and everyone who wishes, should follow the instruction in your first post here.fix things like the stupid EoJ timer disappearing like every 30 seconds
Well, theoretically you could, but that would require some modifications anywaysI was hoping there would be a way that they COULD pass the arg by reference, or perhaps a method callback, or even a setter.
(Well, also you could unregister the original handler and call ChatFrameX:AddMessage or the original handler from your handler - wihich might or might not break other addons).Well, even if it would wouldn't be alowed it would be easy to do in another addon ("ChatFrame_OnEvent = insert_modified_version_here"), but with some possible conflicts with other addons (as I said, that function is contentedIf your above post is true, that we can edit the interface files, this solution is perfectly valid, and everyone who wishes, should follow the instruction in your first post here.
)
]. In addition, getting the timer is dependent on another player being there, when the event started, that also has the addon. This is the best I could do at the time, and it sounds like you agree, this is the best it is going to get, because the only way to improve it, would be adding the score, which would result in me having to update every other client with the score of each client... Which is incredibly wasteful, and unnecessary. Not to mention the fact that some people may not have the addon, which then again throws the score out of whack. |
|
Source code |
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 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 |
--This array stores information about the Public_Event that is happening in the zone and the SMPA_PublicEventFrame.
local SMPA_PE = {
CHAN1 = false; --Has the event finished on Channel 1?
CHAN2 = false; --Has the event finished on Channel 1?
CHAN3 = false; --Has the event finished on Channel 1?
CHANNELCHANGED = false; --Have we just changed a channel, THAT we haven't been to yet this event?
PREVIOUSCHANNEL; --What channel were we on, before our current one? (Code doesn't execute for the 25 seconds as you are switching channels)
CHANGEOCCUR = false; --Have we just changed a channel?
CHANGELINGER = false; --I don't even know, and I coded this recently. If you figure it let me know.
SUCCESS = false; --Did the event succeed?
TIMER = -1; --What is the event's timer?
WAITING = false; --Are we waiting (the time in-between function calls.)
MY_REQUEST = false; --Did I ask for the "!EOJ" update?
RUNNING = false; --Are we running the Public event code?
VALID = true; --Are we OK to run the loop? You don't want it running during a load screen etc...
}
----------------------------------------------------
-------------- Public Event Code --------------
----------------------------------------------------
--Determines whether the event is: running, waiting, or just ended.
function SMPAPublicEventPhase(arg1, timer)
if (SMPAFindName(arg1, SMPA_MSG.PUBLIC_EVENT_STOP)) then
SMPA_PE.RUNNING = false;
SMPA_PE.VALID = true;
SMPA_PE.SUCCESS = false;
current = GetCurrentParallelID();
SMPAPublicEventChannel(current);
SMPA_PublicEventFramePhase:SetText("Waiting");
SMPA_PublicEventFramePhase:SetColor(1, 0.5, 0);
if (timer == nil) then
timer = 124;
end
WaitTimer.Wait(2, SMPAPublicEventWaitTimer, tmrPESuccess, timer);
--SMPAColorAttentionPlease("Typing '!EOJ' will update your timer.", 1, 1, 0);
elseif (SMPAFindName(arg1, SMPA_MSG.PUBLIC_EVENT_START)) then
SMPA_PE.RUNNING = true;
SMPA_PE.VALID = true;
SMPAPublicEventChannelReset();
SMPA_PublicEventFramePhase:SetText("Running");
SMPA_PublicEventFramePhase:SetColor(0.1, 1, 0);
if (timer == nil) then
timer = 1100;
end
SMPAPublicEventTimer(timer);
elseif (SMPAFindName(arg1, "The 3 adventurers who made the highest")) then
SMPA_PE.SUCCESS = true;
end
end
--The timer function for a RUNNING public event.
function SMPAPublicEventTimer(passedTime)
if (SMPA_PE.VALID) then
local newTime = passedTime - 1;
SMPA_PE.TIMER = passedTime;
if (SMPA_PublicEventFramePhase:GetText() == "Running") then
if (passedTime == 1078) then
SMPA_PublicEventFrameCountdown:SetColor(0, 1, 0);
elseif (passedTime == 600) then
SMPA_PublicEventFrameCountdown:SetColor(0.2, 0.8, 0);
elseif (passedTime == 300) then
SMPA_PublicEventFrameCountdown:SetColor(0.5, 0.5, 0);
elseif (passedTime == 180) then
SMPA_PublicEventFrameCountdown:SetColor(0.8, 0.2, 0);
elseif (passedTime == 60) then
SMPA_PublicEventFrameCountdown:SetColor(1, 0, 0);
end
end
local current = GetCurrentParallelID();
if (current == SMPA_PE.PREVIOUSCHANNEL) then
--
else
if (current == 1 and SMPA_PE.CHAN1 == false) then
SMPA_PE.CHANNELCHANGED = true;
SMPA_PE.PREVIOUSCHANNEL = current;
elseif (current == 2 and SMPA_PE.CHAN2 == false) then
SMPA_PE.CHANNELCHANGED = true;
SMPA_PE.PREVIOUSCHANNEL = current;
elseif (current == 3 and SMPA_PE.CHAN3 == false) then
SMPA_PE.CHANNELCHANGED = true;
SMPA_PE.PREVIOUSCHANNEL = current;
end
SMPA_PE.CHANGEOCCUR = true;
SMPA_PE.CHANGELINGER = true;
end
if (SMPA_PE.RUNNING) then
if (passedTime == 0) then
--We must be done counting down now.
SMPA_PublicEventFramePhase:SetText("Resetting...");
--SMPA_PublicEventFrameCountdown:SetText("Resetting...");
else
local convertedTime = SMPAConvertToMinutes(newTime);
SMPA_PublicEventFrameCountdown:SetText(convertedTime);
if (SMPA_PE.CHANGEOCCUR) then
SMPA_PE.CHANGEOCCUR = false;
local newPassTime = newTime - 25;
if (SMPA_PE.CHANNELCHANGED) then
WaitTimer.Wait(1, SMPAPublicEventTimer, tmrPublicEvent, newPassTime);
else
SMPA_PE.CHANNELCHANGED = false;
newPassTime = newPassTime + 120;
SMPA_PublicEventFramePhase:SetText("Waiting");
SMPA_PublicEventFramePhase:SetColor(1, 0.5, 0);
SMPA_PE.RUNNING = false;
WaitTimer.Wait(1, SMPAPublicEventWaitTimer, tmrPublicEvent, newPassTime);
end
else
WaitTimer.Wait(1, SMPAPublicEventTimer, tmrPublicEvent, newTime);
end
end
end
end
end
--The timer function for a WAITING public event.
function SMPAPublicEventWaitTimer(passedTime)
if (SMPA_PE.SUCCESS) then
passedTime = passedTime + SMPA_PE.TIMER;
SMPA_PE.SUCCESS = false;
end
if (SMPA_PE.VALID) then
local newTime = passedTime - 1;
SMPA_PE.TIMER = passedTime;
if (SMPA_PublicEventFramePhase:GetText() == "Waiting") then
if (passedTime == 600) then
SMPA_PublicEventFrameCountdown:SetColor(1, 0, 0);
elseif (passedTime == 300) then
SMPA_PublicEventFrameCountdown:SetColor(0.8, 0.2, 0);
elseif (passedTime == 120) then
SMPA_PublicEventFrameCountdown:SetColor(0.5, 0.5, 0);
elseif (passedTime == 60) then
SMPA_PublicEventFrameCountdown:SetColor(0.2, 0.8, 0);
elseif (passedTime == 20) then
SMPA_PublicEventFrameCountdown:SetColor(0, 1, 0);
end
end
local current = GetCurrentParallelID();
if (current == SMPA_PE.PREVIOUSCHANNEL) then
--
else
if (current == 1 and SMPA_PE.CHAN1 == false) then
SMPA_PE.CHANNELCHANGED = true;
SMPA_PE.PREVIOUSCHANNEL = current;
elseif (current == 2 and SMPA_PE.CHAN2 == false) then
SMPA_PE.CHANNELCHANGED = true;
SMPA_PE.PREVIOUSCHANNEL = current;
elseif (current == 3 and SMPA_PE.CHAN3 == false) then
SMPA_PE.CHANNELCHANGED = true;
SMPA_PE.PREVIOUSCHANNEL = current;
end
SMPA_PE.CHANGEOCCUR = true;
SMPA_PE.CHANGELINGER = true;
end
if (SMPA_PE.RUNNING == false) then
if (passedTime == 0) then
--We must be done counting down now.
SMPA_PublicEventFramePhase:SetText("Resetting...");
--SMPA_PublicEventFrameCountdown:SetText("Resetting...");
else
local convertedTime = SMPAConvertToMinutes(newTime);
SMPA_PublicEventFrameCountdown:SetText(convertedTime);
if (SMPA_PE.CHANGEOCCUR) then
newTime = newTime - 25;
SMPA_PE.CHANGEOCCUR = false;
if (SMPA_PE.CHANNELCHANGED) then
SMPA_PE.CHANNELCHANGED = false;
local newPassTime = newTime - 120;
SMPA_PublicEventFramePhase:SetText("Running");
SMPA_PublicEventFramePhase:SetColor(0.1, 1, 0);
SMPA_PE.RUNNING = true;
WaitTimer.Wait(1, SMPAPublicEventTimer, tmrPublicEvent, newPassTime);
else
WaitTimer.Wait(1, SMPAPublicEventWaitTimer, tmrPublicEvent, newTime);
end
else
WaitTimer.Wait(1, SMPAPublicEventWaitTimer, tmrPublicEvent, newTime);
end
end
end
end
end
-- Forcibly updates your timer.
-- Format: SMPA: phase time
function SMPAPublicEventUpdater(arg1)
--Check to see if this a unique version of this function.
if (SMPA_PE.WAITING == false and SMPA_PE.MY_REQUEST == false) then
SMPA_PE.WAITING = true;
local split = SMPAStringSplit(arg1, "%s");
local phase = split[2];
local timer = split[3];
if (phase == "Running") then
SMPA_PE.RUNNING = true;
SMPAPublicEventPhase(SMPA_MSG.PUBLIC_EVENT_START, timer);
elseif (phase == "Waiting") then
SMPA_PE.RUNNING = false;
SMPAPublicEventPhase(SMPA_MSG.PUBLIC_EVENT_STOP, timer);
end
WaitTimer.Wait(0.2, SMPAResetPublicEventUnique, tmrPublicEventUnique)
end
end
--Responds to a call in zone chat for a timer update.
function SMPAPublicEventPropogate()
local phase = SMPA_PublicEventFramePhase:GetText();
if (phase == "Waiting" or phase == "Running") then
SMPAZoneOut("SMPA: "..phase.. " "..SMPA_PE.TIMER);
end
end
--Asks in zone chat for a timer update.
function SMPAPublicEventSendRequest()
SMPA_PE.MY_REQUEST = true;
SMPAZoneOut("!EOJ");
WaitTimer.Wait(2, SMPAResetPublicEventRequest, tmrPublicEventRequest);
end
--Figures out which channel we are, that the public event just finished.
function SMPAPublicEventChannel(number)
if (number == 1) then
SMPA_PE.CHAN1 = true;
elseif (number == 2) then
SMPA_PE.CHAN2 = true;
elseif (number == 3) then
SMPA_PE.CHAN3 = true;
end
end
--Resets all the channels, after an event has started again.
function SMPAPublicEventChannelReset()
SMPA_PE.CHAN1 = false;
SMPA_PE.CHAN2 = false;
SMPA_PE.CHAN3 = false;
end
--Stops any loops for public event.
function SMPAPEStop()
SMPA_PE.VALID = false;
end
function SMPAResetPublicEventUnique()
SMPA_PE.WAITING = false;
end
--Resets whether or not you sent the !EoJ update for the Public_Event.
function SMPAResetPublicEventRequest()
SMPA_PE.MY_REQUEST = false;
end
|
etParent is buggy) or use your own timer frame (which is a direct child of WorldFrame). This would only be thwarted by loading screens, but then again, you normally won't port somewhere else and instantly start doing the EoJ event there in the current round 
)
Makes it so difficult to do things manually. Not that I mind the challenge, but I feel like they are setting up obstacles unnecessarily sometimes. 
)