ServUO Version
Publish Unknown
Ultima Expansion
Mondain's Legacy
I have a shard using:
- RunUO Version 2.1, Build 6905.732
- Running on .NET Framework Version 4.0.30319
- Core Optimizing for 4 64-bit processors

For the past week I have been trying to tailor a script that is part of the "Universal Storage Keys - developed by Fenn on Friday, May 1, 2009 (yes I know it is 'old').

I am trying to create a set of sub-menus for Gardeners allowing them to store their seeds according to the Seed's Generation (1, 2, 3, or 4).

I am hoping for some direction on 'Response Button #1. If I can get that one working I can use the solution for the others ('Response Buttons #2, #3 and #4') which are currently commented out.

I'm think it is a syntax problem but I'm dead in the water on it so I hope someone can point me on the right path while I still have a little hair left.

All help is appreciated.

Here are my errors:
Code:
Errors:
 + Customs/Universal Storage Keys/Gumps/ListEntryGump.cs:
    CS0118: Line 433: 'Server.Targeting.Target' is a 'type' but is used like a 'variable'
    CS0118: Line 438: 'Server.Targeting.Target' is a 'type' but is used like a 'variable'
    CS0118: Line 444: 'Server.Targeting.Target' is a 'type' but is used like a 'variable'
    CS0118: Line 446: 'Server.Targeting.Target' is a 'type' but is used like a 'variable'
    CS0103: Line 452: The name 'theitem' does not exist in the current context
    CS0103: Line 452: The name '_PlantType' does not exist in the current context
    CS0103: Line 452: The name 'theitem' does not exist in the current context
    CS0103: Line 452: The name '_PlantType' does not exist in the current context
    CS0103: Line 452: The name 'theitem' does not exist in the current context
    CS0103: Line 452: The name '_PlantType' does not exist in the current context
    CS0103: Line 458: The name 'theitem' does not exist in the current context
    CS0103: Line 458: The name '_PlantType' does not exist in the current context
    CS0103: Line 458: The name 'theitem' does not exist in the current context
    CS0103: Line 458: The name '_PlantType' does not exist in the current context
    CS0103: Line 458: The name 'theitem' does not exist in the current context
    CS0103: Line 458: The name '_PlantType' does not exist in the current context
[\code]

Here is the section of the script causing the errors:
[code]
//*********************************
// PROBLEM SECTION:
//*********************************
        //add button
            if( buttonid == 1 )
            {

//LINE# 433 Follows:
                if ( Target == null )
                {
                    return;
                }

                if ( !Target is Seed )
                {
                    _Owner.SendMessage(33, "That is not a Seed.");
                    return;
                }

                if ( Target is Seed )
                {
                    Target theitem = Target as Seed;
                }

                // 1st Generation:
                if (_ListEntry.Name == "1st Generation")
                {
                    if ( !(theitem._PlantType == _PlantType.CampionFlowers) && !(theitem._PlantType == _PlantType.Fern) && !(theitem._PlantType == _PlantType.TribarrelCactus) )
                    {
                        _Owner.SendMessage(33, "That seed is not a 1st Generation seed.");
                            return;
                    }

                    if ( (theitem._PlantType == _PlantType.CampionFlowers) || (theitem._PlantType == _PlantType.Fern) || (theitem._PlantType == _PlantType.TribarrelCactus) )
                    {
                        _ListEntry.AddItem( _Owner );
                        _Owner.SendMessage( "You add the 1st Generation seed" );
                        //refresh the gump
                        _Owner.SendGump( new ListEntryGump( this ) );
                        return;
                    }
                }
            }
//*********************************

and . . Here is the entire script:
Code:
using System;
using System.Collections.Generic;
using Server;
using Server.Mobiles;
using Server.Network;
using Server.Targeting;
using Solaris.ItemStore;
using System.Collections;
using Server.Engines.Plants;

namespace Server.Gumps
{
    //list entry gump for displaying the contents of a list entry object
    public class ListEntryGump : Gump
    {
        PlayerMobile _Owner;
        ListEntry _ListEntry;

        //used for seeking around on the page
        int _Y = 25;
       
        //page size
        protected int _Height;
        protected int _Width;
       
        //maximum entry listing height, for multi-page calculation
        public int MaxEntryDisplayHeight{ get{ return 300; } }
       
        //line spacing between entries
        public int EntryLineSpacing{ get{ return 20; } }
       
        //page number that this gump is displaying
        protected int _Page;
       
        //this is determined based on the number of entries and the maximum number to display per page
        protected int _MaxPages;
       
        //these are used to truncate the store entry listing to fit only a subset on the page
        protected int _ListingHeight;
        protected int _ListingStart;
        protected int _ListingEnd;
       
        //a filtered entry list
        protected List<ItemListEntry> _FilteredEntries;
               
        //public accessors for gump refreshing
        public Mobile Owner{ get{ return _Owner; } }
        public int Page{ get{ return _Page; } }
        //public accessor to the list entry
        public ListEntry ListEntry{ get{ return _ListEntry; } }
       
        //static refresh method, used when withdrawing/adding
        public static bool RefreshGump( Mobile player )
        {
            return RefreshGump( player, null );
        }
       
        public static bool RefreshGump( Mobile player, ListEntry listentry )
        {
            //if this mobile has a list entry gump up
            if( player.HasGump( typeof( ListEntryGump ) ) )
            {
                ListEntryGump gump = (ListEntryGump)player.FindGump( typeof( ListEntryGump ) );
               
                //if this gump that's up is showing this list entry, or if none was specified, then refresh
                if( listentry == null || gump.ListEntry == listentry )
                {
                    //then, resend this gump!
                    player.SendGump( new ListEntryGump( gump ) );
                    return true;
                }
            }
           
            return false;
        }
       
        //gump refresh constructor
        public ListEntryGump( ListEntryGump oldgump ) : this( oldgump.Owner, oldgump.ListEntry, oldgump.Page )
        {
        }
       
        //default first page constructor
        public ListEntryGump( Mobile owner, ListEntry listentry ) : this( owner, listentry, 0 )
        {
        }
       
        //master constructor, with page number specified
        public ListEntryGump( Mobile owner, ListEntry listentry, int page ) : base( 50, 350 )
        {
            if( !( owner is PlayerMobile ) )
            {
                return;
            }
           
            _Owner = (PlayerMobile)owner;
            _ListEntry = listentry;
           
            //clear old gumps that are up
            _Owner.CloseGump( typeof( ListEntryGump ) );
           
            //set up the page
            AddPage(0);
           
            _Page = page;
           
            ApplyFilters();
           
            //determine page layout, sizes, and what gets displayed where
            DeterminePageLayout();

            //add the background                       
            AddBackground(0, 0, _Width, _Height, 9270);
            AddImageTiled(11, 10, _Width - 23, _Height - 20, 2624);
            //AddAlphaRegion(11, 10, _Width - 22, _Height - 20);
           
            AddTitle();
           
            if( !AddListEntryListing() )
            {
                //clear old gumps that are up
                _Owner.CloseGump( typeof( ListEntryGump ) );
                return;
            }
            if( _MaxPages > 1 )
            {
                AddPageButtons();
            }
           
            AddControlButtons();
        }
       
        protected void ApplyFilters()
        {
            _FilteredEntries = new List<ItemListEntry>();
           
           
            foreach( ItemListEntry entry in _ListEntry.ItemListEntries )
            {
                bool addentry = true;
               
                for( int i = 0; i < entry.Columns.Count; i++ )
                {
                    if( _ListEntry.FilterText[i] != null && _ListEntry.FilterText[i] != "" )
                    {
                        ItemListEntryColumn column = entry.Columns[i];
                       
                        if(  column.Text == null || column.Text.ToLower().IndexOf( _ListEntry.FilterText[i].ToLower() ) == -1 )
                        {
                            addentry = false;
                            break;
                        }
                    }
                }
               
                if( addentry )
                {
                    _FilteredEntries.Add( entry );
                }
            }
        }
       
        //this calculates all stuff needed to display the gump properly
        protected void DeterminePageLayout()
        {
            //page size
            if( _FilteredEntries == null || _FilteredEntries.Count == 0 )
            {
                _Height = 200;
               
                if( _ListEntry == null || _ListEntry.ItemListEntries == null || _ListEntry.ItemListEntries.Count == 0 )
                {
                    _Width = 400;
                }
                else
                {
                    _Width = _ListEntry.ItemListEntries[0].GumpWidth;
                }
               
                _MaxPages = 1;
                _Page = Math.Min( _MaxPages - 1, _Page );
            }
            else
            {
               
                //minimum spacing 20, maximum entry display height
                _ListingHeight = Math.Max( 20, Math.Min( MaxEntryDisplayHeight, _FilteredEntries.Count * EntryLineSpacing ) );
               
                //determine how many entries can fit on a given page
                int entriesperpage = MaxEntryDisplayHeight / EntryLineSpacing;
               
                //calculate max # of pages
                _MaxPages = _FilteredEntries.Count / entriesperpage + 1;
               
                _Page = Math.Min( _MaxPages - 1, _Page );
               
                _ListingStart = _Page * entriesperpage;
                _ListingEnd = (_Page + 1 ) * entriesperpage;
               
                _Height = 200 + + ( _MaxPages > 1 ? 30 : 0 ) + _ListingHeight;
                _Width = _FilteredEntries[0].GumpWidth;
            }
        }
       
        //this adds the title stuff for the gump
        protected void AddTitle()
        {
            if( _ListEntry == null )
            {
                return;
            }
           
            AddLabel( 20, _Y, 88, _ListEntry.Name );
            AddLabel( 120, _Y, 88, "Contents: " + _ListEntry.Amount.ToString() + "/" + _ListEntry.MaxAmount.ToString() );
            AddLabel( 262, _Y, 88, "(15 Seeds per page)" );
           
            _Y += 25;
        }

        //this adds the listing of all item stores
        protected bool AddListEntryListing()
        {
            if( _ListEntry == null || _ListEntry.ItemListEntries.Count == 0 )
            {
                return true;
            }

            //write the header info in
            ItemListEntry entry = _ListEntry.ItemListEntries[0];
           
            for( int j = 0; j < entry.Columns.Count; j++ )
            {
                AddLabel( 40 + entry.Columns[j].X, _Y, ( _ListEntry.FilterText[j] == null || _ListEntry.FilterText[j] == "" ? 1153 : 78 ), entry.Columns[j].Header );
                AddSortFilterControls( 40 + entry.Columns[j].X, _Y + 20, j, _ListEntry.FilterText[j] );
            }
           
            _Y += 40;
           
            //list off the items that can be displayed
            for( int i = _ListingStart; i < _ListingEnd && i < _FilteredEntries.Count; i++ )
            {
                entry = _FilteredEntries[i];
               
                //add withdrawal button - put buttonid offset of 100 to allow for control/sort/filter button id's uninterrupted
                AddButton( 20, _Y + 3, 0x4B9, 0x4B9, 100 + i, GumpButtonType.Reply, 0 );
               
                //Add the details about this entry
                for( int j = 0; j < entry.Columns.Count; j++ )
                {
                    if( entry.Columns[j].Width == 0 )
                    {
                        if( j < entry.Columns.Count - 1 )
                        {
                            entry.Columns[j].Width = entry.Columns[j + 1].X - entry.Columns[j].X - 10;
                        }
                        else
                        {
                            entry.Columns[j].Width = _Width - entry.Columns[j].X - 10;
                        }
                    }

                    AddLabelCropped( 40 + entry.Columns[j].X, _Y, entry.Columns[j].Width, 20, ( entry.Hue > 1 ? entry.Hue : 1153 ), entry.Columns[j].Text );
                }
               
                _Y += EntryLineSpacing;
            }
           
            return true;
        }
       
        protected void AddPageButtons()
        {
            //page buttons
            _Y = _Height - 90;
           
            if ( _Page > 0 )
            {
                AddButton( 20, _Y, 0x15E3, 0x15E7, 6, GumpButtonType.Reply, 0 );
            }
            else
            {
                AddImage( 20, _Y, 0x25EA );
            }
            AddLabel( 40, _Y, 88, "Previous Page" );
           
           
            if ( _Page < _MaxPages - 1 )
            {
                AddButton( _Width - 40, _Y, 0x15E1, 0x15E5, 7, GumpButtonType.Reply, 0 );
            }
            else
            {
                AddImage( _Width - 40, _Y, 0x25E6 );
            }
            AddLabel( _Width - 120, _Y, 88, "Next Page" );
           
            AddLabel( _Width / 2 - 10, _Y, 88, String.Format( "({0}/{1})", _Page + 1, _MaxPages ) );
           
        }

