1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Workaround for playermobile edit?

Discussion in 'Script Support' started by Ravenwolfe, Jan 24, 2014.

  1. Ravenwolfe
    Offline

    Moderator ServUO Developer

    Joined:
    Sep 7, 2013
    Messages:
    1,147
    Likes Received:
    123
    Publish Number:
    54
    Ok, was working on a custom power hour system and got it working just like I want. Only thing that is bugging me is I can't find a way around a playermobile edit. I feel like there should be a way and that I'm missing something so I'm reaching out for fresh minds!

    Basically a player can activate their power hour by using the Context Menu from playermobile. This forced me to make this small change to playermobile:

    Code (C#):
    1. public override void GetContextMenuEntries(Mobile from, List<ContextMenuEntry> list)
    2.         {
    3.             base.GetContextMenuEntries(from, list);
    4.  
    5.             if (from == this)
    6.             {
    7.                 list.Add(new PowerHour(from) );
    8.              
    9.                 if (m_Quest != null)
    10.                 {
    11.                     m_Quest.GetContextMenuEntries(list);
    12.                 }
    13.  
    Granted, its a very small edit, but I was really hoping to make it drag and drop.

    The problem is, I can't find anyway to override this method from my powerhour script. The powerhour script bases ContextMenuEntry and therefore can not override the method in any way that I can find (No suitable method found to override error). Any ideas or am I stuck with the playermobile edit?
     
  2. Kalamus
    Offline

    Kalamus Active Member

    Joined:
    Apr 24, 2013
    Messages:
    282
    Likes Received:
    32
    Not sure this would be possible. What PlayerMobile needs is a AddCustomContextEntries() method like BaseCreature has that would allow just what you want but without something like that you need the edit in PlayerMobile. Good suggestion for an edit to be added to ServUO :)
     
    • Agree Agree x 1
  3. Ravenwolfe
    Offline

    Moderator ServUO Developer

    Joined:
    Sep 7, 2013
    Messages:
    1,147
    Likes Received:
    123
    Yeah, I also created it with a command, which does not require a playermobile edit, but I hate adding more and more player commands.
     
Similar Threads: Workaround playermobile
Forum Title Date
Script Support Need help with PlayerMobile Oct 8, 2017
Script Support Isolating Spell damage vs other types in PlayerMobile Aug 18, 2017
Archived Bug Reports Siege Mode: patched playermobile.cs bugged Aug 6, 2017
Script Support Playermobile problem May 25, 2017
Script Support FS-Taming & playermobile May 14, 2017
ServUO Discussion How to delete playermobile with account == null Mar 8, 2017
Script Support Adding new variable to PlayerMobile.cs Feb 18, 2017