1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Greetings Guest!!

    In order to combat SPAM on the forums, all users are required to have a minimum of 2 posts before they can submit links in any post or thread.

    Dismiss Notice

Help with offset gump and object handle blocking opened corpses

Discussion in 'UO Enhanced Client Discussion' started by Harlequin, Jul 11, 2010.

  1. Harlequin

    Harlequin Babbling Loonie
    Stratics Veteran

    Joined:
    Jun 11, 2008
    Messages:
    2,716
    Likes Received:
    32
    Is there a setting to disable offset gump like in the CC?

    I want corpses (and any new container gump) to open at the top right corner outside my play area.

    Also, is there any way to prevent object handles from blocking opened corpse containers? Object handles seem to be coded to be always on top. Any toggle for this?
     
  2. I posted this same thing on June 14, and got no replies. I seem to recall that the KR client had that setting. Either way, I also find it very annoying.
     
  3. Harlequin

    Harlequin Babbling Loonie
    Stratics Veteran

    Joined:
    Jun 11, 2008
    Messages:
    2,716
    Likes Received:
    32
    Would either of these be doable with mods you think? Perhaps by fiddling with the xml files?
     
  4. Diggity

    Diggity Guest

    You can edit the ContainerWindow.lua to change the default open gump position as well as the offset behavior. I changed the default position a bit to the right of player center so that the container/corpse gumps don't overlap objects/handles within clicking distance of my char. Also changed/got rid of the horizontal offset so that the containers just overlap a bit vertically.

    I don't think there is a setting or mod you can do to prevent object handles from always being on top. In KR, I edited the ObjectHandle.lua so that I could show just nearby objects and ContainerWindow.lua so that the gumps opened slightly further away so they wouldn't overlap the handles. Haven't modded that yet for the EC, but should still be possible.
     
  5. Mind explaining how you do this?
    Thx
     
  6. TullyMars

    TullyMars Sage
    Stratics Veteran

    Joined:
    May 14, 2008
    Messages:
    525
    Likes Received:
    55
    Loaded question that could be difficult to answer
    Depends on how much you know about mods and their folders.
    If you know enough (or at least enough to get you in trouble)...
    open up your existing mod or create a new mod (do not mess with the default mod folder!!!)
    find the source folder of the mod
    find the file ContainerWindow.lua (if it isn't in there copy it over from the default mod folder)
    Open it with notepad
    Adjust the line
    ContainerWindow.POSITION_OFFSET = 30
    to
    ContainerWindow.POSITION_OFFSET = 0
    or something to that effect.

    Adjust some of the lines like this
    WindowAddAnchor(this, "topleft", "Root", "topleft", x, y)
    to
    WindowAddAnchor(this, "topleft", "Root", "topleft", 200, 200)
    or something to that effect (you may play with the 200 numbers to decide where you want to place it)

    Save the file
    Start the EC
    Make sure you select the option to use the proper mod-skin


    If you don't know what your doing with it, wait for someone else to put out a mod and use that.
    Note it may take some playing with to get it right.
    I do not warrant my work and haven't tried this myself yet.
    But will when I get home from working late.
     
  7. Diggity

    Diggity Guest

    Heed Tully's warnings and below is the area of code where I make my edits.

    The first set of x = and y = is where you could hard code your preferred default location (or you can edit the global variables at the top of the lua). The second set of x = and y = statements is where you would change the offset. Or just change the default offset to 0 as Tully suggests if you want 0 offset. I like a little offset so I can see how many gumps there are. I just use x = same as my default x start position. Then I changed the default offset to 15 so it doesn't offset so much.

    Code:
    	-- else tile them like the old client
    	else
    		WindowUtils.RestoreWindowPosition(this)
    		
    		if not WindowUtils.CanRestorePosition(this) then
    			-- if window position couldn't be restored, cascade the containers from the top left of the screen
    			local x, y;
    			
    			local topCascadingId = ContainerWindow.GetTopOfCascade()
    			if not topCascadingId then
    				x = ContainerWindow.DEFAULT_START_POSITION.x
    				y = ContainerWindow.DEFAULT_START_POSITION.y
    			else
    				x, y = WindowGetScreenPosition("ContainerWindow_"..topCascadingId)
    				x = x + ContainerWindow.POSITION_OFFSET
    				y = y + ContainerWindow.POSITION_OFFSET
    			end
    			
    			x = math.floor(x / InterfaceCore.scale + 0.5)
    			y = math.floor(y / InterfaceCore.scale + 0.5)
    			WindowClearAnchors(this)
    			WindowAddAnchor(this, "topleft", "Root", "topleft", x, y)	
    			
    			ContainerWindow.AddToCascade(id)
    		end
     
  8. Thanks Tully and Diggity. Those explanations help a lot.

    I know not to mess with the Default mod, and if I screw up the Stone Enhanced mod I can always reload it from the zip file and start over. It's happened a time or two.
     
  9. Harlequin

    Harlequin Babbling Loonie
    Stratics Veteran

    Joined:
    Jun 11, 2008
    Messages:
    2,716
    Likes Received:
    32
    Woot! Great instructions guys! I will go play around with the lua files in the mod (I am using the copper mod).

    As long as I can make it open at a corner, I don't have to worry about the handles blocking the containers :)
     
  10. Harlequin

    Harlequin Babbling Loonie
    Stratics Veteran

    Joined:
    Jun 11, 2008
    Messages:
    2,716
    Likes Received:
    32
    Had to extract the lua file from the default zip as copper didn't make a modified version of it, but editting the lua file worked like a charm! Thanks!
     
  11. How do I offset NPC and player Paperdolls? I looked at the ContainerWindow.lua and think this isn't the right one to use.

    Hunting gypsies I frequently double click on them instead of targeting with a single click, and it opens the paperdolls over the top of my hotbars. I'd like to relocate when they start and put in an offset.

    Thx
     
  12. Anybody know how to change the offset and location for the NPC paperdolls?

    Thx