        protected void AddControlButtons()
        {
            if (_ListEntry.Name == "1st Generation")
            {
                _Y = _Height - 60;

                AddLabel( _Width / 3 + 45 , _Y, 1153, "Add a Seed" );
                AddButton( _Width / 3 + 25 , _Y + 5, 0x4B9, 0x4BA, 1, GumpButtonType.Reply, 0 );
           
                _Y += 20;

                AddLabel( _Width / 5 , _Y, 88, "Campion Flowers, Ferns, and TriBarrel Cactus" );
            }

            if (_ListEntry.Name == "2nd Generation")
            {
                _Y = _Height - 60;

                AddLabel( _Width / 3 + 45 , _Y, 1153, "Add a Seed" );
                AddButton( _Width / 3 + 25 , _Y + 5, 0x4B9, 0x4BA, 2, GumpButtonType.Reply, 0 );
           
                _Y += 20;

                AddLabel( _Width / 3 , _Y, 88, "Lilies and Water Plants" );
            }

            if (_ListEntry.Name == "3rd Generation")
            {
                _Y = _Height - 60;

                AddLabel( _Width / 3 + 45 , _Y, 1153, "Add a Seed" );
                AddButton( _Width / 3 + 25 , _Y + 5, 0x4B9, 0x4BA, 3, GumpButtonType.Reply, 0 );
           
                _Y += 20;

                AddLabel( _Width / 10 , _Y, 88, "Prickly Pear Cactus, Rushes, Small Palm, Snowdrops" );
            }

            if (_ListEntry.Name == "4th Generation")
            {
                _Y = _Height - 70;

                AddLabel( _Width / 3 + 45 , _Y, 1153, "Add a Seed" );
                AddButton( _Width / 3 + 25 , _Y + 5, 0x4B9, 0x4BA, 4, GumpButtonType.Reply, 0 );
           
                _Y += 20;

                AddLabel( _Width / 10 , _Y, 88, "Barrel Cactus, Bullrushes, Century Plant, Elephant Ears" );

                _Y += 20;

                AddLabel( _Width / 10 , _Y, 88, "Pampas Grass, PonyTail Palm, Poppies and Snake Plant" );

            }

//***************
            if ( (_ListEntry.Name != "1st Generation") && (_ListEntry.Name != "2nd Generation") && (_ListEntry.Name != "3rd Generation") && (_ListEntry.Name != "4th Generation") )

            {
                _Y = _Height - 60;
           
                AddLabel( _Width / 2 + 70 , _Y, 1153, "Add" );
                AddButton( _Width / 2 + 50, _Y + 5, 0x4B9, 0x4BA, 5, GumpButtonType.Reply, 0 );
           
                _Y += 30;

                AddLabel( _Width / 2 + 70 , _Y, 1153, "Fill from backpack" );
                AddButton( _Width / 2 + 50, _Y + 5, 0x4B9, 0x4BA, 6, GumpButtonType.Reply, 0 );
            }
//***************
        }
       
        //gump utilities
       
        public void AddTextField( int x, int y, int width, int height, int index, string text )
        {
            AddImageTiled( x - 2, y - 2, width + 4, height + 4, 0xA2C );
            //AddAlphaRegion( x -2, y - 2, width + 4, height + 4 );
            AddTextEntry( x + 2, y + 2, width - 4, height - 4, 1153, index, text );
        }
       
        public string GetTextField( RelayInfo info, int index )
        {
            TextRelay relay = info.GetTextEntry( index );
            return ( relay == null ? null : relay.Text.Trim() );
        }
       
       
        //this adds sort/filter components at the specified column location and specified column index
        public void AddSortFilterControls( int x, int y, int index, string filtertext )
        {
            //sort buttons
            AddButton( x, y, 0x15E0, 0x15E4, 10 + 10*index, GumpButtonType.Reply, 0 );  //Ascending
            AddButton( x + 15, y, 0x15E2, 0x15E6, 10 + 10*index + 1, GumpButtonType.Reply, 0 );  //Decending
           
            y = _Height - 90;
           
            if( _MaxPages > 1 )
            {
                y -= 30;
            }

            if ( (_ListEntry.Name != "1st Generation") && (_ListEntry.Name != "2nd Generation") && (_ListEntry.Name != "3rd Generation") && (_ListEntry.Name != "4th Generation") )

            {
                AddTextField( x, y, 50, 20, index, filtertext );
                AddButton( x + 55, y, 0x15E1, 0x15E5, 10 + 10*index + 2, GumpButtonType.Reply, 0 );
            }
        }
       
        public override void OnResponse( NetState sender, RelayInfo info )
        {
            if( _ListEntry == null || !_ListEntry.CanUse( _Owner ) )
            {
                return;
            }
           
            //store flags
            int buttonid = info.ButtonID;
           
            //right click
            if( buttonid == 0 )
            {
                return;
            }
//*********************************
// PROBLEM SECTION:
//*********************************
        //add button
            if( buttonid == 1 )
            {
                if ( Target == null )
                {
                    return;
                }

                if ( !Target is Seed )
                {
                    _Owner.SendMessage(33, "That is not a Seed.");
                    return;
                }

                if ( Target is Seed )
                {
                    Target theitem = Target as Seed;
                }

                // 1st Generation:
                if (_ListEntry.Name == "1st Generation")
                {
                    if ( !(theitem._PlantType == _PlantType.CampionFlowers) && !(theitem._PlantType == _PlantType.Fern) && !(theitem._PlantType == _PlantType.TribarrelCactus) )
                    {
                        _Owner.SendMessage(33, "That seed is not a 1st Generation seed.");
                            return;
                    }

                    if ( (theitem._PlantType == _PlantType.CampionFlowers) || (theitem._PlantType == _PlantType.Fern) || (theitem._PlantType == _PlantType.TribarrelCactus) )
                    {
                        _ListEntry.AddItem( _Owner );
                        _Owner.SendMessage( "You add the 1st Generation seed" );
                        //refresh the gump
                        _Owner.SendGump( new ListEntryGump( this ) );
                        return;
                    }
                }
            }
//*********************************

            // 2nd Generation:
            if( buttonid == 2 )
            {
/*                if (_ListEntry.Name == "2nd Generation")
                {
                    if ( !(_Owner.Target._PlantType == _PlantType.Lilies) && !(_Owner.Target._PlantType == _PlantType.WaterPlant) )
                    {
                        _Owner.SendMessage( "That is not a 2nd Generation seed" );
                    }

                    if ( (_Owner.Target._PlantType == _PlantType.Lilies) || (_Owner.Target._PlantType == _PlantType.WaterPlant) )
                    {
                        _ListEntry.AddItem( _Owner );
                        _Owner.SendMessage( "You add the 2nd Generation seed" );
                        //refresh the gump
                        _Owner.SendGump( new ListEntryGump( this ) );
                        return;
                    }
                }
*/
            }

            // 3rd Generation:
            if( buttonid == 3 )
            {
/*                if (_ListEntry.Name == "3rd Generation")
                {
                    if ( !(_Owner.Target._PlantType == _PlantType.PricklyPearCactus) && !(_Owner.Target._PlantType == _PlantType.Rushes) && !(_Owner.Target._PlantType == _PlantType.SmallPalm) && !(_Owner.Target._PlantType == _PlantType.Snowdrops) )
                    {
                        _Owner.SendMessage( "That is not a 3rd Generation seed" );
                    }

                    if ( (_Owner.Target._PlantType == _PlantType.PricklyPearCactus) || (_Owner.Target._PlantType == _PlantType.Rushes) || (_Owner.Target._PlantType == _PlantType.SmallPalm) || (_Owner.Target._PlantType == _PlantType.Snowdrops) )
                    {
                        _ListEntry.AddItem( _Owner );
                        _Owner.SendMessage( "You add the 3rd Generation seed" );
                        //refresh the gump
                        _Owner.SendGump( new ListEntryGump( this ) );
                        return;
                    }
                }
*/
            }

            // 4th Generation:
            if( buttonid == 4 )
            {
/*                if (_ListEntry.Name == "4th Generation")
                {
                    if ( !(_Owner.Target._PlantType == _PlantType.BarrelCactus) && !(_Owner.Target._PlantType == _PlantType.Bullrushes) && !(_Owner.Target._PlantType == _PlantType.CenturyPlant) && !(_Owner.Target._PlantType == _PlantType.ElephantEarPlant) && !(_Owner.Target._PlantType == _PlantType.PampasGrass) && !(_Owner.Target._PlantType == _PlantType.PonytailPalm) && !(_Owner.Target._PlantType == _PlantType.Poppies) && !(_Owner.Target._PlantType == _PlantType.SnakePlant) )
                    {
                        _Owner.SendMessage( "That is not a 3rd Generation seed" );
                    }

                    if ( (_Owner.Target._PlantType == _PlantType.BarrelCactus) || (_Owner.Target._PlantType == _PlantType.Bullrushes) || (_Owner.Target._PlantType == _PlantType.CenturyPlant) || (_Owner.Target._PlantType == _PlantType.ElephantEarPlant) || (_Owner.Target._PlantType == _PlantType.PampasGrass) || (_Owner.Target._PlantType == _PlantType.PonytailPalm) || (_Owner.Target._PlantType == _PlantType.Poppies) || (_Owner.Target._PlantType == _PlantType.SnakePlant) )
                    {
                        _ListEntry.AddItem( _Owner );
                        _Owner.SendMessage( "You add the 3rd Generation seed" );
                        //refresh the gump
                        _Owner.SendGump( new ListEntryGump( this ) );
                        return;
                    }
                }
*/
            }

            //add item from backpack button
            if( buttonid == 5 )
            {
                _ListEntry.FillFromBackpack( _Owner );
               
                _Owner.SendGump( new ListEntryGump( this ) );
                return;
            }

            //fill from backpack button
            if( buttonid == 6 )
            {
                _ListEntry.FillFromBackpack( _Owner );
               
                _Owner.SendGump( new ListEntryGump( this ) );
                return;
            }

            //previous page button
            if( buttonid == 7 )
            {
                if( _Page > 0 )
                {
                    _Owner.SendGump( new ListEntryGump( _Owner, _ListEntry, _Page - 1 ) );
                }
                return;
            }
           
            //next page button
            if( buttonid == 8 )
            {
                if( _Page < _MaxPages - 1 )
                {
                    _Owner.SendGump( new ListEntryGump( _Owner, _ListEntry, _Page + 1 ) );
                }
                return;
            }
           
            //sort/filter buttons
            if( buttonid >= 10 && buttonid < 100 )
            {
                int columnnum = ( buttonid - 10 ) / 10;
                int buttontype = ( buttonid - 10 ) % 10;
               
                //if it's a sort button
                if( buttontype < 2 )
                {
                    ItemListEntry.SortIndex = columnnum;
                    ItemListEntry.SortOrder = ( buttontype == 0 ? -1 : 1 );
                   
                    _ListEntry.ItemListEntries.Sort();
                }
                else
                {
                    //apply filters
                    for( int i = 0; i < 10; i++ )
                    {
                        _ListEntry.FilterText[i] = GetTextField( info, i );
                    }
                }

                _Owner.SendGump( new ListEntryGump( this ) );
                return;
            }

            //any button that is left is a withdraw request
            //offset of 100 between the passed value and the list index
           
            buttonid -= 100;
           
            if( buttonid >= 0 && buttonid < _FilteredEntries.Count )
            {
                _ListEntry.WithdrawItem( _Owner, _FilteredEntries[ buttonid ] );
            }
           
            _Owner.SendGump( new ListEntryGump( this ) );

        }
    }
}

If anyone can point me in the rigt direction here it would really be appreciated.

*bows*
 
Part of your problem would be that you're never giving the Target cursor for the player to even select a seed from what I can tell. Look in a spell file to see how it calls a Target or another gump such as a bulk order adding an item to the deed.

Secondly, you're making Target theitem, not the seed. You would want Seed theitem = Target as Seed, since the seed is the planttype and Target is a Targeting cursor.
 
Hey Dev-Stryder and Kimuji . . Thank you 'both' for looking at this. It has had my head in knots for several days.

First . . for my syntax problem I tried "Seed theitem = Target as Seed" and got this error on that line
Code:
Errors:
 + Customs/Universal Storage Keys/Gumps/ListEntryGump.cs:
    CS0118: Line 436: 'Server.Targeting.Target' is a 'type' but is used like a 'variable'

Second . . Kimuji, the sample you posted is to 'drool' for. I would love to be able to test that to see if it would actually sort the way I am trying to achieve. Failing that, I will have to keep pulling out hair over my current challenge.

I really appreciate the community's help here. Amazing as always.

*bows*
 
I just edited the SeedListEntry of USK to add a new column.
If your gardeners key gump doesn t look like this already (without the generation column) you may have not the last USK version.
 
Yes . . My system is for RUNUO V 2.1 and was created back on May 1, 2009. None of my Seeds scripts gas 'Generation' as a property so that has been a part of the problem. If I change the Seed script to include a 'Generation' property I fear it will have to delete everyone's seeds.
 
No needs to add a saved property to seed.
It could be calculated at creation/deserialization.

