RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

Gump Studio 1.8 Released!

Bradley

Sorceror
Gump Studio 1.8 Released!

You can download version 1.8 from www.gumpstudio.com. This version includes a new RunUO export plugin written by Roadmaster:cool:.

Enjoy! Hopefully 1.9 won't take 3 more years. Thanks go out to everyone who enjoys using Gump Studio.

Here are the changes from 1.7.

1/15/08 - version 1.8
- Resize handles are now properly aligned.
- Fixed exception caused when multiple of the same type of elements are selected that have different hues where there is no active element.
- Compiled under the .NET 2.0 Framework.
- Snap To Grid plugin drawing code has been optimized.
- Added the ability to manually set the client data file path.
- Support for ML artwork.
- Added acceleration for nudging elements with the arrow key, the longer you hold the arrow the faster the element will slide.
- Sliding an element using arrows no longer creates an undo point for every step moved, the undo point is now created on the release of the arrow key.
- Elements should now be serializing and deserializing properly (no more properties reverting back to default on loading).
- Some missing properties have been added to elements.
- Cropped labels are now supported (set Cropped=True on a a label, and edit its size). It is still up to script export plugins to actually render them though.
- Scrollbar on art browser is now properly alligned.
- The selection box for selected but not active elements has had a color change to be more visible.
- The Active Element can now be deselected by ctrl-clicking it, jsut like other Selected but not Active elements.
- The main form now remembers its size between runs.
- The bug with Groups within Groups drawing at the wrong position has been fixed. Feel free to nest groups to whatever depth you want now.
- The Large Text Property Editor now allows New Lines with just the enter key, instead of ctrl-enter.
- Image / Repeating Elements no longer default to ImageID 0 when created... someone decided to put a big-ass picture there so I picked a better starting ID.
 

Bradley

Sorceror
Roadmaster asked me to post this changelog for the updated RunUO exporter plugin.

bug# 1: RadioButtons showing as Checkboxes. this was caused by checkboxes actually
being placed instead of RadioButtons. Fixed 01-12-08 -roadmaster

bug# 2: The RadioButton was missing its "Checked" bool property argument, but since
checkboxes were being placed it was only noticed that the "AddCheck" should
have been "AddRadio". Fixed 01-12-08 -roadmaster

bug# 3: The "AddItem" code was incorrectly displayed as "AddImage", minor oversight.
Fixed 01-12-08 -roadmaster

Enhancement# 1: Added overload for AddTextEntry to allow for the "int size" argument.
Enhancement# 2: Added code to overload the Gump Constructor to allow for a Mobile
argument being passed in. The Gump will work for either way now
you can call it with a Mobile argument or without a Mobile argument.
Enhancement# 3: Added OnResponse Method with switch(statment).
Enhancement# 4: Added some default code for use with AddTextEntry ie...
[TextRelay entry = info.GetTextEntry(0)]. Whatever value you
assign in the ID Property inside GumpStudio will be automatically
set up in your script. You just have to tell it what you want to
do with the string.
Enhancement# 5: Added overload for AddItem, now allows for the "Item.Hue" argument.
Enhancement# 6: Added overload for AddImage, now allows for the "Image.Hue" argument.

Change# 1: changing Button case style enums to give you a choice which you want to use
case (int)Buttons.Whatever: style or case 1: style. A case number will
automatically be generated anytime you have a Reply Button.

there may be other things I have done but forgot to write down.

ToDo::

1. Pull code from the button code property and place it in the case for that button.
2. Provide default code to work with the Checkboxes.
3. Provide default code to work with the radio buttons.

and whatever else I can come up with.
 

roadmaster

Sorceror
After reading your post I remembered I never set up the Exporter for the cropped labels.:( Ill move that up on my ToDo:: list.;)
 

Daanonkerr

Wanderer
Newb Question Alert!

Gump = Program that tells an item how to be that item? So when I lay down a spawn generator and open the properties window that window is a gump. Is that right?

So I would use this to build a custom thingy for the shard? Will this help me to set up a NPC Quest?
 

