• Dear Guest,

    You're browsing our forum as a Guest meaning you can only see a portion of the forum in read-only mode.
    To view all forum nodes and be able to create threads/posts please register or log-in with your existing account.

    TwinStar team

[Release] EFC Report

Joined
Jun 18, 2015
Likes
351
#1
EFC Report 1.5





This morning I woke up with this idea in mind. An addon that lets you report the EFC location by simply clicking on the map. Since I'm not a coder I wasn't really sure how to do it, but after some researches I've gathered enough informations to make something similar to my original idea.

This addon adds a clickable schematic WSG map to your standard UI. By clicking the different icons on the map your character will send the corresponding report in the BG chat.



Slash commands
Code:
/efcrhide = hide
/efcrshow = show
/efcrsmall = 30% smaller
/efcrbig = 100% size

Features

- By clicking the different icons on the map your character will send the corresponding report in the BG chat.
- It can be dragged around the screen by holding the left mouse button.
- [CR]It can be locked/unlocked with slash commands 'efcrlock' and 'efcrunlock'.[/CR]*
- It can be hidden/shown with slash commands '/efcrhide' and '/efcrshow'.
- It's possible to switch between a bigger and a smaller frame by using slash commands 'efcrbig' and 'efcrsmall'.
- It automatically fades out when not hovered.
- [CR]It automatically shows/hides when the player joins/leaves WSG.[/CR]*

*Features removed in v1.5.


v1.1

- Added a new texture for the EFC Report map.


v1.2

- The EFC Report map fades out when it's not mouse overed.
- Added two buttons to resize the EFC map.
- Added two buttons to send "cap" and "repick" messages.


v1.3

- Completely redesigned layout to be more clear and to fits better the standard Blizzard UI.
- Removed the resize buttons.
- Added lock/unlock slash commands.
- Added resize slash commands.


v1.4

- The addon automatically shows/hides when the player joins/leaves WSG.


v1.5