C#:
switch (_PlantType)

                    {
                        case PlantType.CampionFlowers:
                        case PlantType.Fern:
                        case PlantType.TribarrelCactus:
                            _SeedGeneration = 1;
                            break;

                        case PlantType.Lilies:
                        case PlantType.WaterPlant:
                            _SeedGeneration = 2;
                            break;

                        case PlantType.PricklyPearCactus:
                        case PlantType.Rushes:
                        case PlantType.SmallPalm:
                        case PlantType.Snowdrops:
                            _SeedGeneration = 3;
                            break;

                        case PlantType.BarrelCactus:
                        case PlantType.Bulrushes:
                        case PlantType.CenturyPlant:
                        case PlantType.ElephantEarPlant:
                        case PlantType.PampasGrass:
                        case PlantType.PonytailPalm:
                        case PlantType.Poppies:
                        case PlantType.SnakePlant:
                            _SeedGeneration = 4;
                            break;

                        default:
                            _SeedGeneration = 0;
                            break;

}
 
Okay, sorry for this (an inexperienced question) . . if I try adding in your suggestion to the Deserialization of Seed.cs will that:
1) cause existing seeds to be deleted at server reboot?
2) 'only apply to new' created seeds leaving existing ones out of luck?

Thank you very much for your eyes on tis for me.

*bows*
 
Add at the end of deserialization method : it will update old ones.
and to constructors : for new ones.

Existing will not be deleted since you don't change what is saved/loaded.
You can obviously try it in local ;)
 
Okay Kimuji . . I have the Deserialize changed but it's kicking me out with these errors
Code:
Errors:
 + Engines/Plants/Seed.cs:
    CS0103: Line 206: The name '_SeedGeneration' does not exist in the current context
    CS0103: Line 211: The name '_SeedGeneration' does not exist in the current context
    CS0103: Line 218: The name '_SeedGeneration' does not exist in the current context
    CS0103: Line 229: The name '_SeedGeneration' does not exist in the current context
    CS0103: Line 233: The name '_SeedGeneration' does not exist in the current context

I could add something like this near the top of the Seed.cs script:
Code:
        [CommandProperty( AccessLevel.GameMaster )]
        public SeedGeneration SeedGeneration
        {
            get { return m_SeedGeneration; }
            set
            {
                m_SeedGeneration = value;
                InvalidateProperties();
            }
        }
[code]

But if I do that . . am I now treading onto a problem where existing seeds will get deleted at reboot?

Thanks
 
Just add :
public int SeedGeneration;

And change _SeedGeneration to SeedGeneration

No deletion.

Add it to the Seed() constructors too...
 
Real progress (thanks to you) is being made.

I believe I am close in spite of the Errors I am getting on 15 files. I can go into those filles and make them work . . provided the end result will not mess up things for folks on the live shard.

Here is my new Seed.cs script:
Code:
using System;
using Server;
using Server.Targeting;

namespace Server.Engines.Plants
{
    public class Seed : Item
    {

        private PlantType m_PlantType;
        private PlantHue m_PlantHue;
        private bool m_ShowType;
        private int m_SeedGeneration;

        [CommandProperty( AccessLevel.GameMaster )]
        public int SeedGeneration
        {
            get { return m_SeedGeneration; }
            set
            {
                m_SeedGeneration = value;
                InvalidateProperties();
            }
        }

        [CommandProperty( AccessLevel.GameMaster )]
        public PlantType PlantType
        {
            get { return m_PlantType; }
            set
            {
                m_PlantType = value;
                InvalidateProperties();
            }
        }

        [CommandProperty( AccessLevel.GameMaster )]
        public PlantHue PlantHue
        {
            get { return m_PlantHue; }
            set
            {
                m_PlantHue = value;
                Hue = PlantHueInfo.GetInfo( value ).Hue;
                InvalidateProperties();
            }
        }

        [CommandProperty( AccessLevel.GameMaster )]
        public bool ShowType
        {
            get { return m_ShowType; }
            set
            {
                m_ShowType = value;
                InvalidateProperties();
            }
        }

        public override int LabelNumber{ get { return 1060810; } } // seed

        public static Seed RandomBonsaiSeed()
        {
            return RandomBonsaiSeed( 0.5 );
        }

        public static Seed RandomBonsaiSeed( double increaseRatio )
        {
            return new Seed( PlantTypeInfo.RandomBonsai( increaseRatio ), PlantHue.Plain, false );
        }

        public static Seed RandomPeculiarSeed( int group )
        {
            switch ( group )
            {
                case 1: return new Seed ( PlantTypeInfo.RandomPeculiarGroupOne(), PlantHue.Plain, false );
                case 2: return new Seed ( PlantTypeInfo.RandomPeculiarGroupTwo(), PlantHue.Plain, false );
                case 3: return new Seed ( PlantTypeInfo.RandomPeculiarGroupThree(), PlantHue.Plain, false );
                default: return new Seed ( PlantTypeInfo.RandomPeculiarGroupFour(), PlantHue.Plain, false );
            }
        }

        [Constructable]
        public Seed() : this( PlantTypeInfo.RandomFirstGeneration(), PlantHueInfo.RandomFirstGeneration(), false )
        {
        }

        [Constructable]
        public Seed( PlantType plantType, PlantHue plantHue, bool showType, int seedGeneration ) : base( 0xDCF )
        {
            Weight = 1.0;

            m_PlantType = plantType;
            m_PlantHue = plantHue;
            m_ShowType = showType;
            m_SeedGeneration = seedGeneration;

            Hue = PlantHueInfo.GetInfo( plantHue ).Hue;
        }

        public Seed( Serial serial ) : base( serial )
        {
        }

        public override bool ForceShowProperties{ get{ return ObjectPropertyList.Enabled; } }

        public override void AddNameProperty( ObjectPropertyList list )
        {
            PlantHueInfo hueInfo = PlantHueInfo.GetInfo( m_PlantHue );

            int title = PlantTypeInfo.GetBonsaiTitle( m_PlantType );
            if ( title == 0 ) // Not a bonsai
                title = hueInfo.Name;

            if ( m_ShowType )
            {
                PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo( m_PlantType );
                list.Add( hueInfo.IsBright() ? 1061918 : 1061917, String.Concat( "#", title.ToString(), "\t#", typeInfo.Name.ToString() ) ); // [bright] ~1_COLOR~ ~2_TYPE~ seed
            }
            else
            {
                list.Add( hueInfo.IsBright() ? 1060839 : 1060838, String.Concat( "#", title.ToString() ) ); // [bright] ~1_val~ seed
            }
        }

        public override void OnSingleClick ( Mobile from )
        {
            PlantHueInfo hueInfo = PlantHueInfo.GetInfo( m_PlantHue );

            if ( m_ShowType )
            {
                PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo( m_PlantType );
                LabelTo( from, hueInfo.IsBright() ? 1061918 : 1061917, String.Concat( "#", hueInfo.Name.ToString(), "\t#", typeInfo.Name.ToString() ) ); // [bright] ~1_COLOR~ ~2_TYPE~ seed
            }
            else
            {
                LabelTo( from, hueInfo.IsBright() ? 1060839 : 1060838, String.Concat( "#", hueInfo.Name.ToString() ) ); // [bright] ~1_val~ seed
            }
        }

        public override void OnDoubleClick( Mobile from )
        {
            if ( !IsChildOf( from.Backpack ) )
            {
                from.SendLocalizedMessage( 1042664 ); // You must have the object in your backpack to use it.
                return;
            }

            from.Target = new InternalTarget( this );
            LabelTo( from, 1061916 ); // Choose a bowl of dirt to plant this seed in.
        }

        private class InternalTarget : Target
        {
            private Seed m_Seed;

            public InternalTarget( Seed seed ) : base( 3, false, TargetFlags.None )
            {
                m_Seed = seed;
            }

            protected override void OnTarget( Mobile from, object targeted )
            {
                if ( m_Seed.Deleted )
                    return;

                if ( !m_Seed.IsChildOf( from.Backpack ) )
                {
                    from.SendLocalizedMessage( 1042664 ); // You must have the object in your backpack to use it.
                    return;
                }

                if ( targeted is PlantItem )
                {
                    PlantItem plant = (PlantItem)targeted;

                    plant.PlantSeed( from, m_Seed );
                }
                else if ( targeted is Item )
                {
                    ((Item)targeted).LabelTo( from, 1061919 ); // You must use a seed on a bowl of dirt!
                }
                else
                {
                    from.SendLocalizedMessage( 1061919 ); // You must use a seed on a bowl of dirt!
                }
            }
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 0 ); // version

            writer.Write( (int) m_PlantType );
            writer.Write( (int) m_PlantHue );
            writer.Write( (bool) m_ShowType );
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            m_PlantType = (PlantType)reader.ReadInt();
            m_PlantHue = (PlantHue)reader.ReadInt();
            m_ShowType = reader.ReadBool();

            if ( Weight != 1.0 )
                Weight = 1.0;

            switch (m_PlantType)
            {
                case PlantType.CampionFlowers:
                case PlantType.Fern:
                case PlantType.TribarrelCactus:
                    m_SeedGeneration = 1;
                    break;

                case PlantType.Lilies:
                case PlantType.WaterPlant:
                    m_SeedGeneration = 2;
                    break;

                case PlantType.PricklyPearCactus:
                case PlantType.Rushes:
                case PlantType.SmallPalm:
                case PlantType.Snowdrops:
                    m_SeedGeneration = 3;
                    break;

                case PlantType.BarrelCactus:
                case PlantType.Bulrushes:
                case PlantType.CenturyPlant:
                case PlantType.ElephantEarPlant:
                case PlantType.PampasGrass:
                case PlantType.PonytailPalm:
                case PlantType.Poppies:
                case PlantType.SnakePlant:
                    m_SeedGeneration = 4;
                    break;

                default:
                    m_SeedGeneration = 0;
                    break;

            }
        }
    }
}

Here are the Errors the new Seed.cs is causing:
Code:
Errors:
 + Engines/Plants/EmptyTheBowlGump.cs:
    CS1729: Line 96: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
 + Customs/Events - Special/City Random Invasions/Mobiles/Mobs/Abyss/UOTSemidar.cs:
    CS1729: Line 395: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 396: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 397: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 398: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 399: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 400: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 401: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 402: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
 + Customs/Events - Special/City Random Invasions/Mobiles/Mobs/Arachnid/UOTMephitis.cs:
    CS1729: Line 268: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 269: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 270: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 271: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 272: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 273: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 274: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 275: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
 + Customs/Events - Special/City Random Invasions/Mobiles/Mobs/DragonKind/UOTRikktor.cs:
    CS1729: Line 211: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 212: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 213: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 214: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 215: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 216: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 217: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 218: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
 + Customs/Events - Special/City Random Invasions/Mobiles/Mobs/Elementals/UOTLordOaks.cs:
    CS1729: Line 205: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 206: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 207: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 208: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 209: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 210: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 211: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 212: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
 + Customs/Events - Special/City Random Invasions/Mobiles/Mobs/Humanoid/UOTBarracoon.cs:
    CS1729: Line 1239: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 1240: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 1241: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 1242: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 1243: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 1244: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 1245: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 1246: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
 + Customs/Events - Special/City Random Invasions/Mobiles/Mobs/Ophidian/UOTNeira.cs:
    CS1729: Line 506: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 507: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 508: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 509: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 510: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 511: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 512: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 513: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
 + Customs/Events - Special/City Random Invasions/Mobiles/Mobs/Orcs/UOTSerado.cs:
    CS1729: Line 483: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 484: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 485: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 486: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 487: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 488: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 489: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 490: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
 + Customs/Events - Special/City Random Invasions/Mobiles/Mobs/Ore Elementals/UOTBarracoonOre.cs:
    CS1729: Line 490: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 491: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 492: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 493: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 494: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 495: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 496: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 497: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
 + Customs/Events - Special/City Random Invasions/Mobiles/Mobs/Snakes/UOTBossSnake.cs:
    CS1729: Line 1196: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 1197: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 1198: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 1199: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 1200: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 1201: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 1202: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 1203: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
 + Customs/Events - Special/City Random Invasions/Mobiles/Mobs/Undead/UOTImpalerUndead.cs:
    CS1729: Line 1207: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 1208: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 1209: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 1210: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 1211: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 1212: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 1213: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 1214: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
 + Customs/Universal Storage Keys/Main Data Management/ItemListEntries.cs:
    CS1729: Line 896: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
 + Engines/Plants/ReproductionGump.cs:
    CS1729: Line 245: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
 + Engines/Plants/Seed.cs:
    CS1729: Line 69: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 76: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 77: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 78: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 79: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 84: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
 + Engines/Quests/Study of the Solen Hive/Mobiles/Naturalist.cs:
    CS1729: Line 86: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 98: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
 + Items/Containers/TreasureMapChest.cs:
    CS1729: Line 2014: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2015: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2016: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2017: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2018: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2019: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2020: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2021: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2026: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2027: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2028: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2029: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2030: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2031: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2032: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2033: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2299: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2300: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2301: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2302: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2303: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2304: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2305: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2306: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2311: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2312: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2313: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2314: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2315: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2316: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2317: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2318: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2432: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2433: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2434: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2435: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2436: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2437: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2438: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2439: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2444: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2445: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2446: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2447: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2448: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2449: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2450: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1729: Line 2451: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
