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,163
    Likes Received:
    130
    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:
    288
    Likes Received:
    33
    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,163
    Likes Received:
    130
    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 Looking for a workaround to dupe non 0 parameter items Apr 12, 2018
Script Support need help to conver my atual playermobile to the svn one Apr 25, 2018
Script Support Is it possible to make a playermobile ''flee''? like mmorpg Fear spells Feb 11, 2018
Script Support PlayerMobile OnMoveOver issue Jan 22, 2018
Script Support Using PlayerMobile instead of BaseCreature for NPC Oct 31, 2017
Script Support Need help with PlayerMobile Oct 8, 2017
Script Support Isolating Spell damage vs other types in PlayerMobile Aug 18, 2017