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

Fixed Toolbar

Discussion in 'Archived Bug Reports' started by Ravenwolfe, Oct 7, 2013.

  1. Ravenwolfe
    Offline

    Moderator ServUO Developer

    Joined:
    Sep 7, 2013
    Messages:
    1,155
    Likes Received:
    125
    Hey, was playing around with the Toolbar and noticed a few issues.

    1. The buttons to set the number of Columns and Rows work backward.
    2. The check boxes for Phantom and Lock are not working properly (probably not the other 2 either but I forget what they are.

    I can fix the first one but #2 has me stumped, lol
     
  2. tass23
    Offline

    Moderator

    Joined:
    Aug 28, 2013
    Messages:
    1,014
    Likes Received:
    131
    Raven, I'm not having this issue on my version, however I do know that @Insanity re-worked that or was going to re-work it. Might be something he overlooked, not sure. Just another sorta "I wish it were so" kind of thing: I wish we could expand the column width so we could include longer commands OR have an alias in the toolbar for a much longer command.
     
  3. Insanity
    Offline

    Insanity Active Member

    Joined:
    Mar 2, 2013
    Messages:
    276
    Likes Received:
    61
    What version of ServUO are you using? Those issues were fixed a while back. I remember these bugs well, because they were some of the last issues I fixed for the Toolbar rewrite. Try doing a pull from the repo to update your end, let me know if that fixes it.
     
  4. Ravenwolfe
    Offline

    Moderator ServUO Developer

    Joined:
    Sep 7, 2013
    Messages:
    1,155
    Likes Received:
    125
    I have publish 51. I will try a pull.
    --- Double Post Merged, Oct 8, 2013, Original Post Date: Oct 8, 2013 ---
    I did a completely fresh download and install. When I click the checkmark to turn off the lock and then hit apply, it checks the box again. Same with Phantom.
     
  5. Ravenwolfe
    Offline

    Moderator ServUO Developer

    Joined:
    Sep 7, 2013
    Messages:
    1,155
    Likes Received:
    125
    I'm thinking the problem might be here in ToolbarInfo.cs:

    Code (C#):
    1. public static ToolbarInfo CreateNew(Mobile from)
    2.         {
    3.             Point2D dimensions = DefaultDimensions(from.AccessLevel);
    4.             List<string> entries = DefaultEntries(from.AccessLevel);
    5.             List<Point3D> points = new List<Point3D>();
    6.  
    7.             for (int i = entries.Count; i <= 135; i++)
    8.                 entries.Add("-*UNUSED*-");
    9.  
    10.             return new ToolbarInfo(dimensions, entries, 0, points, 0, new bool[] { true, false, false, true });
    11.         }
    It looks like it is sending a new Toolbarinfo when the method is called and its setting the bool switches instead of calling their state?

    This is just a wild guess, cause I'm not too familiar with the way modules work in the customframework.
    --- Double Post Merged, Oct 8, 2013, Original Post Date: Oct 8, 2013 ---
    Or, from ToolbarEdit, is AnalyzeEntries maybe not catching the switch on the checkmarks and therefore not being passed when the SendGump creates the new toolbar?

    Code (C#):
    1. case 12: // Apply
    2. {
    3. ToolbarModule module = m.GetModule(typeof(ToolbarModule)) as ToolbarModule ?? new ToolbarModule(m);
    4.  
    5.     module.ToolbarInfo.Entries = this.AnalyzeEntries();
    6.  
    7.     if (info.ButtonID == 12)
    8. m.SendGump(new ToolbarEdit(_Info, this.p_Expanded));
    9.  
    10. m.CloseGump(typeof(ToolbarGump));
    11. m.SendGump(new ToolbarGump(module.ToolbarInfo));
    12.  
    13. break;
    14. }
    --- Double Post Merged, Oct 8, 2013 ---
    Ok, my second guess was correct. The values for the switches was not being passed during the AnalyzeEntries. This is the fix: (You can ignore the commented ConsoleLine, that was for debugging)
    Code (C#):
    1. case 12: // Apply
    2. {
    3. ToolbarModule module = m.GetModule(typeof(ToolbarModule)) as ToolbarModule ?? new ToolbarModule(m);
    4.  
    5.     module.ToolbarInfo.Entries = this.AnalyzeEntries();
    6. //module.ToolbarInfo.Entries.ForEach(i => Console.Write("{0}\t", i));
    7. module.ToolbarInfo.Phantom = switches[0];
    8. module.ToolbarInfo.Stealth = switches[1];
    9. module.ToolbarInfo.Reverse = switches[2];
    10. module.ToolbarInfo.Lock = switches[3];
    11.  
    12.     if (info.ButtonID == 12)
    13. m.SendGump(new ToolbarEdit(_Info, this.p_Expanded));
    14.  
    15. m.CloseGump(typeof(ToolbarGump));
    16. m.SendGump(new ToolbarGump(module.ToolbarInfo));
    17.  
    18. break;
    19. }
     
    • Two Thumbs Up Two Thumbs Up x 1
  6. Toriad
    Offline

    Toriad Shard Owner

    Joined:
    Mar 4, 2013
    Messages:
    86
    Likes Received:
    35
    This seems to be working for me running the latest code. I'm going to close this as cannot reproduce, and move it to the archives, however if you can still reproduce the issues in the OP then let me know!
     
  7. Ravenwolfe
    Offline

    Moderator ServUO Developer

    Joined:
    Sep 7, 2013
    Messages:
    1,155
    Likes Received:
    125
    This issue had already been patched. Thanks!

    Publish 54...

    - Fixed issues with Toolbar buttons, cleaned up system code (Ravenwolfe)
     
    #7 Ravenwolfe, Mar 3, 2014
    Last edited: Mar 3, 2014
Similar Threads: Toolbar
Forum Title Date
Script Support ToolBar Service Nov 28, 2017
3rd Party Support Joeku's Command Toolbar binding a new command Nov 18, 2017
Archived Bug Reports Publish 54 Command Toolbar Jul 10, 2016
Archived Bug Reports Toolbar Crash Bug Apr 19, 2016
Script Support Joeku Toolbar Facet Missing Mar 19, 2016
Archived Bug Reports Toolbar gump crash on login Feb 13, 2016
Script Support i want a player toolbar Script . Feb 23, 2015