• Hail Guest!
    We're looking for Community Content Contribuitors to Stratics. If you would like to write articles, fan fiction, do guild or shard event recaps, it's simple. Find out how in this thread: Community Contributions
  • Greetings Guest, Having Login Issues? Check this thread!
  • Hail Guest!,
    Please take a moment to read this post reminding you all of the importance of Account Security.
  • Hail Guest!
    Please read the new announcement concerning the upcoming addition to Stratics. You can find the announcement Here!

Help with offset gump and object handle blocking opened corpses

Harlequin

Babbling Loonie
Stratics Veteran
Stratics Legend
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?
 
O

Old Man of UO

Guest
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.
 

Harlequin

Babbling Loonie
Stratics Veteran
Stratics Legend
Would either of these be doable with mods you think? Perhaps by fiddling with the xml files?
 
D

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.
 

TullyMars

Sage
Stratics Veteran
Stratics Legend
Mind explaining how you do this?
Thx
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.
 
D

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
 
O

Old Man of UO

Guest
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.
 

Harlequin

Babbling Loonie
Stratics Veteran
Stratics Legend
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 :)
 

Harlequin

Babbling Loonie
Stratics Veteran
Stratics Legend
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!
 
O

Old Man of UO

Guest
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
 
O

Old Man of UO

Guest
Anybody know how to change the offset and location for the NPC paperdolls?

Thx
 
Top