|
||
|
|||||||
| Network Modifications This forum is for modifications to the networking code of RunUO |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#1 (permalink) |
|
Forum Expert
Join Date: May 2005
Age: 29
Posts: 949
|
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;
Code:
RegisterEncoded( 0x32, true, new OnEncodedPacketReceive( QuestGumpRequest ) );
...
public static void QuestGumpRequest( NetState state, IEntity e, EncodedReader reader )
{
EventSink.InvokeQuestGumpRequest( new QuestGumpRequestArgs( state.Mobile ) );
}
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.
}
}
}
|
|
|
|
|
|
#2 (permalink) |
|
Administrator
Join Date: Aug 2002
Location: Baltimore, MD
Age: 25
Posts: 4,845
|
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 |
|
|
|
|
|
#4 (permalink) |
|
Forum Expert
Join Date: May 2005
Age: 29
Posts: 949
|
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
}
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|