Bradley

Sorceror
Daanonkerr;734978 said:
Newb Question Alert!

Gump = Program that tells an item how to be that item? So when I lay down a spawn generator and open the properties window that window is a gump. Is that right?

So I would use this to build a custom thingy for the shard? Will this help me to set up a NPC Quest?

Gump is short of "Graphical User Menu Program". It's the way UO displays windows and menus with buttons. The "windows" that pops up when you do many things in UO are called gumps. The contains buttons, places to enter text, images, html text, and many other controls. Gump Studio allows you to visually lay out these pieces and, with teh help of a plugin, generate the script needed to display the Gump to a UO client on an Emulator.
 

roadmaster

Sorceror
Just so everyone knows Im still working on the exporter, so hopefully sometime within the next week I'll have an update for it.:)
 
A suggestion: can you put a new properties for each "item" (i mean for label,image,tile...etc) called "comment"?It will be useful when we are going to create dynamic gumps (which changes based on some other values) and we don't remember how that "item" will be dinamically changed

In our export programs we can also use it to add at the end of the line something like

Code:
//My comment

Thanks !
 

roadmaster

Sorceror
Fire-Dragon-DoL;736284 said:
A suggestion: can you put a new properties for each "item" (i mean for label,image,tile...etc) called "comment"?It will be useful when we are going to create dynamic gumps (which changes based on some other values) and we don't remember how that "item" will be dinamically changed

In our export programs we can also use it to add at the end of the line something like

Code:
//My comment

Thanks !

Are you refering to being able to export your comments something like this:
this is a full script, scroll down to the checkboxes and radio buttons for the comments.

Code:
///////////////////////////////////////////////////////////////////////
// Automatically generated by Bradley's GumpStudio and roadmaster's  //
// RunUo_Exporter.dll,  Special thanks goes to Daegon whose work the //
// exporter was based off of, and Shadow wolf for his Template Idea. //
//    ***   Bradley who taught me how to work on plugins   ***       //
///////////////////////////////////////////////////////////////////////
#define RunUo2_0

using System;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Commands;

namespace Server.Gumps
{
    public class cMyTestScript : Gump
    {
        Mobile caller;
        
        public static void Initialize()
        {
#if(RunUo2_0)
            CommandSystem.Register("TestScript", AccessLevel.Administrator, new CommandEventHandler(TestScript_OnCommand));
#else
            Register("TestScript", AccessLevel.Administrator, new CommandEventHandler(TestScript_OnCommand));
#endif
        }

        [Usage("TestScript")]
        [Description("Makes a call to your custom gump.")]
        public static void TestScript_OnCommand(CommandEventArgs e)
        {
            Mobile from = e.Mobile;

            if (from.HasGump(typeof(cMyTestScript)))
                from.CloseGump(typeof(cMyTestScript));
            from.SendGump(new cMyTestScript(from));
        }

        public cMyTestScript(Mobile from) : this()
        {
            caller = from;
        }