Scripts: One or more scripts failed to compile or no script files were found.
 - Press return to exit, or R to try again.

And . . for the first file ( Engines/Plants/EmptyTheBowlGump.cs ) in the list, here is the line causing the Error
Code:
Seed seed = new Seed( m_Plant.PlantType, m_Plant.PlantHue, m_Plant.ShowType );

Again . . easy enough for me to edit the 15 files provided the result does not keep kicking the can down the road. What do you think?

Many Thanks

****************************

Okay . . back again.

As a test I looked at EmptyTheBowlGump.cs because it only threw one error on line 96.

In that file on line 96 I changed:
"Seed seed = new Seed( m_Plant.PlantType, m_Plant.PlantHue, m_Plant.ShowType );

to read:
Seed seed = new Seed( m_Plant.PlantType, m_Plant.PlantHue, m_Plant.ShowType, m_Plant.SeedGeneration );

When I rebooted to see if EmptyTheBowlGump.cs would compile without errors a new error popped up for it:
Code:
 + Engines/Plants/EmptyTheBowlGump.cs:
    CS1061: Line 96: 'Server.Engines.Plants.PlantItem' does not contain a definition for 'SeedGeneration' and no extension method 'SeedGeneration' accepting a first argument of type 'Server.Engines.Plants.PlantItem' could be found (are you missing a using directive or an assembly reference?)

Looking at PlantItem.cs to see where I could fix the new problem it looks like the file would need to be changed in six spots. I will give that a go and hope it does not create additional branches of the problem.

Will keep you posted.

Thanks
 
Last edited:
Well looks like I have gone down the rabbit hole *smiles*

I have been following the chain of errors, fixing them one file at a time but hit the syntax wall aagain on this one.

Here are my current errors:
Code:
+ Engines/Plants/Seed.cs:
    CS1729: Line 69: 'Server.Engines.Plants.Seed' does not contain a constructor that takes 3 arguments
    CS1041: Line 76: Identifier expected; 'int' is a keyword
    CS1001: Line 76: Identifier expected
    CS1525: Line 76: Invalid expression term ')'
    CS1041: Line 77: Identifier expected; 'int' is a keyword
    CS1001: Line 77: Identifier expected
    CS1525: Line 77: Invalid expression term ')'
    CS1041: Line 78: Identifier expected; 'int' is a keyword
    CS1001: Line 78: Identifier expected
    CS1525: Line 78: Invalid expression term ')'
    CS1041: Line 79: Identifier expected; 'int' is a keyword
    CS1001: Line 79: Identifier expected
    CS1525: Line 79: Invalid expression term ')'

and here is the Seed.cs script:
Code:
using System;
using Server;
using Server.Targeting;

namespace Server.Engines.Plants
{
    public class Seed : Item
    {

        private PlantType m_PlantType;
        private PlantHue m_PlantHue;
        private bool m_ShowType;
        private int m_SeedGeneration;

        [CommandProperty( AccessLevel.GameMaster )]
        public int SeedGeneration
        {
            get { return m_SeedGeneration; }
            set
            {
                m_SeedGeneration = value;
                InvalidateProperties();
            }
        }

        [CommandProperty( AccessLevel.GameMaster )]
        public PlantType PlantType
        {
            get { return m_PlantType; }
            set
            {
                m_PlantType = value;
                InvalidateProperties();
            }
        }

        [CommandProperty( AccessLevel.GameMaster )]
        public PlantHue PlantHue
        {
            get { return m_PlantHue; }
            set
            {
                m_PlantHue = value;
                Hue = PlantHueInfo.GetInfo( value ).Hue;
                InvalidateProperties();
            }
        }

        [CommandProperty( AccessLevel.GameMaster )]
        public bool ShowType
        {
            get { return m_ShowType; }
            set
            {
                m_ShowType = value;
                InvalidateProperties();
            }
        }

        public override int LabelNumber{ get { return 1060810; } } // seed

        public static Seed RandomBonsaiSeed()
        {
            return RandomBonsaiSeed( 0.5 );
        }

        public static Seed RandomBonsaiSeed( double increaseRatio )
        {
            return new Seed( PlantTypeInfo.RandomBonsai( increaseRatio ), PlantHue.Plain, false );
        }

        public static Seed RandomPeculiarSeed( int group )
        {
            switch ( group )
            {
                case 1: return new Seed ( PlantTypeInfo.RandomPeculiarGroupOne(), PlantHue.Plain, false, SeedGeneration.int );
                case 2: return new Seed ( PlantTypeInfo.RandomPeculiarGroupTwo(), PlantHue.Plain, false, SeedGeneration.int );
                case 3: return new Seed ( PlantTypeInfo.RandomPeculiarGroupThree(), PlantHue.Plain, false, SeedGeneration.int );
                default: return new Seed ( PlantTypeInfo.RandomPeculiarGroupFour(), PlantHue.Plain, false, SeedGeneration.int );
            }
        }

        [Constructable]
        public Seed() : this( PlantTypeInfo.RandomFirstGeneration(), PlantHueInfo.RandomFirstGeneration(), false, 0 )
        {
        }

        [Constructable]
        public Seed( PlantType plantType, PlantHue plantHue, bool showType, int seedGeneration) : base( 0xDCF )
        {
            Weight = 1.0;

            m_PlantType = plantType;
            m_PlantHue = plantHue;
            m_ShowType = showType;
            m_SeedGeneration = seedGeneration;

            Hue = PlantHueInfo.GetInfo( plantHue ).Hue;
        }

        public Seed( Serial serial ) : base( serial )
        {
        }

        public override bool ForceShowProperties{ get{ return ObjectPropertyList.Enabled; } }

        public override void AddNameProperty( ObjectPropertyList list )
        {
            PlantHueInfo hueInfo = PlantHueInfo.GetInfo( m_PlantHue );

            int title = PlantTypeInfo.GetBonsaiTitle( m_PlantType );
            if ( title == 0 ) // Not a bonsai
                title = hueInfo.Name;

            if ( m_ShowType )
            {
                PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo( m_PlantType );
                list.Add( hueInfo.IsBright() ? 1061918 : 1061917, String.Concat( "#", title.ToString(), "\t#", typeInfo.Name.ToString() ) ); // [bright] ~1_COLOR~ ~2_TYPE~ seed
            }
            else
            {
                list.Add( hueInfo.IsBright() ? 1060839 : 1060838, String.Concat( "#", title.ToString() ) ); // [bright] ~1_val~ seed
            }
        }

        public override void OnSingleClick ( Mobile from )
        {
            PlantHueInfo hueInfo = PlantHueInfo.GetInfo( m_PlantHue );

            if ( m_ShowType )
            {
                PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo( m_PlantType );
                LabelTo( from, hueInfo.IsBright() ? 1061918 : 1061917, String.Concat( "#", hueInfo.Name.ToString(), "\t#", typeInfo.Name.ToString() ) ); // [bright] ~1_COLOR~ ~2_TYPE~ seed
            }
            else
            {
                LabelTo( from, hueInfo.IsBright() ? 1060839 : 1060838, String.Concat( "#", hueInfo.Name.ToString() ) ); // [bright] ~1_val~ seed
            }
        }

        public override void OnDoubleClick( Mobile from )
        {
            if ( !IsChildOf( from.Backpack ) )
            {
                from.SendLocalizedMessage( 1042664 ); // You must have the object in your backpack to use it.
                return;
            }

            from.Target = new InternalTarget( this );
            LabelTo( from, 1061916 ); // Choose a bowl of dirt to plant this seed in.
        }

        private class InternalTarget : Target
        {
            private Seed m_Seed;

            public InternalTarget( Seed seed ) : base( 3, false, TargetFlags.None )
            {
                m_Seed = seed;
            }

            protected override void OnTarget( Mobile from, object targeted )
            {
                if ( m_Seed.Deleted )
                    return;

                if ( !m_Seed.IsChildOf( from.Backpack ) )
                {
                    from.SendLocalizedMessage( 1042664 ); // You must have the object in your backpack to use it.
                    return;
                }

                if ( targeted is PlantItem )
                {
                    PlantItem plant = (PlantItem)targeted;

                    plant.PlantSeed( from, m_Seed );
                }
                else if ( targeted is Item )
                {
                    ((Item)targeted).LabelTo( from, 1061919 ); // You must use a seed on a bowl of dirt!
                }
                else
                {
                    from.SendLocalizedMessage( 1061919 ); // You must use a seed on a bowl of dirt!
                }
            }
        }

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 0 ); // version

            writer.Write( (int) m_PlantType );
            writer.Write( (int) m_PlantHue );
            writer.Write( (bool) m_ShowType );
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            m_PlantType = (PlantType)reader.ReadInt();
            m_PlantHue = (PlantHue)reader.ReadInt();
            m_ShowType = reader.ReadBool();

            if ( Weight != 1.0 )
                Weight = 1.0;

            switch (m_PlantType)
            {
                case PlantType.CampionFlowers:
                case PlantType.Fern:
                case PlantType.TribarrelCactus:
                    m_SeedGeneration = 1;
                    break;

                case PlantType.Lilies:
                case PlantType.WaterPlant:
                    m_SeedGeneration = 2;
                    break;

                case PlantType.PricklyPearCactus:
                case PlantType.Rushes:
                case PlantType.SmallPalm:
                case PlantType.Snowdrops:
                    m_SeedGeneration = 3;
                    break;

                case PlantType.BarrelCactus:
                case PlantType.Bulrushes:
                case PlantType.CenturyPlant:
                case PlantType.ElephantEarPlant:
                case PlantType.PampasGrass:
                case PlantType.PonytailPalm:
                case PlantType.Poppies:
                case PlantType.SnakePlant:
                    m_SeedGeneration = 4;
                    break;

                default:
                    m_SeedGeneration = 0;
                    break;

            }
        }
    }
}
[\code]

Appreciate any help

Thanks
 
Line 69: in your code you didnt add the seedgeneration, so thats why you had the error
The other lines, well as the error says. int is a keyword, not a variable or anything.
Also Seedgeneration is not an object, therefor you can not access sub variables / parameter / methods anyway.

You had your switch to determine the SeedGeneration anyway, so I put that inside a method, and now you can use the same code, inside the constructor and inside the deserialize method.

There is no need to have 4 parameter in the constructor

C#:
using System;
using Server;
using Server.Targeting;

namespace Server.Engines.Plants
{
    public class Seed : Item
    {
        private PlantType m_PlantType;
        private PlantHue m_PlantHue;
        private bool m_ShowType;
        private int m_SeedGeneration;

        [CommandProperty( AccessLevel.GameMaster )]
        public int SeedGeneration
        {
            get { return m_SeedGeneration; }
            set
            {
                m_SeedGeneration = value;
                InvalidateProperties();
            }
        }

        [CommandProperty( AccessLevel.GameMaster )]
        public PlantType PlantType
        {
            get { return m_PlantType; }
            set
            {
                m_PlantType = value;
                GetSeedGeneration(value);
                InvalidateProperties();
            }
        }

        [CommandProperty( AccessLevel.GameMaster )]
        public PlantHue PlantHue
        {
            get { return m_PlantHue; }
            set
            {
                m_PlantHue = value;
                Hue = PlantHueInfo.GetInfo( value ).Hue;
                InvalidateProperties();
            }
        }

        [CommandProperty( AccessLevel.GameMaster )]
        public bool ShowType
        {
            get { return m_ShowType; }
            set
            {
                m_ShowType = value;
                InvalidateProperties();
            }
        }

        public override int LabelNumber{ get { return 1060810; } } // seed

        public static Seed RandomBonsaiSeed()
        {
            return RandomBonsaiSeed( 0.5 );
        }

        public static Seed RandomBonsaiSeed( double increaseRatio )
        {
            return new Seed( PlantTypeInfo.RandomBonsai( increaseRatio ), PlantHue.Plain, false );
        }

        public static Seed RandomPeculiarSeed( int group )
        {
            switch ( group )
            {
                case 1: return new Seed ( PlantTypeInfo.RandomPeculiarGroupOne(), PlantHue.Plain, false );
                case 2: return new Seed ( PlantTypeInfo.RandomPeculiarGroupTwo(), PlantHue.Plain, false );
                case 3: return new Seed ( PlantTypeInfo.RandomPeculiarGroupThree(), PlantHue.Plain, false );
                default: return new Seed ( PlantTypeInfo.RandomPeculiarGroupFour(), PlantHue.Plain, false );
            }
        }

        [Constructable]
        public Seed() : this( PlantTypeInfo.RandomFirstGeneration(), PlantHueInfo.RandomFirstGeneration(), false )
        { }

        [Constructable]
        public Seed( PlantType plantType, PlantHue plantHue, bool showType) : base( 0xDCF )
        {
            Weight = 1.0;

            m_PlantType = plantType;
            m_PlantHue = plantHue;
            m_ShowType = showType;
            m_SeedGeneration = GetSeedGeneration(plantType);

            Hue = PlantHueInfo.GetInfo( plantHue ).Hue;
        }