- I've completely reworked the UI to make it more in line with the original Blizzard UI.
- I've added tooltips when hovering the icons with the cursor.
- I've removed the auto-hide/show and lock/unlock features becouse they weren't working properly (sorry I'm not a coder!).


Screenshot 1:

Screenshot 2:
 
Last edited:
Joined
Jun 18, 2015
Likes
351
#3
Amazing! I love the design, gimme all u got!
Ikr, very modern, compact and minimalistic. :innocent:

--- Edit ---

P.S. I'm so sleepy I forgot to add the download link. Now it's there, enjoy the most advanced (lol) addon in the universe!
 
Last edited:

dms

Authorized
Joined
Apr 11, 2016
Likes
181
#5
Ty man been hoping for a while someone would make this, can you add option to bind everything? And show only on mouseover would be awesome, that way you could have the battlefieldminimap shown all the time and place this over that and then when you want to report just mouseover and it appears.

Anyways great work <3
 
Last edited:
Joined
Jun 18, 2015
Likes
351
#6
And show only on mouseover
That's an amazing idea, I'll try to add that feature! About bindings, it's 21 buttons so I thought it would be a bit too much to bind everyone of them, anyways I'll think about it.

As I said I'm not a coder and I'm having an hard time figuring out how to "show only on mouseover" or even adding bindings, I've checked Events and APIs, but I couldn't find anything useful (yet).

Anyways a compromise could be to bind a pair of macros to hide/show the frame with '/efcrhide' and '/efcrshow'. Also I've added a new texture for the EFC Report map so it looks a bit less ugly and bulky (?).
 
Last edited by a moderator:

Drood

New Member
Joined
Dec 28, 2015
Likes
15
#7
in lua:
Code:
function myMouseEnterFunc()
-- some code here
end
myFrame:EnableMouse(true)
myFrame:SetScript("OnEnter", myMouseEnterFunc)
The other one is called "OnLeave". You will probably need: myFrame:Show(), myFrame:Hide(), myFrame:IsVisible(). This is the basic idea but I do not know how mouse registering works with hidden frames or frames with other frames on top (it's possible you have to make them all children of the main frame).

As for the background, I am too lazy to find the path to the textures, but you can probably find it by printing getglobal("BattlefieldMinimap1"):GetTexture() in game when in WSG. The map is divided into 12 squares, 4x3 and you want the middle six so you'd need to create six frames, 2x3, and set their textures to 2,3,6,7,10,11.
 
Last edited:
Joined
Jun 18, 2015
Likes
351
#9
in lua:
Code:
function myMouseEnterFunc()
-- some code here
end
myFrame:EnableMouse(true)
myFrame:SetScript("OnEnter", myMouseEnterFunc)
The other one is called "OnLeave". You will probably need: myFrame:Show(), myFrame:Hide(), myFrame:IsVisible(). This is the basic idea but I do not know how mouse registering works with hidden frames or frames with other frames on top (it's possible you have to make them all children of the main frame).

As for the background, I am too lazy to find the path to the textures, but you can probably find it by printing getglobal("BattlefieldMinimap1"):GetTexture() in game when in WSG. The map is divided into 12 squares, 4x3 and you want the middle six so you'd need to create six frames, 2x3, and set their textures to 2,3,6,7,10,11.
Oh yea I was trying with 'OnEnter()' but I couldn't make it work; I'll try with the code you gave me, thanks so much!

I know the path for those textures, but I'm not sure how to replace (?) them or even how to interact with the minimap to send chat messages by clicking on it. So for the moment I'll just focus on the addon the way it is now, and maybe try to improve it.

Also I was thinking about lowering the alpha instead of hiding it completelly, and I've found some functions for that.

Thanks again so much for the great tips and code! :w00t:
 
Last edited:
Joined
Jun 18, 2015
Likes
351
#11
i would recommend to make all icons like small squares for space economy though
I thought about that, but as you can see the position of the icons is not random, they are a schematic representation of the WSG map. The point is that this way you might react faster and click the right spot without thinking too much.

Anyways big updates today! Thanks to Drood who gave me a neat piece of code and to dms for the idea, I was able to figure out how to add the "show only on mouseover" feature; it actually fades out to be almost invisible (80% transparent) but I can even make it disappear completelly, let me know what do you think is better. I've also added two buttons to resize the EFC map and two buttons to call for "cap" and "repick".

v1.2

- The EFC Report map fades out when it's not mouse overed.
- Added two buttons to resize the EFC map.
- Added two buttons to send "cap" and "repick" messages.
 

NotSachi

Authorized
Joined
Oct 28, 2015
Likes
138
#13
would it be possible to just make it only appear on key press down

so i could make it behave kinda like chat wheel in dota
 

dms

Authorized
Joined
Apr 11, 2016
Likes
181
#14
I was thinking about that too so I created this macro with swag:
/script if efcmap:IsVisible() then efcmap:Hide() else efcmap:Show() end
Just bind it to any button and it toggles the frame show/hide with each keypress
 

Drood

New Member
Joined
Dec 28, 2015
Likes
15
#15
Also I was thinking about lowering the alpha instead of hiding it completelly, and I've found some functions for that.
That's the "correct" way to ago about it, actually, because then the mouse will still register for sure. By the way, you don't want to make the actual bg-map clickable. Make a transparent frame on top of it isntead. Here's what I think you should do:
Make a small frame that will function like a button (you can make an actual button but they are somewhat unsightly), call it f for now, and give it background colour smth like (0,0,0,0.2) or smth like that. Then make a string
Code:
f.txt = buttonFrame:CreateFontString(nil, 'OVERLAY')
f.txt:SetFont(STANDARD_TEXT_FONT, 12, 'OUTLINE')
f.txt:SetTextColor(1, 1, 1) --or whatever, I think standard "Blizzard yellow" is (1, .82, 0)
f.txt:SetText("Report EFC") --or smth like that
Anchor the button next to the BGMap text perhaps? Or make it freely movable with something like
Code:
f:SetScript('OnDragStart', function() this:StartMoving() end)
f:SetScript('OnDragStop', function() this:StopMovingOrSizing() end)
In this case, make the size of f wider than the width of the text. Then either set the show/hide script to f.txt or make another frame of same height that covers only the width of the text and anchor it to f, or make it a child, (so that you can still click on a part of f without clicking on the new frame so that dragging will move them both)
Then when clicking f.txt (or the frame that covers it), make the main frame with your clickable buttons appear/disappear on top of the minimap or some location with respect to the location of the frame f. In fact, were I you, I would make another button (or checkbox) just like this that will switch between anchoring to BGmap and being freeky movable. Not everyone wants this on their BGMap. In the anchored mode, you arrange the blocks on top of the BGMap ones, and in the free mode you can make them all same size into two rows under the button or smth like that. You should also f:RegisterEvent("PLAYER_ENTERING_WORLD") and f:SetScript("OnEvent", myHandler) where
Code:
local function myHandler()
local myZone, _, _, _, _ = GetMapInfo();
if (myZone and myZone=="WarsongGulch") then
myAddonShouldBeEnabled = true
else
myAddonShouldBeEnabled = false
end
end
and begin your main chunk of code with an if myAddonShouldBeEnabled then... Happy coding. :)
 

lanevegame

Authorized
Joined
Jun 18, 2015
Likes
351
#17
v1.3

- Completely redesigned layout to be more clear and to fits better the standard Blizzard UI.
- Removed the resize buttons.
- Added lock/unlock slash commands.
- Added resize slash commands.


P.S. I also tried to add the auto enable/disable addon for when you join/leave WSG but I couldn't figure out how to make it work. :blink:

This is the code I was testing:
Code:
local function efcHandler()
local myZone, _, _, _, _ = GetMapInfo();
if (myZone and myZone=="Durotar") then
efcframe:Show();
else
efcframe:Hide();
end
end
 
Last edited:

Drood

New Member
Joined
Dec 28, 2015
Likes
15
#18
That did not work because the PLAYER_ENTERING_WORLD event triggers when you see a loading screen (no such thing when you zone into Durotar).
 

lanevegame

Authorized
Joined
Jun 18, 2015
Likes
351
#20
I tried again many times but I couldn't find a way to use your code, I guess I really need to study some coding! But I've found a way to obtain basically the same result with CHAT_MSG_CHANNEL_NOTICE, so basically the addon frame hides when you join a "Local Defense" channel that is not "Local Defense - Warsong Gulch", and it shows up when you join WSG channel.
I've tested it in Orgrimmar and it works just fine, and right now I'm trying to join WSG to test it there but it's AV weekend... :crying:

Anyways I'll give you an update as soon as I can test it in WSG.
 

Drood

New Member
Joined
Dec 28, 2015
Likes
15
#23
I tried again many times but I couldn't find a way to use your code, I guess I really need to study some coding! But I've found a way to obtain basically the same result with CHAT_MSG_CHANNEL_NOTICE, so basically the addon frame hides when you join a "Local Defense" channel that is not "Local Defense - Warsong Gulch", and it shows up when you join WSG channel.
I am not sure how reliable that is. How exactly did you test it? You can always /script ReloadUI() to make the event trigger. If you kept relogging, that won't work. You need to :RegisterEvent("PLAYER_LOGIN") which is slightly different. It's also possible that you tested it in an area where GetMapInfo() doesn't return the correct value, you should first check what it returns in the zone you're testing in, but it should return "WarsongGulch" in WSG.
 

lanevegame

Authorized
Joined
Jun 18, 2015
Likes
351
#24
I am not sure how reliable that is. How exactly did you test it? You can always /script ReloadUI() to make the event trigger. If you kept relogging, that won't work. You need to :RegisterEvent("PLAYER_LOGIN") which is slightly different. It's also possible that you tested it in an area where GetMapInfo() doesn't return the correct value, you should first check what it returns in the zone you're testing in, but it should return "WarsongGulch" in WSG.
I've tested CHAT_MSG_CHANNEL_NOTICE in Alterac Valley and it worked fine, since everytime you move to a new zone you also join a "Local Defense" channel and it triggers the hide/show code. About PLAYER_ENTERING_WORLD I simply couldn't implement it in my addon, so I couldn't test it at all becouse I'm noob at coding. :crying:

I liked the original 1.0 look the best :)
Earlier versions are still downloadable from this page. :laugh:
 
Last edited:

lanevegame

Authorized
Joined
Jun 18, 2015
Likes
351
#25
Yesterday I've tested it in WSG and it worked perfectly, it showed up when I've joined the game and then disappeared once I left the BG.
 
Top Bottom