|
||
|
|||||||
| General Discussion General discussion for the RunUO community, all off-topic posts will be deleted. This forum is NOT FOR SUPPORT! |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Master of the Internet
Join Date: Feb 2004
Location: NC/NC State Univ
Age: 23
Posts: 16,424
|
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
__________________
Goodbye, folks. |
|
|
|
|
|
#6 (permalink) |
|
Forum Expert
|
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*
__________________
Last edited by o0_Sithid_0o; 08-27-2007 at 03:13 PM. |
|
|
|
|
|
#7 (permalink) |
|
Master of the Internet
Join Date: Feb 2004
Location: NC/NC State Univ
Age: 23
Posts: 16,424
|
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, ...)
{
}
}
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);
__________________
Goodbye, folks. |
|
|
|
|
|
#8 (permalink) | |
|
Forum Expert
|
Quote:
|
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|