        public Seed( Serial serial ) : base( serial )
        { }

        public override bool ForceShowProperties{ get{ return ObjectPropertyList.Enabled; } }

        public override void AddNameProperty( ObjectPropertyList list )
        {
            PlantHueInfo hueInfo = PlantHueInfo.GetInfo( m_PlantHue );

            int title = PlantTypeInfo.GetBonsaiTitle( m_PlantType );
            if ( title == 0 ) // Not a bonsai
                title = hueInfo.Name;

            if ( m_ShowType )
            {
                PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo( m_PlantType );
                list.Add( hueInfo.IsBright() ? 1061918 : 1061917, String.Concat( "#", title.ToString(), "\t#", typeInfo.Name.ToString() ) ); // [bright] ~1_COLOR~ ~2_TYPE~ seed
            }
            else
            {
                list.Add( hueInfo.IsBright() ? 1060839 : 1060838, String.Concat( "#", title.ToString() ) ); // [bright] ~1_val~ seed
            }
        }

        public override void OnSingleClick ( Mobile from )
        {
            PlantHueInfo hueInfo = PlantHueInfo.GetInfo( m_PlantHue );

            if ( m_ShowType )
            {
                PlantTypeInfo typeInfo = PlantTypeInfo.GetInfo( m_PlantType );
                LabelTo( from, hueInfo.IsBright() ? 1061918 : 1061917, String.Concat( "#", hueInfo.Name.ToString(), "\t#", typeInfo.Name.ToString() ) ); // [bright] ~1_COLOR~ ~2_TYPE~ seed
            }
            else
            {
                LabelTo( from, hueInfo.IsBright() ? 1060839 : 1060838, String.Concat( "#", hueInfo.Name.ToString() ) ); // [bright] ~1_val~ seed
            }
        }

        public override void OnDoubleClick( Mobile from )
        {
            if ( !IsChildOf( from.Backpack ) )
            {
                from.SendLocalizedMessage( 1042664 ); // You must have the object in your backpack to use it.
                return;
            }

            from.Target = new InternalTarget( this );
            LabelTo( from, 1061916 ); // Choose a bowl of dirt to plant this seed in.
        }

        public static int GetSeedGeneration(PlantType plantType)
        {
            switch (plantType)
            {
                case PlantType.CampionFlowers:
                case PlantType.Fern:
                case PlantType.TribarrelCactus:
                    return 1;

                case PlantType.Lilies:
                case PlantType.WaterPlant:
                    return 2;

                case PlantType.PricklyPearCactus:
                case PlantType.Rushes:
                case PlantType.SmallPalm:
                case PlantType.Snowdrops:
                    return 3;

                case PlantType.BarrelCactus:
                case PlantType.Bulrushes:
                case PlantType.CenturyPlant:
                case PlantType.ElephantEarPlant:
                case PlantType.PampasGrass:
                case PlantType.PonytailPalm:
                case PlantType.Poppies:
                case PlantType.SnakePlant:
                    return 4;

                default:
                    return 0;
            }
        }        

        public override void Serialize( GenericWriter writer )
        {
            base.Serialize( writer );

            writer.Write( (int) 0 ); // version

            writer.Write( (int) m_PlantType );
            writer.Write( (int) m_PlantHue );
            writer.Write( (bool) m_ShowType );
        }

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            m_PlantType = (PlantType)reader.ReadInt();
            m_PlantHue = (PlantHue)reader.ReadInt();
            m_ShowType = reader.ReadBool();

            m_SeedGeneration = GetSeedGeneration(m_PlantType);

            if ( Weight != 1.0 )
                Weight = 1.0;
        }

        private class InternalTarget : Target
        {
            private Seed m_Seed;

            public InternalTarget( Seed seed ) : base( 3, false, TargetFlags.None )
            {
                m_Seed = seed;
            }

            protected override void OnTarget( Mobile from, object targeted )
            {
                if ( m_Seed.Deleted )
                    return;

                if ( !m_Seed.IsChildOf( from.Backpack ) )
                {
                    from.SendLocalizedMessage( 1042664 ); // You must have the object in your backpack to use it.
                    return;
                }

                if ( targeted is PlantItem )
                {
                    PlantItem plant = (PlantItem)targeted;

                    plant.PlantSeed( from, m_Seed );
                }
                else if ( targeted is Item )
                {
                    ((Item)targeted).LabelTo( from, 1061919 ); // You must use a seed on a bowl of dirt!
                }
                else
                {
                    from.SendLocalizedMessage( 1061919 ); // You must use a seed on a bowl of dirt!
                }
            }
        }
    }
}
 
Well . . I have finally got Seed.cs done and working so it now shows the Generation property on seeds entering the world.

However . . I still can't get my ListEntryGump.cs to compile without errors no matter how many variations I try.

I have tried the suggested "Seed theitem = Target as Seed" and many other variations but obviously at this level of scripting my skill falls off fast.

Here are my most recent Errors:
Code:
Errors:
 + Customs/Universal Storage Keys/Gumps/NewListEntryGump.cs:
    CS0118: Line 428: 'Server.Targeting.Target' is a 'type' but is used like a 'variable'
    CS1061: Line 445: 'Server.Engines.Plants.Seed' does not contain a definition for '_PlantType' and no extension method '_PlantType' accepting a first argument of type 'Server.Engines.Plants.Seed' could be found (are you missing a using directive or an assembly reference?)
    CS0103: Line 445: The name '_PlantType' does not exist in the current context
    CS1061: Line 445: 'Server.Engines.Plants.Seed' does not contain a definition for '_PlantType' and no extension method '_PlantType' accepting a first argument of type 'Server.Engines.Plants.Seed' could be found (are you missing a using directive or an assembly reference?)
    CS0103: Line 445: The name '_PlantType' does not exist in the current context
    CS1061: Line 445: 'Server.Engines.Plants.Seed' does not contain a definition for '_PlantType' and no extension method '_PlantType' accepting a first argument of type 'Server.Engines.Plants.Seed' could be found (are you missing a using directive or an assembly reference?)
    CS0103: Line 445: The name '_PlantType' does not exist in the current context
    CS1061: Line 451: 'Server.Engines.Plants.Seed' does not contain a definition for '_PlantType' and no extension method '_PlantType' accepting a first argument of type 'Server.Engines.Plants.Seed' could be found (are you missing a using directive or an assembly reference?)
    CS0103: Line 451: The name '_PlantType' does not exist in the current context
    CS1061: Line 451: 'Server.Engines.Plants.Seed' does not contain a definition for '_PlantType' and no extension method '_PlantType' accepting a first argument of type 'Server.Engines.Plants.Seed' could be found (are you missing a using directive or an assembly reference?)
    CS0103: Line 451: The name '_PlantType' does not exist in the current context
    CS1061: Line 451: 'Server.Engines.Plants.Seed' does not contain a definition for '_PlantType' and no extension method '_PlantType' accepting a first argument of type 'Server.Engines.Plants.Seed' could be found (are you missing a using directive or an assembly reference?)
    CS0103: Line 451: The name '_PlantType' does not exist in the current context

and . . here is my current ListEntryGump.cs (for now the only file throwing errors):
Code:
using System;
using System.Collections.Generic;
using Server;
using Server.Mobiles;
using Server.Network;
using Server.Targeting;
using Solaris.ItemStore;
using System.Collections;
using Server.Engines.Plants;

namespace Server.Gumps
{
    //list entry gump for displaying the contents of a list entry object
    public class ListEntryGump : Gump
    {
        PlayerMobile _Owner;
        ListEntry _ListEntry;

        //used for seeking around on the page
        int _Y = 25;
    
        //page size
        protected int _Height;
        protected int _Width;
    
        //maximum entry listing height, for multi-page calculation
        public int MaxEntryDisplayHeight{ get{ return 300; } }
    
        //line spacing between entries
        public int EntryLineSpacing{ get{ return 20; } }
    
        //page number that this gump is displaying
        protected int _Page;
    
        //this is determined based on the number of entries and the maximum number to display per page
        protected int _MaxPages;
    
        //these are used to truncate the store entry listing to fit only a subset on the page
        protected int _ListingHeight;
        protected int _ListingStart;
        protected int _ListingEnd;
    
        //a filtered entry list
        protected List<ItemListEntry> _FilteredEntries;
            
        //public accessors for gump refreshing
        public Mobile Owner{ get{ return _Owner; } }
        public int Page{ get{ return _Page; } }
        //public accessor to the list entry
        public ListEntry ListEntry{ get{ return _ListEntry; } }
    
        //static refresh method, used when withdrawing/adding
        public static bool RefreshGump( Mobile player )
        {
            return RefreshGump( player, null );
        }
    
        public static bool RefreshGump( Mobile player, ListEntry listentry )
        {
            //if this mobile has a list entry gump up
            if( player.HasGump( typeof( ListEntryGump ) ) )
            {
                ListEntryGump gump = (ListEntryGump)player.FindGump( typeof( ListEntryGump ) );
            
                //if this gump that's up is showing this list entry, or if none was specified, then refresh
                if( listentry == null || gump.ListEntry == listentry )
                {
                    //then, resend this gump!
                    player.SendGump( new ListEntryGump( gump ) );
                    return true;
                }
            }
        
            return false;
        }
    
        //gump refresh constructor
        public ListEntryGump( ListEntryGump oldgump ) : this( oldgump.Owner, oldgump.ListEntry, oldgump.Page )
        {
        }
    
        //default first page constructor
        public ListEntryGump( Mobile owner, ListEntry listentry ) : this( owner, listentry, 0 )
        {
        }
    
        //master constructor, with page number specified
        public ListEntryGump( Mobile owner, ListEntry listentry, int page ) : base( 50, 350 )
        {
            if( !( owner is PlayerMobile ) )
            {
                return;
            }
        
            _Owner = (PlayerMobile)owner;
            _ListEntry = listentry;
        
            //clear old gumps that are up
            _Owner.CloseGump( typeof( ListEntryGump ) );
        
            //set up the page
            AddPage(0);
        
            _Page = page;
        
            ApplyFilters();
        
            //determine page layout, sizes, and what gets displayed where
            DeterminePageLayout();

            //add the background                    
            AddBackground(0, 0, _Width, _Height, 9270);
            AddImageTiled(11, 10, _Width - 23, _Height - 20, 2624);
            //AddAlphaRegion(11, 10, _Width - 22, _Height - 20);
        
            AddTitle();
        
            if( !AddListEntryListing() )
            {
                //clear old gumps that are up
                _Owner.CloseGump( typeof( ListEntryGump ) );
                return;
            }
            if( _MaxPages > 1 )
            {
                AddPageButtons();
            }
        
            AddControlButtons();
        }
    
        protected void ApplyFilters()
        {
            _FilteredEntries = new List<ItemListEntry>();
        
        
            foreach( ItemListEntry entry in _ListEntry.ItemListEntries )
            {
                bool addentry = true;
            
                for( int i = 0; i < entry.Columns.Count; i++ )
                {
                    if( _ListEntry.FilterText[i] != null && _ListEntry.FilterText[i] != "" )
                    {
                        ItemListEntryColumn column = entry.Columns[i];
                    
                        if(  column.Text == null || column.Text.ToLower().IndexOf( _ListEntry.FilterText[i].ToLower() ) == -1 )
                        {
                            addentry = false;
                            break;
                        }
                    }
                }
            
                if( addentry )
                {
                    _FilteredEntries.Add( entry );
                }
            }
        }
    
        //this calculates all stuff needed to display the gump properly
        protected void DeterminePageLayout()
        {
            //page size
            if( _FilteredEntries == null || _FilteredEntries.Count == 0 )
            {
                _Height = 200;
            
                if( _ListEntry == null || _ListEntry.ItemListEntries == null || _ListEntry.ItemListEntries.Count == 0 )
                {
                    _Width = 400;
                }
                else
                {
                    _Width = _ListEntry.ItemListEntries[0].GumpWidth;
                }
            
                _MaxPages = 1;
                _Page = Math.Min( _MaxPages - 1, _Page );
            }
            else
            {
            
                //minimum spacing 20, maximum entry display height
                _ListingHeight = Math.Max( 20, Math.Min( MaxEntryDisplayHeight, _FilteredEntries.Count * EntryLineSpacing ) );
            
                //determine how many entries can fit on a given page
                int entriesperpage = MaxEntryDisplayHeight / EntryLineSpacing;
            
                //calculate max # of pages
                _MaxPages = _FilteredEntries.Count / entriesperpage + 1;
            
                _Page = Math.Min( _MaxPages - 1, _Page );
            
                _ListingStart = _Page * entriesperpage;
                _ListingEnd = (_Page + 1 ) * entriesperpage;
            
                _Height = 200 + + ( _MaxPages > 1 ? 30 : 0 ) + _ListingHeight;
                _Width = _FilteredEntries[0].GumpWidth;
            }
        }
    
        //this adds the title stuff for the gump
        protected void AddTitle()
        {
            if( _ListEntry == null )
            {
                return;
            }
        
            AddLabel( 20, _Y, 88, _ListEntry.Name );
            AddLabel( 120, _Y, 88, "Contents: " + _ListEntry.Amount.ToString() + "/" + _ListEntry.MaxAmount.ToString() );
            AddLabel( 262, _Y, 88, "(15 Seeds per page)" );
        
            _Y += 25;
        }

        //this adds the listing of all item stores
        protected bool AddListEntryListing()
        {
            if( _ListEntry == null || _ListEntry.ItemListEntries.Count == 0 )
            {
                return true;
            }

            //write the header info in
            ItemListEntry entry = _ListEntry.ItemListEntries[0];
        
            for( int j = 0; j < entry.Columns.Count; j++ )
            {
                AddLabel( 40 + entry.Columns[j].X, _Y, ( _ListEntry.FilterText[j] == null || _ListEntry.FilterText[j] == "" ? 1153 : 78 ), entry.Columns[j].Header );
                AddSortFilterControls( 40 + entry.Columns[j].X, _Y + 20, j, _ListEntry.FilterText[j] );
            }
        
            _Y += 40;
        
            //list off the items that can be displayed
            for( int i = _ListingStart; i < _ListingEnd && i < _FilteredEntries.Count; i++ )
            {
                entry = _FilteredEntries[i];
            
                //add withdrawal button - put buttonid offset of 100 to allow for control/sort/filter button id's uninterrupted
                AddButton( 20, _Y + 3, 0x4B9, 0x4B9, 100 + i, GumpButtonType.Reply, 0 );
            
                //Add the details about this entry
                for( int j = 0; j < entry.Columns.Count; j++ )
                {
                    if( entry.Columns[j].Width == 0 )
                    {
                        if( j < entry.Columns.Count - 1 )
                        {
                            entry.Columns[j].Width = entry.Columns[j + 1].X - entry.Columns[j].X - 10;
                        }
                        else
                        {
                            entry.Columns[j].Width = _Width - entry.Columns[j].X - 10;
                        }
                    }

                    AddLabelCropped( 40 + entry.Columns[j].X, _Y, entry.Columns[j].Width, 20, ( entry.Hue > 1 ? entry.Hue : 1153 ), entry.Columns[j].Text );
                }
            
                _Y += EntryLineSpacing;
            }
        
            return true;
        }
    
        protected void AddPageButtons()
        {
            //page buttons
            _Y = _Height - 90;
        
            if ( _Page > 0 )
            {
                AddButton( 20, _Y, 0x15E3, 0x15E7, 6, GumpButtonType.Reply, 0 );
            }
            else
            {
                AddImage( 20, _Y, 0x25EA );
            }
            AddLabel( 40, _Y, 88, "Previous Page" );
        
        
            if ( _Page < _MaxPages - 1 )
            {
                AddButton( _Width - 40, _Y, 0x15E1, 0x15E5, 7, GumpButtonType.Reply, 0 );
            }
            else
            {
                AddImage( _Width - 40, _Y, 0x25E6 );
            }
            AddLabel( _Width - 120, _Y, 88, "Next Page" );
        
            AddLabel( _Width / 2 - 10, _Y, 88, String.Format( "({0}/{1})", _Page + 1, _MaxPages ) );
        
        }

        protected void AddControlButtons()
        {
            if (_ListEntry.Name == "1st Generation")
            {
                _Y = _Height - 60;

                AddLabel( _Width / 3 + 45 , _Y, 1153, "Add a Seed" );
                AddButton( _Width / 3 + 25 , _Y + 5, 0x4B9, 0x4BA, 1, GumpButtonType.Reply, 0 );
        
                _Y += 20;

                AddLabel( _Width / 5 , _Y, 88, "Campion Flowers, Ferns, and TriBarrel Cactus" );
            }

            if (_ListEntry.Name == "2nd Generation")
            {
                _Y = _Height - 60;

                AddLabel( _Width / 3 + 45 , _Y, 1153, "Add a Seed" );
                AddButton( _Width / 3 + 25 , _Y + 5, 0x4B9, 0x4BA, 2, GumpButtonType.Reply, 0 );
        
                _Y += 20;

                AddLabel( _Width / 3 , _Y, 88, "Lilies and Water Plants" );
            }

            if (_ListEntry.Name == "3rd Generation")
            {
                _Y = _Height - 60;

                AddLabel( _Width / 3 + 45 , _Y, 1153, "Add a Seed" );
                AddButton( _Width / 3 + 25 , _Y + 5, 0x4B9, 0x4BA, 3, GumpButtonType.Reply, 0 );
        
                _Y += 20;

                AddLabel( _Width / 10 , _Y, 88, "Prickly Pear Cactus, Rushes, Small Palm, Snowdrops" );
            }

            if (_ListEntry.Name == "4th Generation")
            {
                _Y = _Height - 70;

                AddLabel( _Width / 3 + 45 , _Y, 1153, "Add a Seed" );
                AddButton( _Width / 3 + 25 , _Y + 5, 0x4B9, 0x4BA, 4, GumpButtonType.Reply, 0 );
        
                _Y += 20;

                AddLabel( _Width / 10 , _Y, 88, "Barrel Cactus, Bullrushes, Century Plant, Elephant Ears" );

                _Y += 20;

                AddLabel( _Width / 10 , _Y, 88, "Pampas Grass, PonyTail Palm, Poppies and Snake Plant" );

            }

            if ( (_ListEntry.Name != "1st Generation") && (_ListEntry.Name != "2nd Generation") && (_ListEntry.Name != "3rd Generation") && (_ListEntry.Name != "4th Generation") )

            {
                _Y = _Height - 60;
        
                AddLabel( _Width / 2 + 70 , _Y, 1153, "Add" );
                AddButton( _Width / 2 + 50, _Y + 5, 0x4B9, 0x4BA, 5, GumpButtonType.Reply, 0 );
        
                _Y += 30;

                AddLabel( _Width / 2 + 70 , _Y, 1153, "Fill from backpack" );
                AddButton( _Width / 2 + 50, _Y + 5, 0x4B9, 0x4BA, 6, GumpButtonType.Reply, 0 );
            }
        }
    
        //gump utilities
    
        public void AddTextField( int x, int y, int width, int height, int index, string text )
        {
            AddImageTiled( x - 2, y - 2, width + 4, height + 4, 0xA2C );
            //AddAlphaRegion( x -2, y - 2, width + 4, height + 4 );
            AddTextEntry( x + 2, y + 2, width - 4, height - 4, 1153, index, text );
        }
    
        public string GetTextField( RelayInfo info, int index )
        {
            TextRelay relay = info.GetTextEntry( index );
            return ( relay == null ? null : relay.Text.Trim() );
        }
    
        //this adds sort/filter components at the specified column location and specified column index
        public void AddSortFilterControls( int x, int y, int index, string filtertext )
        {
            //sort buttons
            AddButton( x, y, 0x15E0, 0x15E4, 10 + 10*index, GumpButtonType.Reply, 0 );  //Ascending
            AddButton( x + 15, y, 0x15E2, 0x15E6, 10 + 10*index + 1, GumpButtonType.Reply, 0 );  //Decending
        
            y = _Height - 90;
        
            if( _MaxPages > 1 )
            {
                y -= 30;
            }

            if ( (_ListEntry.Name != "1st Generation") && (_ListEntry.Name != "2nd Generation") && (_ListEntry.Name != "3rd Generation") && (_ListEntry.Name != "4th Generation") )

            {
                AddTextField( x, y, 50, 20, index, filtertext );
                AddButton( x + 55, y, 0x15E1, 0x15E5, 10 + 10*index + 2, GumpButtonType.Reply, 0 );
            }
        }
    
        public override void OnResponse( NetState sender, RelayInfo info )
        {
            if( _ListEntry == null || !_ListEntry.CanUse( _Owner ) )
            {
                return;
            }
        
            //store flags
            int buttonid = info.ButtonID;
        
            //right click
            if( buttonid == 0 )
            {
                return;
            }

        //add button
            if( buttonid == 1 )
            {

//LINE# 428 Follows:
                Seed theitem = Target as Seed;

                if ( theitem == null )
                {
                    return;
                }

                if ( !(theitem is Seed) )
                {
                    Owner.SendMessage(33, "That is not a Seed.");
                    return;
                }


                // 1st Generation:
                if (_ListEntry.Name == "1st Generation")
                {
                    if ( !(theitem._PlantType == _PlantType.CampionFlowers) && !(theitem._PlantType == _PlantType.Fern) && !(theitem._PlantType == _PlantType.TribarrelCactus) )
                    {
                        _Owner.SendMessage(33, "That seed is not a 1st Generation seed.");
                            return;
                    }

                    if ( (theitem._PlantType == _PlantType.CampionFlowers) || (theitem._PlantType == _PlantType.Fern) || (theitem._PlantType == _PlantType.TribarrelCactus) )
                    {
                        _ListEntry.AddItem( _Owner );
                        _Owner.SendMessage( "You add the 1st Generation seed" );
                        //refresh the gump
                        _Owner.SendGump( new ListEntryGump( this ) );
                        return;
                    }
                }
            }

            // 2nd Generation:
            if( buttonid == 2 )
            {
/*                if (_ListEntry.Name == "2nd Generation")
                {
                    if ( !(_Owner.Target._PlantType == _PlantType.Lilies) && !(_Owner.Target._PlantType == _PlantType.WaterPlant) )
                    {
                        _Owner.SendMessage( "That is not a 2nd Generation seed" );
                    }

                    if ( (_Owner.Target._PlantType == _PlantType.Lilies) || (_Owner.Target._PlantType == _PlantType.WaterPlant) )
                    {
                        _ListEntry.AddItem( _Owner );
                        _Owner.SendMessage( "You add the 2nd Generation seed" );
                        //refresh the gump
                        _Owner.SendGump( new ListEntryGump( this ) );
                        return;
                    }
                }
*/
            }

            // 3rd Generation:
            if( buttonid == 3 )
            {
/*                if (_ListEntry.Name == "3rd Generation")
                {
                    if ( !(_Owner.Target._PlantType == _PlantType.PricklyPearCactus) && !(_Owner.Target._PlantType == _PlantType.Rushes) && !(_Owner.Target._PlantType == _PlantType.SmallPalm) && !(_Owner.Target._PlantType == _PlantType.Snowdrops) )
                    {
                        _Owner.SendMessage( "That is not a 3rd Generation seed" );
                    }

                    if ( (_Owner.Target._PlantType == _PlantType.PricklyPearCactus) || (_Owner.Target._PlantType == _PlantType.Rushes) || (_Owner.Target._PlantType == _PlantType.SmallPalm) || (_Owner.Target._PlantType == _PlantType.Snowdrops) )
                    {
                        _ListEntry.AddItem( _Owner );
                        _Owner.SendMessage( "You add the 3rd Generation seed" );
                        //refresh the gump
                        _Owner.SendGump( new ListEntryGump( this ) );
                        return;
                    }
                }
*/
            }

            // 4th Generation:
            if( buttonid == 4 )
            {
/*                if (_ListEntry.Name == "4th Generation")
                {
                    if ( !(_Owner.Target._PlantType == _PlantType.BarrelCactus) && !(_Owner.Target._PlantType == _PlantType.Bullrushes) && !(_Owner.Target._PlantType == _PlantType.CenturyPlant) && !(_Owner.Target._PlantType == _PlantType.ElephantEarPlant) && !(_Owner.Target._PlantType == _PlantType.PampasGrass) && !(_Owner.Target._PlantType == _PlantType.PonytailPalm) && !(_Owner.Target._PlantType == _PlantType.Poppies) && !(_Owner.Target._PlantType == _PlantType.SnakePlant) )
                    {
                        _Owner.SendMessage( "That is not a 3rd Generation seed" );
                    }

                    if ( (_Owner.Target._PlantType == _PlantType.BarrelCactus) || (_Owner.Target._PlantType == _PlantType.Bullrushes) || (_Owner.Target._PlantType == _PlantType.CenturyPlant) || (_Owner.Target._PlantType == _PlantType.ElephantEarPlant) || (_Owner.Target._PlantType == _PlantType.PampasGrass) || (_Owner.Target._PlantType == _PlantType.PonytailPalm) || (_Owner.Target._PlantType == _PlantType.Poppies) || (_Owner.Target._PlantType == _PlantType.SnakePlant) )
                    {
                        _ListEntry.AddItem( _Owner );
                        _Owner.SendMessage( "You add the 3rd Generation seed" );
                        //refresh the gump
                        _Owner.SendGump( new ListEntryGump( this ) );
                        return;
                    }
                }
*/
            }

            //add item from backpack button
            if( buttonid == 5 )
            {
                _ListEntry.FillFromBackpack( _Owner );
            
                _Owner.SendGump( new ListEntryGump( this ) );
                return;
            }

            //fill from backpack button
            if( buttonid == 6 )
            {
                _ListEntry.FillFromBackpack( _Owner );
            
                _Owner.SendGump( new ListEntryGump( this ) );
                return;
            }

            //previous page button
            if( buttonid == 7 )
            {
                if( _Page > 0 )
                {
                    _Owner.SendGump( new ListEntryGump( _Owner, _ListEntry, _Page - 1 ) );
                }
                return;
            }
        
            //next page button
            if( buttonid == 8 )
            {
                if( _Page < _MaxPages - 1 )
                {
                    _Owner.SendGump( new ListEntryGump( _Owner, _ListEntry, _Page + 1 ) );
                }
                return;
            }
        
            //sort/filter buttons
            if( buttonid >= 10 && buttonid < 100 )
            {
                int columnnum = ( buttonid - 10 ) / 10;
                int buttontype = ( buttonid - 10 ) % 10;
            
                //if it's a sort button
                if( buttontype < 2 )
                {
                    ItemListEntry.SortIndex = columnnum;
                    ItemListEntry.SortOrder = ( buttontype == 0 ? -1 : 1 );
                
                    _ListEntry.ItemListEntries.Sort();
                }
                else
                {
                    //apply filters
                    for( int i = 0; i < 10; i++ )
                    {
                        _ListEntry.FilterText[i] = GetTextField( info, i );
                    }
                }

                _Owner.SendGump( new ListEntryGump( this ) );
                return;
            }

            //any button that is left is a withdraw request
            //offset of 100 between the passed value and the list index
        
            buttonid -= 100;
        
            if( buttonid >= 0 && buttonid < _FilteredEntries.Count )
            {
                _ListEntry.WithdrawItem( _Owner, _FilteredEntries[ buttonid ] );
            }
        
            _Owner.SendGump( new ListEntryGump( this ) );
        }
    }
}

