PDA

View Full Version : DesktopManager.registerStackShortcut Question



drahkar
June 7th, 2010, 02:34
How can you tell where its placing the icon? None of the code seems to have anything to do with that except how to space things vs eachother.

drahkar
June 9th, 2010, 21:46
So... should I take the complete silence to mean I'm going to have to manually go through the code to figure out an answer to this?

Oberoten
June 9th, 2010, 22:17
Hmm... I did a change to how this handles in my own code, but I am not sure it will be helpful to you since I hardly understand the code myself. (Sorry about that really) All I did was to make it two columns of icons below and a single row above.

- Obe

Moon Wizard
June 10th, 2010, 02:41
There should be a desktop manager LUA file in the scripts folder of the ruleset. In that file, all of the functions to implement the button stack in the upper right-hand corner of the desktop are implemented. I also noticed that the stack spacing and column information is right at the top.

When in doubt, find a good text editor that allows you to search over multiple files, and just search for the function you're interested in. I have been using Textpad, and several other editors have been recommended on the forums as well. (Notepad++, etc.)

Cheers,
JPG

drahkar
June 10th, 2010, 03:02
Sounds good. Was just hoping for a quick answer. :)

Appreciate suggestions though! I'll post up what I find.

drahkar
June 10th, 2010, 10:47
So it appears its placed with how setStaticBounds functions. Unfortunately that makes it a little harder to manipulate position cause you can't have a negative offset. Going to have to fiddle.

Fenloh
June 10th, 2010, 13:07
Well Drakhar,

What do you want to do anyway?

and

you can for sure set negative numbers on the control. With the setStaticBounds you always set x and y axis and the hight and width

setStaticBounds(-10, 20, 30, 30) would place the control 10 to the left and 20 down from the standard position (which is 0,0 on the sidebar and the sidebar is about 110 or some pixels wide.)
the control would be 30 wide and 30 high.

The code that is used just calculates the position due to the returned numbers from the Table and the scales it due to the windowsize.

The problem though may be, that you cant place it left of the sidebar, because of the way the sidebar is handled. The Control is there, it is just not shown. With the SR 4 Ruleset we are playing around with an own panel and the sidebar completly set to 0 width. Only problem there is that the Desktop Radial Menue is not correctly shown, but we are working to change that.

Fenloh

drahkar
June 10th, 2010, 13:28
Interesting, according to the library information on setStaticBounds, if you put a negative number, it switches from focusing on one bounding area to the other.

I'm basically trying to resize it to have the buttons aligned properly with the sidebar background. I've made some size concessions at the moment that look good, but if does function the way you described I'll have to see about fiddling with it some more and see how it turns out.