1. #1

    Need some help with "OnEscapePressed" function

    Hey, I'v been looking for a map replacement addon that let me resize and move the map arround etc, but also have some way of preventing ESC from closing it.
    So far I'v been unable to locate such an addon so I decided I had to add a function for it myself in Mapster.
    OnEscapePressed seems to be the correct thing to change here, but I got close to no experience with LUA so I was hoping someone could help me figure out what to write into the existing LUA code for Mapster so that I may choose to prevent ESC from closing the map.

  2. #2
    Escape does close Mapster though... Another addon may be interferring with this?

    EDIT: Oh right, preventing ESC closing it. Sorry - misread. Let me look at the code now..

    ---------- Post added 2010-11-29 at 12:06 AM ----------

    I'm at work, so can't test it here. Try changing:

    Code:
    WorldMapFrame:SetScript("OnKeyDown", nil)
    to:

    Code:
    WorldMapFrame:SetScript("OnKeyDown", nil)
    WorldMapFrame:SetScript("OnEscapePressed", nil)
    Last edited by Janaa; 2010-11-29 at 12:02 AM.
    Quote Originally Posted by DSRilk View Post
    The true measure of a person is how they act when they know they won't get caught.

  3. #3
    I'll try it. Back with update in 2 mins.

  4. #4
    Actually, I read up more on OnEscapePressed and it's more to do with clearing the focus from an edit box, rather than an actual key capture, which is what you want.. As for key-capturing overriding default behavior, I'm no expert in this. My efforts have been mostly in vain as I was trying to make a keyboard controller interface for the character window.. I'll look some more, but if I don't come back with anything, hopefully someone else will.
    Quote Originally Posted by DSRilk View Post
    The true measure of a person is how they act when they know they won't get caught.

  5. #5
    It prevent ESC from closing the map, but I am now unable to move it, and when rescaling it in config window I need to do a reloadUI for the change to happen.

    edit:

    remove the <WorldMapFrame:SetScript("OnEscapePressed", nil)> part, possition the map where I wanted it and put the line back into the code. But the map jumps back to default possition when adding the line.
    Last edited by Gemt; 2010-11-29 at 12:18 AM.

  6. #6
    Btw, if all you want is a small map, you know you can do this pressing CTRL-M? Alas, it doesn't mark quest areas, which is probably what you're wanting? Sorry I couldn't be more help.
    Quote Originally Posted by DSRilk View Post
    The true measure of a person is how they act when they know they won't get caught.

  7. #7
    Not what I want Experimenting with a super wide resolution spreading on two monitors, and then limiting the actualy game graphic rendering to one of the monitors and putting certain addons on the other one. This way I can i.e always have a big map open on one screen while at the same time move my character.

    The whole idea is more effective questing

  8. #8
    Hmm.. Check out function Mapster:SizeUp() and related functions.

    It may be possible to actually change the default position and size, so you can put the line in to prevent escape, yet not have it return to a default position, but rather to where you want it.

    Eg, in the starting section is this code:
    Code:
    	WorldMapFrame:SetParent(UIParent)
    	WorldMapFrame:SetToplevel(true)
    	WorldMapFrame:SetWidth(1024)
    	WorldMapFrame:SetHeight(768)
    	WorldMapFrame:SetClampedToScreen(false)
    You should also be able to put in there such code as :SetScale etc.


    EDIT:

    Also, before that, try commenting out this line:
    Code:
    LibWindow.RestorePosition(WorldMapFrame)
    That may allow you to set the position without the line in, add the line in, and restart without it changing the position back to default.
    Last edited by Janaa; 2010-11-29 at 12:48 AM.
    Quote Originally Posted by DSRilk View Post
    The true measure of a person is how they act when they know they won't get caught.

  9. #9
    Testing it out atm. Will let u know as soon as I get it to work/figure out it wont work. Few unsuccessfull attempts so far but gonna try few more options as well.

    ---------- Post added 2010-11-29 at 03:05 AM ----------

    Nop seems I cant get it to work. Tried different ways of this but the end result is either that escape still works, or that I cant move the map. Sometimes I cant even move the character with the map up.

    But the line "WorldMapFrame:SetScript("OnEscapePressed", nil)" is definately working. Just need to find a way to be able to possition the map after implementing that line in the code.[COLOR="red"][COLOR="red"]
    Last edited by Gemt; 2010-11-29 at 07:05 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •