Go Back   RunUO - Ultima Online Emulation > RunUO > General Discussion

General Discussion General discussion for the RunUO community, all off-topic posts will be deleted. This forum is NOT FOR SUPPORT!

Reply
 
Thread Tools Display Modes
Old 08-21-2007, 07:59 PM   #1 (permalink)
Master of the Internet
 
TMSTKSBK's Avatar
 
Join Date: Feb 2004
Location: NC/NC State Univ
Age: 23
Posts: 16,424
Default Skin your gumps! Lose the compile wait!

Greets -

I'm writing the second version of my skinning system. This one promises to be a whole lot easier to use.


Here's how it goes:

Set up a SkinManager for your system, and provide it with a base directory, extension, type, and load/save/generate skin handlers.

Once you set up a SkinManager, it will do all the save/load/generate work for you. It'll also hang onto the skins for your system.


Create a type for your skins that extends BaseSkin (provided). Include all the information about windowlets, buttons, backgrounds, and so on.

Write the methods that save and load your type.

Use the variables in your type when setting up your gumps, instead of using set values.

Finally, write commands to load or save skins as you like, poking the methods in SkinManager to do the work for you.


WHY?
Doing this correctly allows you to skip the compile>tweak>compile>tweak process in making a gump. Unless you're perfect and get it right the first time every time, this can be a significant time savings.

This also allows for you to have and use multiple easily updatable skins. It's a very flexible system, allowing the system developer to use or not use as many variables as s/he needs.

The BaseSkin method includes WindowInfo, and ButtonInfo structs. These allow you to define a complete "window" or "button" object for use, with only one object.

Also, BaseSkin has support for the GumpList object, which allows for infinite lists to be set up much like a ListView for Windows applications.

Attached is some preview code. Look in the SkinManager.cs file for an example.

Comments, questions, concerns, and so on can all be placed here. I would like to know what you think.

TMSTKSBK
Attached Files
File Type: zip BaseSkin.zip (9.8 KB, 6 views)
__________________
Goodbye, folks.
TMSTKSBK is offline   Reply With Quote
Old 08-21-2007, 10:05 PM   #2 (permalink)
Forum Master
 
Joeku's Avatar
 
Join Date: Feb 2005
Location: ShatteredSosaria.com
Posts: 9,260
Default

<3

That is all.
Joeku is offline   Reply With Quote
Old 08-22-2007, 07:22 PM   #3 (permalink)
Master of the Internet
 
TMSTKSBK's Avatar
 
Join Date: Feb 2004
Location: NC/NC State Univ
Age: 23
Posts: 16,424
Default

Lemme know if you actually get it working >_>...
__________________
Goodbye, folks.
TMSTKSBK is offline   Reply With Quote
Old 08-27-2007, 12:06 PM   #4 (permalink)
Forum Expert
 
o0_Sithid_0o's Avatar
 
Join Date: Nov 2004
Location: Hiding his old posts from Daat99.
Age: 22
Posts: 2,322
Send a message via AIM to o0_Sithid_0o Send a message via MSN to o0_Sithid_0o
Default

Sadly ...... I still havnt figured out how to incorp this into gumps.

><.
__________________

Quote:
Originally Posted by Radwen View Post
Give me a reason... to like you.
Quote:
Originally Posted by excuse me miss, but uh... View Post
11/f/n.korea
Priceless.
o0_Sithid_0o is offline   Reply With Quote
Old 08-27-2007, 02:03 PM   #5 (permalink)
Master of the Internet
 
TMSTKSBK's Avatar
 
Join Date: Feb 2004
Location: NC/NC State Univ
Age: 23
Posts: 16,424
Default

Where are you having trouble?
__________________
Goodbye, folks.
TMSTKSBK is offline   Reply With Quote
Old 08-27-2007, 03:10 PM   #6 (permalink)
Forum Expert
 
o0_Sithid_0o's Avatar
 
Join Date: Nov 2004
Location: Hiding his old posts from Daat99.
Age: 22
Posts: 2,322
Send a message via AIM to o0_Sithid_0o Send a message via MSN to o0_Sithid_0o
Default

Quote:
Originally Posted by TMSTKSBK View Post
Where are you having trouble?
Well like, I see where you say how to set things up but you dont really mention anything about where it fits in in the actual gump code lol.

*might be missing somethign really ovious*
*votes for a real example, gumps included*
__________________

Quote:
Originally Posted by Radwen View Post
Give me a reason... to like you.
Quote:
Originally Posted by excuse me miss, but uh... View Post
11/f/n.korea
Priceless.

Last edited by o0_Sithid_0o; 08-27-2007 at 03:13 PM.
o0_Sithid_0o is offline   Reply With Quote
Old 08-27-2007, 06:17 PM   #7 (permalink)
Master of the Internet
 
TMSTKSBK's Avatar
 
Join Date: Feb 2004
Location: NC/NC State Univ
Age: 23
Posts: 16,424
Default

Aha.

Yes, that would help.

OK.

Here's a tide-me-over:

Basically, if you look at the example I included, there're references to the TestSkin class. Now, if this was a system, you would pass around TestSkin objects. E.g.:

Code:
public class TestGump
{
public TestGump( TestSkin skin, ...)
{
}
}
Then, when you're setting up the stuff on the gump, use values you added into your skin object to position stuff. This requires a little bit of forethought. Sit down and think about all the things in one of your system's gumps. Buttons, windows, text strings, text positions, graphics, graphic positions, gump positions, text entry positions, text entry backgrounds, checkboxes, checkbox graphics, radio buttons and their graphics and so on.

Basically, if you can quantify something about a portion of your gump, do so.

Generally you want to know a few things:

Gump Position On Screen (X & Y),
Position of Object On Gump (X & Y),
Hue (if applicable),
Graphic ID (if applicable),
Overlay or Background (if any),
Font Type (if applicable),
Item ID (if applicable).

Compile this list about anything you can think to compile it about. You can use the WindowInfo and ButtonInfo structs to hold information about sub-gump boxes and buttons/checkboxes/radio buttons, respectively.

Once you have all those variables listed, you can use the skin object you made to position things; i.e.:

Code:
WindowInfo info = skin.WindowInfo["main"];
this.AddBackground(info.X, info.Y, info.bgID);
Use the skin's information to position, color, and add graphics to your gumps. When you do this, you can use the reload commands to easily update your gumps.
__________________
Goodbye, folks.
TMSTKSBK is offline   Reply With Quote
Old 08-27-2007, 06:38 PM   #8 (permalink)
Forum Expert
 
o0_Sithid_0o's Avatar
 
Join Date: Nov 2004
Location: Hiding his old posts from Daat99.
Age: 22
Posts: 2,322
Send a message via AIM to o0_Sithid_0o Send a message via MSN to o0_Sithid_0o
Default

Quote:
Originally Posted by TMSTKSBK View Post
Aha.

Yes, that would help.

OK.

Here's a tide-me-over:

Basically, if you look at the example I included, there're references to the TestSkin class. Now, if this was a system, you would pass around TestSkin objects. E.g.:

Code:
public class TestGump
{
public TestGump( TestSkin skin, ...)
{
}
}
Then, when you're setting up the stuff on the gump, use values you added into your skin object to position stuff. This requires a little bit of forethought. Sit down and think about all the things in one of your system's gumps. Buttons, windows, text strings, text positions, graphics, graphic positions, gump positions, text entry positions, text entry backgrounds, checkboxes, checkbox graphics, radio buttons and their graphics and so on.

Basically, if you can quantify something about a portion of your gump, do so.

Generally you want to know a few things:

Gump Position On Screen (X & Y),
Position of Object On Gump (X & Y),
Hue (if applicable),
Graphic ID (if applicable),
Overlay or Background (if any),
Font Type (if applicable),
Item ID (if applicable).

Compile this list about anything you can think to compile it about. You can use the WindowInfo and ButtonInfo structs to hold information about sub-gump boxes and buttons/checkboxes/radio buttons, respectively.

Once you have all those variables listed, you can use the skin object you made to position things; i.e.:

Code:
WindowInfo info = skin.WindowInfo["main"];
this.AddBackground(info.X, info.Y, info.bgID);
Use the skin's information to position, color, and add graphics to your gumps. When you do this, you can use the reload commands to easily update your gumps.
Ah, somewhat what I thought I was just going about it wrong. Ill mess with this again after I sleep ... after work ... when ive not been awake for 30 hours. Lol.
__________________

Quote:
Originally Posted by Radwen View Post
Give me a reason... to like you.
Quote:
Originally Posted by excuse me miss, but uh... View Post
11/f/n.korea
Priceless.
o0_Sithid_0o is offline   Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off



Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 RC5