Sorry to keep coming back to the 'well' on this but I sure do appreciate the community eyes on this for me.
 
Well I'm still at it with no luck. Seems my scripting talent is just not up to the task.

Can anyone give me a lesson here please?

Here are my current Errors:
Code:
Errors:
 + Customs/Universal Storage Keys/Gumps/NewListEntryGump.cs:
    CS1061: Line 442: 'Server.Targeting.Target' does not contain a definition for '_PlantType' and no extension method '_PlantType' accepting a first argument of type 'Server.Targeting.Target' could be found (are you missing a using directive or an assembly reference?)
    CS0103: Line 442: The name '_PlantType' does not exist in the current context
    CS1061: Line 442: 'Server.Targeting.Target' does not contain a definition for '_PlantType' and no extension method '_PlantType' accepting a first argument of type 'Server.Targeting.Target' could be found (are you missing a using directive or an assembly reference?)
    CS0103: Line 442: The name '_PlantType' does not exist in the current context
    CS1061: Line 442: 'Server.Targeting.Target' does not contain a definition for '_PlantType' and no extension method '_PlantType' accepting a first argument of type 'Server.Targeting.Target' could be found (are you missing a using directive or an assembly reference?)
    CS0103: Line 442: The name '_PlantType' does not exist in the current context
    CS1061: Line 448: 'Server.Targeting.Target' does not contain a definition for '_PlantType' and no extension method '_PlantType' accepting a first argument of type 'Server.Targeting.Target' could be found (are you missing a using directive or an assembly reference?)
    CS0103: Line 448: The name '_PlantType' does not exist in the current context
    CS1061: Line 448: 'Server.Targeting.Target' does not contain a definition for '_PlantType' and no extension method '_PlantType' accepting a first argument of type 'Server.Targeting.Target' could be found (are you missing a using directive or an assembly reference?)
    CS0103: Line 448: The name '_PlantType' does not exist in the current context
    CS1061: Line 448: 'Server.Targeting.Target' does not contain a definition for '_PlantType' and no extension method '_PlantType' accepting a first argument of type 'Server.Targeting.Target' could be found (are you missing a using directive or an assembly reference?)
    CS0103: Line 448: The name '_PlantType' does not exist in the current context

