Go Back   RunUO - Ultima Online Emulation > RunUO > Core Modifications > Network Modifications

Network Modifications This forum is for modifications to the networking code of RunUO

Reply
 
Thread Tools Display Modes
Old 09-02-2005, 05:45 PM   #1 (permalink)
Forum Expert
 
Join Date: May 2005
Age: 29
Posts: 949
Default QuestButton in Paperdoll

The new QuestButton doesn't work, of course, so here's a quick (and probably dirty) fix...

So some things have to be added in...

...EventSink.cs

Code:
public delegate void QuestGumpRequestHandler( QuestGumpRequestArgs e ); 
... 
public class QuestGumpRequestArgs : EventArgs 
{ 
    
   private Mobile m_Mobile; 
       
   public Mobile Mobile { get { return m_Mobile; }} 
       
   public QuestGumpRequestArgs( Mobile mobile ) 
   { 
      m_Mobile = mobile; 
   } 
} 
... 
public static event QuestGumpRequestHandler QuestGumpRequest; 
... 
public static void InvokeQuestGumpRequest( QuestGumpRequestArgs e) 
{ 
   if (QuestGumpRequest != null) 
      QuestGumpRequest( e); 
} 
... (in the Reset()-method): 
QuestGumpRequest = null;
...PacketHandlers.cs

Code:
RegisterEncoded( 0x32, true, new OnEncodedPacketReceive( QuestGumpRequest ) ); 
...       
public static void QuestGumpRequest( NetState state, IEntity e, EncodedReader reader ) 
{ 
   EventSink.InvokeQuestGumpRequest( new QuestGumpRequestArgs( state.Mobile ) ); 
}
That's all.
Now it's possible to create a QuestGump (for example; I would place it in Scripts/Engines/Quests/Core), which could look like this...

Code:
using System; 
using Server; 
using Server.Gumps; 
using Server.Mobiles; 

namespace Server.Engines.Quests 
{ 
   public class QuestGump : Gump 
   { 
      public static void Initialize() 
      { 
         EventSink.QuestGumpRequest += new QuestGumpRequestHandler( EventSink_QuestGumpRequest ); 
      } 

      private static void EventSink_QuestGumpRequest( QuestGumpRequestArgs e ) 
      { 
         foreach ( Gump g in e.Mobile.NetState.Gumps ) 
         { 
            if ( g is QuestGump ) 
               return; 
         } 
         e.Mobile.SendGump( new QuestGump( e.Mobile ) ); 
      } 

      public QuestGump( Mobile from ) : base( 0, 0 ) 
      { 
         // Add your personal Quest-Gump-Code here.
      } 
    
   } 
}
Irian is offline   Reply With Quote
Old 09-03-2005, 12:02 AM   #2 (permalink)
Administrator
 
Zippy's Avatar
 
Join Date: Aug 2002
Location: Baltimore, MD
Age: 25
Posts: 4,845
Default

Very clean fix IMO :-)
__________________
Zippy, Razor Creator and RunUO Core Developer
The RunUO Software Team

"Intuition, like a flash of lightning, lasts only for a second. It generally comes when one is tormented by a difficult decipherment and when one reviews in his mind the fruitless experiments already tried. Suddenly the light breaks through and one finds after a few minutes what previous days of labor were unable to reveal."
~The Cryptonomicon

Zippy is offline   Reply With Quote
Old 09-03-2005, 12:05 PM   #3 (permalink)
UO Hobbyist
 
kirax2's Avatar
 
Join Date: Jul 2004
Age: 32
Posts: 179
Default

Would this work if one wanted to change the functionality of the other buttons on the paperdoll? Say, sending a different skills gump than the one that is currently sent?

Thanks,
-Janice
aka kirax2
kirax2 is offline   Reply With Quote
Old 09-03-2005, 12:42 PM   #4 (permalink)
Forum Expert
 
Join Date: May 2005
Age: 29
Posts: 949
Default

I'm not quite sure, but I think, some buttons just trigger actions in the client itself (like showing the skill-menu) and others just send a request to the server. Of course, for the skill-gump, the client has to ask the server for the skill-data, but the gump itself isn't sent from the server (I think).

So I would say, that you can just change the behavior of the buttons which just send a request to the server and don't do anything on their own (like "Help", "Guild" or "Quest"). So I personally plan to modify the client, change the caption of the "Guild"-Button (because we don't need a guild system) and use the button it to display something else (perhaps data from the extended character-system).

In this case you just would have to use the method from Scripts/Misc/Guild.cs (and delete this method, of course):

Code:
EventSink.GuildGumpRequest += new GuildGumpRequestHandler( EventSink_GuildGumpRequest );
...
public static void EventSink_GuildGumpRequest( GuildGumpRequestArgs args )
{
	// Do something here
}
But of course, I could be wrong :-)
Irian is offline   Reply With Quote
Old 09-04-2005, 09:20 AM   #5 (permalink)
Forum Novice
 
Join Date: Mar 2005
Age: 29
Posts: 226
Send a message via AIM to Noxih
Default

I cant find a eventsink.cs file in my scripts?
Noxih is offline   Reply With Quote
Old 09-04-2005, 09:32 AM   #6 (permalink)
Forum Expert
 
Join Date: May 2005
Age: 29
Posts: 949
Default

Perhaps because this is the "Core Modifications"-Forum? :-) EvenSink.cs is a part of the core, if you want to use the fix, you'll have to download and recompile it.
Irian is offline   Reply With Quote
Old 05-03-2006, 08:53 PM   #7 (permalink)
Account Terminated
 
Join Date: Jan 2006
Posts: 50
Default

has anyone made an osi correct quest gump cus i'm not very good at making gumps
noob2 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