        public cMyTestScript() : base( 50, 50 )
        {
            this.Closable = true;
            this.Disposable = true;
            this.Dragable = true;
            this.Resizable = true;

            AddPage(0);
            AddBackground(24, 29, 453, 371, 9200);
            AddBackground(43, 47, 140, 87, 9200);
            AddLabel(74, 58, 62, @"Radio Button 0");
            AddLabel(74, 81, 62, @"Radio Button 1");
            AddLabel(74, 103, 62, @"Radio Button 2");
            AddBackground(43, 150, 140, 98, 9200);
            AddLabel(77, 161, 254, @"Checkbox 0");
            AddLabel(77, 188, 254, @"Checkbox 1");
            AddLabel(77, 216, 254, @"Checkbox 2");
            AddLabel(257, 37, 178, @"roadmaster's abode");
            AddImage(418, 45, 112);
            AddImage(38, 296, 113, 2837);
            AddImageTiled(76, 310, 338, 18, 30089);
            AddItem(424, 265, 3804, 452);
            AddItem(190, 63, 2599);
            AddTextEntry(234, 66, 200, 20, 88, 1, @"Test Text Entry number 1");
            AddButton(106, 279, 4005, 4006, (int)Buttons.Generate, GumpButtonType.Reply, 0);//600
            AddHtml( 201, 115, 253, 107, @"This is a Test Html text entry designed solely to test out the flexibility of the RunUo Exporter as it relates to the processing of Gump Scripts into RunUo's C# Script format.", (bool)true, (bool)true);
            AddTextEntry(235, 232, 201, 20, 17, 0, @"Test Text Entry number 0", 12);
            //checkbox for TextEntry0, group 4
            AddCheck(203, 233, 210, 211, false, (int)eSwitches.TextEntry0);//500
            AddLabel(157, 279, 133, @"Process these Control switches");
            AddLabel(68, 343, 43, @"Radio Button 4 group 1");
            AddLabel(68, 368, 43, @"Radio Button 5 group 1");
            AddLabel(295, 343, 43, @"Radio Button 6 group 2");
            AddLabel(295, 368, 43, @"Radio Button 7 group 2");
            //radio button 0
            AddRadio(49, 58, 209, 208, false, (int)eSwitches.RadioButton0);//100
            //radio button 1
            AddRadio(49, 81, 209, 208, false, (int)eSwitches.RadioButton1);//101
            //radio button 2
            AddRadio(49, 103, 209, 208, false, (int)eSwitches.RadioButton2);//102
            //checkbox 0 comments ??? Serialize?
            AddCheck(51, 160, 210, 211, false, (int)eSwitches.Checkbox0);//200
            //checkbox 1 comments ???
            AddCheck(51, 188, 210, 211, false, (int)eSwitches.Checkbox1);//201
            //checkbox 2 comments???
            AddCheck(51, 217, 210, 211, false, (int)eSwitches.Checkbox2);//202
            //radio button 3, group 1
            AddRadio(42, 343, 209, 208, false, (int)eSwitches.RadioButton3);//300
            //radio button 4, group 1
            AddRadio(42, 368, 209, 208, false, (int)eSwitches.RadioButton4);//301
            //radio button 5, group 2
            AddRadio(267, 343, 209, 208, false, (int)eSwitches.RadioButton5);//400
            //radio button 6, group 2
            AddRadio(267, 368, 209, 208, false, (int)eSwitches.RadioButton6);//401
        }
        
        public enum Buttons
        {
            DefaultCancel,//this is a default Cancel case Do Not Modify unless you know what you are doing.
            Generate,
        }
        public enum eSwitches
        {
            TextEntry0,
            RadioButton0,
            RadioButton1,
            RadioButton2,
            Checkbox0,
            Checkbox1,
            Checkbox2,
            RadioButton3,
            RadioButton4,
            RadioButton5,
            RadioButton6,
        }

        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            TextRelay entry1 = info.GetTextEntry(1);
            string text1 = (entry1 == null ? "" : entry1.Text.Trim());

            TextRelay entry0 = info.GetTextEntry(0);
            string text0 = (entry0 == null ? "" : entry0.Text.Trim());
/*  Add this {for loop} inside the case statement for the GumpButtonType.Reply Button
    that you want to use to accept the info for your Checkboxes and RadioButtons.

for (int i = 0; i < info.Switches.Length; i++)
{
    int m = info.Switches[i];
    switch (m)
    {
        
        case (int)eSwitches.TextEntry0:
        {
            // add code here to be processed in the event that this case is selected.
            break;
        }
        case (int)eSwitches.RadioButton0:
        {
            // add code here to be processed in the event that this case is selected.
            break;
        }
        case (int)eSwitches.RadioButton1:
        {
            // add code here to be processed in the event that this case is selected.
            break;
        }
        case (int)eSwitches.RadioButton2:
        {
            // add code here to be processed in the event that this case is selected.
            break;
        }
        case (int)eSwitches.Checkbox0:
        {
            // add code here to be processed in the event that this case is selected.
            break;
        }
        case (int)eSwitches.Checkbox1:
        {
            // add code here to be processed in the event that this case is selected.
            break;
        }
        case (int)eSwitches.Checkbox2:
        {
            // add code here to be processed in the event that this case is selected.
            break;
        }
        case (int)eSwitches.RadioButton3:
        {
            // add code here to be processed in the event that this case is selected.
            break;
        }
        case (int)eSwitches.RadioButton4:
        {
            // add code here to be processed in the event that this case is selected.
            break;
        }
        case (int)eSwitches.RadioButton5:
         {
            // add code here to be processed in the event that this case is selected.
            break;
        }
        case (int)eSwitches.RadioButton6:
         {
             // add code here to be processed in the event that this case is selected.
            break;
        }
    }
}*/

