1. Updated Resource Submission Rules: All model & skin resource submissions must now include an in-game screenshot. This is to help speed up the moderation process and to show how the model and/or texture looks like from the in-game camera.
    Dismiss Notice
  2. DID YOU KNOW - That you can unlock new rank icons by posting on the forums or winning contests? Click here to customize your rank or read our User Rank Policy to see a list of ranks that you can unlock. Have you won a contest and still havn't received your rank award? Then please contact the administration.
    Dismiss Notice
  3. The 18th Icon Contest is ON! Choose any ingame unit and give him/her Hero abilities. Good luck to all.
    Dismiss Notice
  4. The Secrets of Warcraft 3 have revealed interesting works. The RESULTS for Abelhawk's Mini-Mapping Contest #15 have come out!
    Dismiss Notice
  5. Contestants are to create a scene set in the Stone Age. Come and see what you can come up with. We wish you the best of luck!
    Dismiss Notice
  6. Colour outside the lines! Techtree Contest #13 is a go. The contest is optionally paired.
    Dismiss Notice
  7. Night Rider gained several songs for his journey. The poll for the 12th Music Contest has started. Check it out!
    Dismiss Notice
  8. Greetings cerebrates, our Swarm needs new spawners that will have numerous children. Join the HIVE's 31st Modeling Contest - Spawners and Spawned! The contest is optionally paired.
    Dismiss Notice
  9. Join other hivers in a friendly concept-art contest. The contestants have to create a genie coming out of its container. We wish you the best of luck!
    Dismiss Notice
  10. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

[Lua] GUI Repair Kit

Discussion in 'Submissions' started by Bribe, Jul 12, 2019.

  1. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,995
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    A Lua kit to fix the more common issues with the Blizzard.j file - the aim is to remove as many penalties as possible from using GUI and to incentivize mapmakers to switch the underlying script to Lua due to ease of use.

    Code (Lua):

    do
       local oldDDBJ = TriggerRegisterDestDeathInRegionEvent
       function TriggerRegisterDestDeathInRegionEvent(trig, r)
          --Removes the limit on the number of destructables that can be registered.
          EnumDestructablesInRect(r, nil, function() TriggerRegisterDeathEvent(trig, GetEnumDestructable()) end)
       end
     
       local oldDeadBJ = IsUnitDeadBJ
       function IsUnitDeadBJ(u) return not UnitAlive(u) end --uses the reliable native instead of the life check
     
       local oldAliveBJ = IsUnitAliveBJ
       function IsUnitAliveBJ(u) return UnitAlive(u) end --uses the reliable native instead of the life check
       
       local oldSUPWBJ = SetUnitPropWindowBJ
       function SetUnitPropWindowBJ(whichUnit, propWindow)
          --Allows the Prop Window to be set to zero to allow unit movement to be suspended.
          SetUnitPropWindow(whichUnit, propWindow*bj_DEGTORAD)
       end
    end
     
     
    Last edited: Aug 14, 2019 at 6:35 PM
  2. Tasyen

    Tasyen

    Joined:
    Jul 18, 2010
    Messages:
    1,211
    Resources:
    16
    Tools:
    2
    Maps:
    2
    Spells:
    7
    Tutorials:
    4
    JASS:
    1
    Resources:
    16
    SmartCameraPanBJ was fixed by Blizzard. They also created a location outside of the GetLocalPlayer block as you do.
     
  3. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,995
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    Thanks for the tip! I'll remove that portion.
     
  4. Daffa the Mage

    Daffa the Mage

    Map Moderator

    Joined:
    Jan 30, 2013
    Messages:
    7,615
    Resources:
    27
    Packs:
    1
    Maps:
    8
    Spells:
    16
    Tutorials:
    2
    Resources:
    27
    Welp, that SmartCameraPanBJ tutorial paid off. Now, what else to fix? Oh yes. Lots of local handle leaks in GUI @Bribe.
     
  5. Bribe

    Bribe

    Joined:
    Sep 26, 2009
    Messages:
    7,995
    Resources:
    25
    Maps:
    3
    Spells:
    10
    Tutorials:
    3
    JASS:
    9
    Resources:
    25
    Local handle leaks aren't a thing in Lua :)
     
  6. Daffa the Mage

    Daffa the Mage

    Map Moderator

    Joined:
    Jan 30, 2013
    Messages:
    7,615
    Resources:
    27
    Packs:
    1
    Maps:
    8
    Spells:
    16
    Tutorials:
    2
    Resources:
    27
    True, but-

    Nevermind then I guess.