and . . Here is the part of the script where I start falling down:
Code:
        public override void OnResponse( NetState sender, RelayInfo info )
        {
            Mobile _Owner = sender.Mobile;

            if( _ListEntry == null || !_ListEntry.CanUse( _Owner ) )
            {
                return;
            }
            
            //store flags
            int buttonid = info.ButtonID;
            
            //right click
            if( buttonid == 0 )
            {
                return;
            }

        //add button
            if( buttonid == 1 )
            {


                if ( !(_Owner.Target is Seed) )
                {
                    Owner.SendMessage(33, "That is not a Seed.");
                    return;
                }

                // 1st Generation:
                if (_ListEntry.Name == "1st Generation")
                {
//Line 442 Follows:
                    if ( !(_Owner.Target._PlantType == _PlantType.CampionFlowers) && !(_Owner.Target._PlantType == _PlantType.Fern) && !(_Owner.Target._PlantType == _PlantType.TribarrelCactus) )
                    {
                        _Owner.SendMessage(33, "That seed is not a 1st Generation seed.");
                            return;
                    }

                    if ( (_Owner.Target._PlantType == _PlantType.CampionFlowers) || (_Owner.Target._PlantType == _PlantType.Fern) || (_Owner.Target._PlantType == _PlantType.TribarrelCactus) )
                    {
                        _ListEntry.AddItem( _Owner );
                        _Owner.SendMessage( "You add the 1st Generation seed" );
                        //refresh the gump
                        _Owner.SendGump( new ListEntryGump( this ) );
                        return;
                    }
                }
            }

and . . Here is the full script:
Code:
using System;
using Server;
using Server.Items;
using Server.Mobiles;
using Server.Network;
using Server.Targeting;
using Solaris.ItemStore;
using System.Collections;
using Server.ContextMenus;
using Server.Engines.Plants;
using System.Collections.Generic;

namespace Server.Gumps
{
    //list entry gump for displaying the contents of a list entry object
    public class ListEntryGump : Gump
    {
        PlayerMobile _Owner;
        ListEntry _ListEntry;

        //used for seeking around on the page
        int _Y = 25;
        
        //page size
        protected int _Height;
        protected int _Width;
        
        //maximum entry listing height, for multi-page calculation
        public int MaxEntryDisplayHeight{ get{ return 300; } }
        
        //line spacing between entries
        public int EntryLineSpacing{ get{ return 20; } }
        
        //page number that this gump is displaying
        protected int _Page;
        
        //this is determined based on the number of entries and the maximum number to display per page
        protected int _MaxPages;
        
        //these are used to truncate the store entry listing to fit only a subset on the page
        protected int _ListingHeight;
        protected int _ListingStart;
        protected int _ListingEnd;
        
        //a filtered entry list
        protected List<ItemListEntry> _FilteredEntries;
                
        //public accessors for gump refreshing
        public Mobile Owner{ get{ return _Owner; } }
        public int Page{ get{ return _Page; } }
        //public accessor to the list entry
        public ListEntry ListEntry{ get{ return _ListEntry; } }
        
        //static refresh method, used when withdrawing/adding
        public static bool RefreshGump( Mobile player )
        {
            return RefreshGump( player, null );
        }
        
        public static bool RefreshGump( Mobile player, ListEntry listentry )
        {
            //if this mobile has a list entry gump up
            if( player.HasGump( typeof( ListEntryGump ) ) )
            {
                ListEntryGump gump = (ListEntryGump)player.FindGump( typeof( ListEntryGump ) );
                
                //if this gump that's up is showing this list entry, or if none was specified, then refresh
                if( listentry == null || gump.ListEntry == listentry )
                {
                    //then, resend this gump!
                    player.SendGump( new ListEntryGump( gump ) );
                    return true;
                }
            }
            
            return false;
        }
        
        //gump refresh constructor
        public ListEntryGump( ListEntryGump oldgump ) : this( oldgump.Owner, oldgump.ListEntry, oldgump.Page )
        {
        }
        
        //default first page constructor
        public ListEntryGump( Mobile owner, ListEntry listentry ) : this( owner, listentry, 0 )
        {
        }
        
        //master constructor, with page number specified
        public ListEntryGump( Mobile owner, ListEntry listentry, int page ) : base( 50, 350 )
        {
            if( !( owner is PlayerMobile ) )
            {
                return;
            }
            
            _Owner = (PlayerMobile)owner;
            _ListEntry = listentry;
            
            //clear old gumps that are up
            _Owner.CloseGump( typeof( ListEntryGump ) );
            
            //set up the page
            AddPage(0);
            
            _Page = page;
            
            ApplyFilters();
            
            //determine page layout, sizes, and what gets displayed where
            DeterminePageLayout();

            //add the background                        
            AddBackground(0, 0, _Width, _Height, 9270);
            AddImageTiled(11, 10, _Width - 23, _Height - 20, 2624);
            //AddAlphaRegion(11, 10, _Width - 22, _Height - 20);
            
            AddTitle();
            
            if( !AddListEntryListing() )
            {
                //clear old gumps that are up
                _Owner.CloseGump( typeof( ListEntryGump ) );
                return;
            }
            if( _MaxPages > 1 )
            {
                AddPageButtons();
            }
            
            AddControlButtons();
        }
        
        protected void ApplyFilters()
        {
            _FilteredEntries = new List<ItemListEntry>();
            
            
            foreach( ItemListEntry entry in _ListEntry.ItemListEntries )
            {
                bool addentry = true;
                
                for( int i = 0; i < entry.Columns.Count; i++ )
                {
                    if( _ListEntry.FilterText[i] != null && _ListEntry.FilterText[i] != "" )
                    {
                        ItemListEntryColumn column = entry.Columns[i];
                        
                        if(  column.Text == null || column.Text.ToLower().IndexOf( _ListEntry.FilterText[i].ToLower() ) == -1 )
                        {
                            addentry = false;
                            break;
                        }
                    }
                }
                
                if( addentry )
                {
                    _FilteredEntries.Add( entry );
                }
            }
        }
        
        //this calculates all stuff needed to display the gump properly
        protected void DeterminePageLayout()
        {
            //page size
            if( _FilteredEntries == null || _FilteredEntries.Count == 0 )
            {
                _Height = 200;
                
                if( _ListEntry == null || _ListEntry.ItemListEntries == null || _ListEntry.ItemListEntries.Count == 0 )
                {
                    _Width = 400;
                }
                else
                {
                    _Width = _ListEntry.ItemListEntries[0].GumpWidth;
                }
                
                _MaxPages = 1;
                _Page = Math.Min( _MaxPages - 1, _Page );
            }
            else
            {
                
                //minimum spacing 20, maximum entry display height
                _ListingHeight = Math.Max( 20, Math.Min( MaxEntryDisplayHeight, _FilteredEntries.Count * EntryLineSpacing ) );
                
                //determine how many entries can fit on a given page
                int entriesperpage = MaxEntryDisplayHeight / EntryLineSpacing;
                
                //calculate max # of pages
                _MaxPages = _FilteredEntries.Count / entriesperpage + 1;
                
                _Page = Math.Min( _MaxPages - 1, _Page );
                
                _ListingStart = _Page * entriesperpage;
                _ListingEnd = (_Page + 1 ) * entriesperpage;
                
                _Height = 200 + + ( _MaxPages > 1 ? 30 : 0 ) + _ListingHeight;
                _Width = _FilteredEntries[0].GumpWidth;
            }
        }
        
        //this adds the title stuff for the gump
        protected void AddTitle()
        {
            if( _ListEntry == null )
            {
                return;
            }
            
            AddLabel( 20, _Y, 88, _ListEntry.Name );
            AddLabel( 120, _Y, 88, "Contents: " + _ListEntry.Amount.ToString() + "/" + _ListEntry.MaxAmount.ToString() );
            AddLabel( 262, _Y, 88, "(15 Seeds per page)" );
            
            _Y += 25;
        }

        //this adds the listing of all item stores
        protected bool AddListEntryListing()
        {
            if( _ListEntry == null || _ListEntry.ItemListEntries.Count == 0 )
            {
                return true;
            }

            //write the header info in
            ItemListEntry entry = _ListEntry.ItemListEntries[0];
            
            for( int j = 0; j < entry.Columns.Count; j++ )
            {
                AddLabel( 40 + entry.Columns[j].X, _Y, ( _ListEntry.FilterText[j] == null || _ListEntry.FilterText[j] == "" ? 1153 : 78 ), entry.Columns[j].Header );
                AddSortFilterControls( 40 + entry.Columns[j].X, _Y + 20, j, _ListEntry.FilterText[j] );
            }
            
            _Y += 40;
            
            //list off the items that can be displayed
            for( int i = _ListingStart; i < _ListingEnd && i < _FilteredEntries.Count; i++ )
            {
                entry = _FilteredEntries[i];
                
                //add withdrawal button - put buttonid offset of 100 to allow for control/sort/filter button id's uninterrupted
                AddButton( 20, _Y + 3, 0x4B9, 0x4B9, 100 + i, GumpButtonType.Reply, 0 );
                
                //Add the details about this entry
                for( int j = 0; j < entry.Columns.Count; j++ )
                {
                    if( entry.Columns[j].Width == 0 )
                    {
                        if( j < entry.Columns.Count - 1 )
                        {
                            entry.Columns[j].Width = entry.Columns[j + 1].X - entry.Columns[j].X - 10;
                        }
                        else
                        {
                            entry.Columns[j].Width = _Width - entry.Columns[j].X - 10;
                        }
                    }

                    AddLabelCropped( 40 + entry.Columns[j].X, _Y, entry.Columns[j].Width, 20, ( entry.Hue > 1 ? entry.Hue : 1153 ), entry.Columns[j].Text );
                }
                
                _Y += EntryLineSpacing;
            }
            
            return true;
        }
        
        protected void AddPageButtons()
        {
            //page buttons
            _Y = _Height - 90;
            
            if ( _Page > 0 ) 
            {
                AddButton( 20, _Y, 0x15E3, 0x15E7, 6, GumpButtonType.Reply, 0 ); 
            }
            else 
            {
                AddImage( 20, _Y, 0x25EA ); 
            }
            AddLabel( 40, _Y, 88, "Previous Page" );
            
            
            if ( _Page < _MaxPages - 1 ) 
            {
                AddButton( _Width - 40, _Y, 0x15E1, 0x15E5, 7, GumpButtonType.Reply, 0 ); 
            }
            else 
            {
                AddImage( _Width - 40, _Y, 0x25E6 ); 
            }
            AddLabel( _Width - 120, _Y, 88, "Next Page" );
            
            AddLabel( _Width / 2 - 10, _Y, 88, String.Format( "({0}/{1})", _Page + 1, _MaxPages ) );
            
        }

        protected void AddControlButtons()
        {
            if (_ListEntry.Name == "1st Generation")
            {
                _Y = _Height - 60;

                AddLabel( _Width / 3 + 45 , _Y, 1153, "Add a Seed" );
                AddButton( _Width / 3 + 25 , _Y + 5, 0x4B9, 0x4BA, 1, GumpButtonType.Reply, 0 );
            
                _Y += 20;

                AddLabel( _Width / 5 , _Y, 88, "Campion Flowers, Ferns, and TriBarrel Cactus" );
            }

            if (_ListEntry.Name == "2nd Generation")
            {
                _Y = _Height - 60;

                AddLabel( _Width / 3 + 45 , _Y, 1153, "Add a Seed" );
                AddButton( _Width / 3 + 25 , _Y + 5, 0x4B9, 0x4BA, 2, GumpButtonType.Reply, 0 );
            
                _Y += 20;

                AddLabel( _Width / 3 , _Y, 88, "Lilies and Water Plants" );
            }

            if (_ListEntry.Name == "3rd Generation")
            {
                _Y = _Height - 60;

                AddLabel( _Width / 3 + 45 , _Y, 1153, "Add a Seed" );
                AddButton( _Width / 3 + 25 , _Y + 5, 0x4B9, 0x4BA, 3, GumpButtonType.Reply, 0 );
            
                _Y += 20;

                AddLabel( _Width / 10 , _Y, 88, "Prickly Pear Cactus, Rushes, Small Palm, Snowdrops" );
            }

            if (_ListEntry.Name == "4th Generation")
            {
                _Y = _Height - 70;

                AddLabel( _Width / 3 + 45 , _Y, 1153, "Add a Seed" );
                AddButton( _Width / 3 + 25 , _Y + 5, 0x4B9, 0x4BA, 4, GumpButtonType.Reply, 0 );
            
                _Y += 20;

                AddLabel( _Width / 10 , _Y, 88, "Barrel Cactus, Bullrushes, Century Plant, Elephant Ears" );

                _Y += 20;

                AddLabel( _Width / 10 , _Y, 88, "Pampas Grass, PonyTail Palm, Poppies and Snake Plant" );

            }

            if ( (_ListEntry.Name != "1st Generation") && (_ListEntry.Name != "2nd Generation") && (_ListEntry.Name != "3rd Generation") && (_ListEntry.Name != "4th Generation") )

            {
                _Y = _Height - 60;
            
                AddLabel( _Width / 2 + 70 , _Y, 1153, "Add" );
                AddButton( _Width / 2 + 50, _Y + 5, 0x4B9, 0x4BA, 5, GumpButtonType.Reply, 0 );
            
                _Y += 30;

                AddLabel( _Width / 2 + 70 , _Y, 1153, "Fill from backpack" );
                AddButton( _Width / 2 + 50, _Y + 5, 0x4B9, 0x4BA, 6, GumpButtonType.Reply, 0 );
            }
        }
        
        //gump utilities
        
        public void AddTextField( int x, int y, int width, int height, int index, string text )
        {
            AddImageTiled( x - 2, y - 2, width + 4, height + 4, 0xA2C );
            //AddAlphaRegion( x -2, y - 2, width + 4, height + 4 );
            AddTextEntry( x + 2, y + 2, width - 4, height - 4, 1153, index, text );
        }
        
        public string GetTextField( RelayInfo info, int index )
        {
            TextRelay relay = info.GetTextEntry( index );
            return ( relay == null ? null : relay.Text.Trim() );
        }
        
        //this adds sort/filter components at the specified column location and specified column index
        public void AddSortFilterControls( int x, int y, int index, string filtertext )
        {
            //sort buttons
            AddButton( x, y, 0x15E0, 0x15E4, 10 + 10*index, GumpButtonType.Reply, 0 );  //Ascending
            AddButton( x + 15, y, 0x15E2, 0x15E6, 10 + 10*index + 1, GumpButtonType.Reply, 0 );  //Decending
            
            y = _Height - 90;
            
            if( _MaxPages > 1 )
            {
                y -= 30;
            }

            if ( (_ListEntry.Name != "1st Generation") && (_ListEntry.Name != "2nd Generation") && (_ListEntry.Name != "3rd Generation") && (_ListEntry.Name != "4th Generation") )

            {
                AddTextField( x, y, 50, 20, index, filtertext );
                AddButton( x + 55, y, 0x15E1, 0x15E5, 10 + 10*index + 2, GumpButtonType.Reply, 0 );
            }
        }
        
        public override void OnResponse( NetState sender, RelayInfo info )
        {
            Mobile _Owner = sender.Mobile;

            if( _ListEntry == null || !_ListEntry.CanUse( _Owner ) )
            {
                return;
            }
            
            //store flags
            int buttonid = info.ButtonID;
            
            //right click
            if( buttonid == 0 )
            {
                return;
            }

        //add button
            if( buttonid == 1 )
            {


                if ( !(_Owner.Target is Seed) )
                {
                    Owner.SendMessage(33, "That is not a Seed.");
                    return;
                }

                // 1st Generation:
                if (_ListEntry.Name == "1st Generation")
                {
//Line 442 Follows:
                    if ( !(_Owner.Target._PlantType == _PlantType.CampionFlowers) && !(_Owner.Target._PlantType == _PlantType.Fern) && !(_Owner.Target._PlantType == _PlantType.TribarrelCactus) )
                    {
                        _Owner.SendMessage(33, "That seed is not a 1st Generation seed.");
                            return;
                    }

                    if ( (_Owner.Target._PlantType == _PlantType.CampionFlowers) || (_Owner.Target._PlantType == _PlantType.Fern) || (_Owner.Target._PlantType == _PlantType.TribarrelCactus) )
                    {
                        _ListEntry.AddItem( _Owner );
                        _Owner.SendMessage( "You add the 1st Generation seed" );
                        //refresh the gump
                        _Owner.SendGump( new ListEntryGump( this ) );
                        return;
                    }
                }
            }


            // 2nd Generation:
            if( buttonid == 2 )
            {
/*                if (_ListEntry.Name == "2nd Generation")
                {
                    if ( !(_Owner.Target._PlantType == _PlantType.Lilies) && !(_Owner.Target._PlantType == _PlantType.WaterPlant) )
                    {
                        _Owner.SendMessage( "That is not a 2nd Generation seed" );
                    }

                    if ( (_Owner.Target._PlantType == _PlantType.Lilies) || (_Owner.Target._PlantType == _PlantType.WaterPlant) )
                    {
                        _ListEntry.AddItem( _Owner );
                        _Owner.SendMessage( "You add the 2nd Generation seed" );
                        //refresh the gump
                        _Owner.SendGump( new ListEntryGump( this ) );
                        return;
                    }
                }
*/
            }

            // 3rd Generation:
            if( buttonid == 3 )
            {
/*                if (_ListEntry.Name == "3rd Generation")
                {
                    if ( !(_Owner.Target._PlantType == _PlantType.PricklyPearCactus) && !(_Owner.Target._PlantType == _PlantType.Rushes) && !(_Owner.Target._PlantType == _PlantType.SmallPalm) && !(_Owner.Target._PlantType == _PlantType.Snowdrops) )
                    {
                        _Owner.SendMessage( "That is not a 3rd Generation seed" );
                    }

                    if ( (_Owner.Target._PlantType == _PlantType.PricklyPearCactus) || (_Owner.Target._PlantType == _PlantType.Rushes) || (_Owner.Target._PlantType == _PlantType.SmallPalm) || (_Owner.Target._PlantType == _PlantType.Snowdrops) )
                    {
                        _ListEntry.AddItem( _Owner );
                        _Owner.SendMessage( "You add the 3rd Generation seed" );
                        //refresh the gump
                        _Owner.SendGump( new ListEntryGump( this ) );
                        return;
                    }
                }
*/
            }

            // 4th Generation:
            if( buttonid == 4 )
            {
/*                if (_ListEntry.Name == "4th Generation")
                {
                    if ( !(_Owner.Target._PlantType == _PlantType.BarrelCactus) && !(_Owner.Target._PlantType == _PlantType.Bullrushes) && !(_Owner.Target._PlantType == _PlantType.CenturyPlant) && !(_Owner.Target._PlantType == _PlantType.ElephantEarPlant) && !(_Owner.Target._PlantType == _PlantType.PampasGrass) && !(_Owner.Target._PlantType == _PlantType.PonytailPalm) && !(_Owner.Target._PlantType == _PlantType.Poppies) && !(_Owner.Target._PlantType == _PlantType.SnakePlant) )
                    {
                        _Owner.SendMessage( "That is not a 3rd Generation seed" );
                    }

                    if ( (_Owner.Target._PlantType == _PlantType.BarrelCactus) || (_Owner.Target._PlantType == _PlantType.Bullrushes) || (_Owner.Target._PlantType == _PlantType.CenturyPlant) || (_Owner.Target._PlantType == _PlantType.ElephantEarPlant) || (_Owner.Target._PlantType == _PlantType.PampasGrass) || (_Owner.Target._PlantType == _PlantType.PonytailPalm) || (_Owner.Target._PlantType == _PlantType.Poppies) || (_Owner.Target._PlantType == _PlantType.SnakePlant) )
                    {
                        _ListEntry.AddItem( _Owner );
                        _Owner.SendMessage( "You add the 3rd Generation seed" );
                        //refresh the gump
                        _Owner.SendGump( new ListEntryGump( this ) );
                        return;
                    }
                }
*/
            }

            //add item from backpack button
            if( buttonid == 5 )
            {
                _ListEntry.FillFromBackpack( _Owner );
                
                _Owner.SendGump( new ListEntryGump( this ) );
                return;
            }

            //fill from backpack button
            if( buttonid == 6 )
            {
                _ListEntry.FillFromBackpack( _Owner );
                
                _Owner.SendGump( new ListEntryGump( this ) );
                return;
            }

            //previous page button
            if( buttonid == 7 )
            {
                if( _Page > 0 )
                {
                    _Owner.SendGump( new ListEntryGump( _Owner, _ListEntry, _Page - 1 ) );
                }
                return;
            }
            
            //next page button
            if( buttonid == 8 )
            {
                if( _Page < _MaxPages - 1 )
                {
                    _Owner.SendGump( new ListEntryGump( _Owner, _ListEntry, _Page + 1 ) );
                }
                return;
            }
            
            //sort/filter buttons
            if( buttonid >= 10 && buttonid < 100 )
            {
                int columnnum = ( buttonid - 10 ) / 10;
                int buttontype = ( buttonid - 10 ) % 10;
                
                //if it's a sort button
                if( buttontype < 2 )
                {
                    ItemListEntry.SortIndex = columnnum;
                    ItemListEntry.SortOrder = ( buttontype == 0 ? -1 : 1 );
                    
                    _ListEntry.ItemListEntries.Sort();
                }
                else 
                {
                    //apply filters
                    for( int i = 0; i < 10; i++ )
                    {
                        _ListEntry.FilterText[i] = GetTextField( info, i );
                    }
                }

                _Owner.SendGump( new ListEntryGump( this ) );
                return;
            }

            //any button that is left is a withdraw request
            //offset of 100 between the passed value and the list index
            
            buttonid -= 100;
            
            if( buttonid >= 0 && buttonid < _FilteredEntries.Count )
            {
                _ListEntry.WithdrawItem( _Owner, _FilteredEntries[ buttonid ] );
            }
            
            _Owner.SendGump( new ListEntryGump( this ) );
        }
    }
}

If anyone can see a solution I would really appreciate it.

Many Thanks
*bows*
 
Back