            switch(info.ButtonID)
            {
                case 0:// Cancel/Quit
                {

                    return;
                }
                case (int)Buttons.Generate://
                {
					
                     break;
                }
            }
        }
    }
}

the above is a script which was exported using a current (unreleased)version of the exporter. I made no modifications to it, this is how it came out. This is a Enum Style version.

are the comments // before the checkbox and radio Add lines and at the end of the checkbox and radio Add lines kinda what you were thinking of?

** Edit **

after moving the switches case loop into the Generate button and adding Console.Writeline statements, it looks like this:

Code:
///////////////////////////////////////////////////////////////////////
// Automatically generated by Bradley's GumpStudio and roadmaster's  //
// RunUo_Exporter.dll,  Special thanks goes to Daegon whose work the //
// exporter was based off of, and Shadow wolf for his Template Idea. //
//    ***   Bradley who taught me how to work on plugins   ***       //
///////////////////////////////////////////////////////////////////////
#define RunUo2_0

using System;
using Server;
using Server.Gumps;
using Server.Network;
using Server.Commands;

namespace Server.Gumps
{
    public class cMyTestScript : Gump
    {
        Mobile caller;
        
        public static void Initialize()
        {
#if(RunUo2_0)
            CommandSystem.Register("TestScript", AccessLevel.Administrator, new CommandEventHandler(TestScript_OnCommand));
#else
            Register("TestScript", AccessLevel.Administrator, new CommandEventHandler(TestScript_OnCommand));
#endif
        }

        [Usage("TestScript")]
        [Description("Makes a call to your custom gump.")]
        public static void TestScript_OnCommand(CommandEventArgs e)
        {
            Mobile from = e.Mobile;

            if (from.HasGump(typeof(cMyTestScript)))
                from.CloseGump(typeof(cMyTestScript));
            from.SendGump(new cMyTestScript(from));
        }

        public cMyTestScript(Mobile from) : this()
        {
            caller = from;
        }

