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!

Player Toolbar

Foster

Account Terminated
Here is a script that was put together by my Developer, Basically this is just a Mod of joeku's Toolbar which players have control over in-game.
I take no credit for this, And am simply giving to you with his permission.
This is very easy to customize to suit your shard just find this line and edit as follows:

publicstatic List<string> DefaultEntries( int i
)
{
List<string> entries = new List<string
>(); switch(i
)
{
case 0:
// Player entries.Add("[GetPet"); entries.Add("[MyStats"); entries.Add("[MyHouses"); entries.Add("[CheckPoints"); entries.Add("[Challenge"); entries.Add("[TopPlayers"
); break
;

Obviously you have to have the apropriate systems in your shard to be able to list them "Above"

Install:

Simply replace Toolbar.cs with existing and restart server.

*Oops i new there was something*
Thanks Pr3d13
 

Attachments

  • Toolbar.cs
    33.7 KB · Views: 176

migzilla

Sorceror
I had this on a shard a couple years ago and players liked it a lot. Only downside came when players were able to crash the shard at will by quickly using the toolbar and certain spells on command. This was on a 2.0 RC1 shard using druid spells, just to forewarn you that it could happen.
 

datguy

Sorceror
To avoid crashes you could insert a bit & see if it works as I remember
just after
public override void OnResponse(NetState sender, RelayInfo info)
{
Mobile mob = sender.Mobile;
add
Code:
            int buttonid = info.ButtonID;
            if (buttonid < 0)
            {
                //Console.WriteLine("Toolbar Command tried but failed to Crash server!!-- Buttonid < 0");
                //mob.SendMessage("Invalid option.  Please try again.");
                return;
            }
And in text TextRelay GetEntry change
if( gump.TextRelays.EntryID == entryID )
{
temp = i;
relay = gump.TextRelays;
}
to
Code:
                if( gump.TextRelays[i].EntryID == entryID )
                {
                    temp = i;
                    //Added Jan 14, 2008 due to an index out of bounds crash on the following line
                    temp = Math.Min( gump.TextRelays.Count - 1, Math.Max( 0, temp ) );
                    relay = gump.TextRelays[ temp ];
                    break;
                }
 

AlphaDragon

Sorceror
Since this is the most recent update or info on the

Joeku Toolbar

Here is a little change I made to it.

Problem: When you go to customize a house the toolbar would dissapear. To get the toolbar back you would have to type the command to call the toolbar back on.
I changed a part of the code to make it so that if the toolbar was locked, when you went to customize a house it would not close the tool bar. Not that you may want it, but just a thought. ;)

Mod:
Code:
//original
//            if( Lock )
//                Closable = false;
//I moded so that will remain even when editing house
            if( Lock )
            {
                Closable = false;
                Disposable = false;
            }
//I moded end so that will remain even when editing house
 
Hmm, had the crashing issue myself today, but I can't tell if it was the same one (clicking buttons fast)

Exception:
System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.ThrowHelper.ThrowArgumentOutOfRangeException()
at System.Collections.Generic.List`1.get_Item(Int32 index)
at Joeku.PlayerToolbar.OnResponse(NetState sender, RelayInfo info)
at Server.Network.PacketHandlers.DisplayGumpResponse(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)
 

john burns

Sorceror
Am I assuming correctly that my staff AND my players can both use this toolbar?
If so, I can remember many times in a couple of shards in which I wished for this.
 

Phr3d13

Sorceror
Am I assuming correctly that my staff AND my players can both use this toolbar?
If so, I can remember many times in a couple of shards in which I wished for this.
that is exactly what it is, just make sure you edit the player defaults to match your shard
 

Konstantine

Squire
Indeed, the crashing happened twice AFTER the fix was added, hehe

And yes still crashes even after Datguys code.


EDIT: Only crashes on staff log in, players are fine

To be Exact.

System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index
at System.Collections.Generic.List`1.get_Item(Int32 index)
at Joeku.Toolbar..ctor(ToolbarInfo info) in

Misc\Toolbar.cs:line 414
at Joeku.ToolbarHelper.SendToolbar(Mobile mob) in
Misc\Toolbar.cs:line 64
at Joeku.ToolbarHelper.OnLogin(LoginEventArgs e) in

Misc\Toolbar.cs:line 45
at Server.LoginEventHandler.Invoke(LoginEventArgs e)
at Server.Network.PacketHandlers.DoLogin(NetState state, Mobile m) in Core\Network\PacketHandlers.cs:line 2071
at Server.Network.PacketHandlers.LoginTimer.OnTick() in

Core\Network\PacketHandlers.cs:line 1941
Core\Timer.cs:line 387
at Server.Core.Main(String[] args) in Core\Main.cs:line 528
 
quick guesses based on the crash report and the code: you somehow seem to get the dimensions to be not initialized(thats the only thing indexed in the toolbar constructor), how I dont understand.
If something funny happens with the player access levels then this could happen. (the dimensions only get added if the player has one of the types (around line 379)) you might get a better understanding if you put a few prints there, or put a default in that construct such that Dimensions[0] & [1] always are created.
(And something strange can happen at initial server startup (I had my houses disappear while i\m owner... should be impossible but at startup it seemed to do something funny)
 
Top