        public cMyTestScript() : base( 50, 50 )
        {
            this.Closable = true;
			this.Disposable = true;
			this.Dragable = true;
			this.Resizable = true;

			AddPage(0);
			AddBackground(24, 29, 453, 371, 9200);
			AddBackground(43, 47, 140, 87, 9200);
			AddLabel(74, 58, 62, @"Radio Button 0");
			AddLabel(74, 81, 62, @"Radio Button 1");
			AddLabel(74, 103, 62, @"Radio Button 2");
			AddBackground(43, 150, 140, 98, 9200);
			AddLabel(77, 161, 254, @"Checkbox 0");
			AddLabel(77, 188, 254, @"Checkbox 1");
			AddLabel(77, 216, 254, @"Checkbox 2");
			AddLabel(257, 37, 178, @"roadmaster's abode");
			AddImage(418, 45, 112);
			AddImage(38, 296, 113, 2837);
			AddImageTiled(76, 310, 338, 18, 30089);
			AddItem(424, 265, 3804, 452);
			AddItem(190, 63, 2599);
			AddTextEntry(234, 66, 200, 20, 88, 1, @"Test Text Entry number 1");
			AddButton(106, 279, 4005, 4006, (int)Buttons.Generate, GumpButtonType.Reply, 0);//600
			AddHtml( 201, 115, 253, 107, @"This is a Test Html text entry designed solely to test out the flexibility of the RunUo Exporter as it relates to the processing of Gump Scripts into RunUo's C# Script format.", (bool)true, (bool)true);
			AddTextEntry(235, 232, 201, 20, 17, 0, @"Test Text Entry number 0", 12);
			//checkbox for TextEntry0, group 4
			AddCheck(203, 233, 210, 211, false, (int)eSwitches.TextEntry0);//500
			AddLabel(157, 279, 133, @"Process these Control switches");
			AddLabel(68, 343, 43, @"Radio Button 4 group 1");
			AddLabel(68, 368, 43, @"Radio Button 5 group 1");
			AddLabel(295, 343, 43, @"Radio Button 6 group 2");
			AddLabel(295, 368, 43, @"Radio Button 7 group 2");
			//radio button 0
			AddRadio(49, 58, 209, 208, false, (int)eSwitches.RadioButton0);//100
			//radio button 1
			AddRadio(49, 81, 209, 208, false, (int)eSwitches.RadioButton1);//101
			//radio button 2
			AddRadio(49, 103, 209, 208, false, (int)eSwitches.RadioButton2);//102
			//checkbox 0 comments ??? Serialize?
			AddCheck(51, 160, 210, 211, false, (int)eSwitches.Checkbox0);//200
			//checkbox 1 comments ???
			AddCheck(51, 188, 210, 211, false, (int)eSwitches.Checkbox1);//201
			//checkbox 2 comments???
			AddCheck(51, 217, 210, 211, false, (int)eSwitches.Checkbox2);//202
			//radio button 3, group 1
			AddRadio(42, 343, 209, 208, false, (int)eSwitches.RadioButton3);//300
			//radio button 4, group 1
			AddRadio(42, 368, 209, 208, false, (int)eSwitches.RadioButton4);//301
			//radio button 5, group 2
			AddRadio(267, 343, 209, 208, false, (int)eSwitches.RadioButton5);//400
			//radio button 6, group 2
			AddRadio(267, 368, 209, 208, false, (int)eSwitches.RadioButton6);//401
        }
        
		public enum Buttons
		{
			DefaultCancel,//this is a default Cancel case Do Not Modify unless you know what you are doing.
			Generate,
		}
		public enum eSwitches
		{
			TextEntry0,
			RadioButton0,
			RadioButton1,
			RadioButton2,
			Checkbox0,
			Checkbox1,
			Checkbox2,
			RadioButton3,
			RadioButton4,
			RadioButton5,
			RadioButton6,
		}

        public override void OnResponse(NetState sender, RelayInfo info)
        {
            Mobile from = sender.Mobile;

            TextRelay entry1 = info.GetTextEntry(1);
			string text1 = (entry1 == null ? "" : entry1.Text.Trim());

			TextRelay entry0 = info.GetTextEntry(0);
			string text0 = (entry0 == null ? "" : entry0.Text.Trim());

            switch(info.ButtonID)
            {
                case 0:// Cancel/Quit
                {

                    return;
                }
                case (int)Buttons.Generate://
				{
                    for (int i = 0; i < info.Switches.Length; i++)
                    {
                        int m = info.Switches[i];
                        switch (m)
                        {

                            case (int)eSwitches.TextEntry0:
                                {
                                    Console.WriteLine("eSwitches.TextEntry0");
                                    // add code here to be processed in the event that this case is selected.
                                    break;
                                }
                            case (int)eSwitches.RadioButton0:
                                {
                                    Console.WriteLine("eSwitches.RadioButton0");
                                    // add code here to be processed in the event that this case is selected.
                                    break;
                                }
                            case (int)eSwitches.RadioButton1:
                                {
                                    Console.WriteLine("eSwitches.RadioButton1");
                                    // add code here to be processed in the event that this case is selected.
                                    break;
                                }
                            case (int)eSwitches.RadioButton2:
                                {
                                    Console.WriteLine("eSwitches.RadioButton2");
                                    // add code here to be processed in the event that this case is selected.
                                    break;
                                }
                            case (int)eSwitches.Checkbox0:
                                {
                                    Console.WriteLine("eSwitches.Checkbox0");
                                    // add code here to be processed in the event that this case is selected.
                                    break;
                                }
                            case (int)eSwitches.Checkbox1:
                                {
                                    Console.WriteLine("eSwitches.Checkbox1");
                                    // add code here to be processed in the event that this case is selected.
                                    break;
                                }
                            case (int)eSwitches.Checkbox2:
                                {
                                    Console.WriteLine("eSwitches.Checkbox2");
                                    // add code here to be processed in the event that this case is selected.
                                    break;
                                }
                            case (int)eSwitches.RadioButton3:
                                {
                                    Console.WriteLine("eSwitches.RadioButton3");
                                    // add code here to be processed in the event that this case is selected.
                                    break;
                                }
                            case (int)eSwitches.RadioButton4:
                                {
                                    Console.WriteLine("eSwitches.RadioButton4");
                                    // add code here to be processed in the event that this case is selected.
                                    break;
                                }
                            case (int)eSwitches.RadioButton5:
                                {
                                    Console.WriteLine("eSwitches.RadioButton5");
                                    // add code here to be processed in the event that this case is selected.
                                    break;
                                }
                            case (int)eSwitches.RadioButton6:
                                {
                                    Console.WriteLine("eSwitches.RadioButton6");
                                    // add code here to be processed in the event that this case is selected.
                                    break;
                                }
                        }
                    }
					break;
				}
            }
        }
    }
}
well minus the indentation/formatting glitch:)

also attached is a screenshot of the gump in GS before exporting.
 

Attachments

  • GS_RuOExport_Comments.bmp
    1.8 MB · Views: 97
Yes however i'm a sphere scripter...i can modify the sphere exporter, however i need a "gump studio property for each item called "comment" as in your example..
 

Bradley

Sorceror
Fire-Dragon-DoL;736420 said:
Yes however i'm a sphere scripter...i can modify the sphere exporter, however i need a "gump studio property for each item called "comment" as in your example..

I'll add this to the list. You can expect it in the next version.
 
Bradley;736448 said:
I'll add this to the list. You can expect it in the next version.

thanks a lot...

i normally do gumps by testing them...it tooks whole day to do "simple gumps" (well scripted, however) but with a bad graphic...and i'm bored to see bad graphic in uo...it can be done better ;)

Now i'm happy to do new graphic to my gumps :D
 

~Vlad~

Wanderer
Hi there.

Just noticed that the Import feature doesn't seem to recognise AddImageTiled or AddAlphaRegion.
 
Feature-not necessary-request:

If possible, a way to export "an image" of what are we watching inside the black part of the gump editor (where we placed images)...would be better then doing screen shot each time, however it's really not necessary
 

RavonTUS

Sorceror
Greetings,

I have a suggestion/feature request. I would like to use Gump Studio to replace InsideUO, when I am looking for art work for scripts and stuff.

So, in the Static Art Browser, could you add both the HEX and ID number to that screen when scrolling through it.

-Ravon
 
RavonTUS;738557 said:
Greetings,

I have a suggestion/feature request. I would like to use Gump Studio to replace InsideUO, when I am looking for art work for scripts and stuff.

So, in the Static Art Browser, could you add both the HEX and ID number to that screen when scrolling through it.

-Ravon

yeah gump studio it's less laggous than inside uo...dunno why, probably better cache usage...
 

roadmaster

Sorceror
~Vlad~;738440 said:
Hi there.

Just noticed that the Import feature doesn't seem to recognise AddImageTiled or AddAlphaRegion.

if you open up your gump .cs script does it show multiple entries for those? ie...

AddAlphaRegion(48, 54, 137, 71);AddAlphaRegion(48, 54, 137, 71);

or does it show a single entry?

AddAlphaRegion(48, 54, 137, 71);
 
Top