Jump to content
Sign In to follow this  
potorium

a change to simpak if possible please

3 posts in this topic Last Reply

Highlighted Posts

Posted:
Last Online:  
 

i cant change, and wouldn't want to, the repo code. But i've modded simpak slightly

 

 

it allows me to randomly type in the fnv hash calculator and auto filter the tgi grid in the main window by the calculators result. Am sure much easier solution to this but it works. easy to check stuff like changing firebase_t1 -> firebaset1 without copy/pasting the hashes over.

 

viewfnv.xmal.cs

// added class attribute
 MainWindow mymw;
//added a constructor overload
        public ViewFNV(MainWindow mw)
        {
            mymw = mw;
            InitializeComponent();
        }
//changed textBox1_TextChanged method 
        private void textBox1_TextChanged(object sender, TextChangedEventArgs e)
        {
            textBox2.Text = StringHelpers.FNV(textBox1.Text).ToHex();
            textBox3.Text = StringHelpers.FNV(textBox1.Text, true).ToHex();
            if (mymw != null)
            {
                mymw.comboboxInstances.Text = textBox2.Text;
                mymw.filterTextBoxes_TextChanged();
            }
        }

mainwindow.xaml.cs

//added method overload
        public void filterTextBoxes_TextChanged()
        {
            view.Refresh();
        }

//changed method mnuFNV_Click
 public void mnuFNV_Click(object sender, RoutedEventArgs e)
        {
            new ViewFNV(this).Show();
        }

ViewFNV.xaml.zip

v 0.257.1 potos ViewFNV and mainwindow.xaml.cs.zip

Share this post


Link to post
  • Original Poster
  • Posted:
    Last Online:  
     

    unless someone with more skills does this, i'll try tomorrow.

     

    Add a fnv calculator string input box to the main window so filtering by 'unknown strings' can be done directly and not need both views open like the hack in my OP

    Share this post


    Link to post
  • Original Poster
  • Posted:
    Last Online:  
     
     int IComparer.Compare(object a, object b)
            {
                DatabaseIndex x = (DatabaseIndex)a, y = (DatabaseIndex)b;
                if (Direction != ListSortDirection.Ascending)
                {
                    DatabaseIndex t = x;
                    x = y;
                    y = t;
                }
    
                switch ((string)Column.Header)
                {
                    //added case "File Type":
                    case "File Type":
                    case "TypeName":
                        return x.TypeName.CompareTo(y.TypeName);
                    //added case "GroupContainer":
                    case "Group Container":
                    case "GroupContainer":
                        return x.GroupName.CompareTo(y.GroupName);
                    //added case instance
                    case "Instance":
                    case "Instance Name":
                        return x.InstanceId.CompareTo(y.InstanceId);
                    /* if(x.InstanceName != null)
                         return x.InstanceName.CompareTo(y.InstanceName);
                     return 0;*/

    botched mainwindow.xaml.cs so tgi grid sorts (a-z-a) on column header

    Share this post


    Link to post

    Sign In or register to comment...

    To comment in reply, you must be a community member

    Sign In  

    Already have an account? Sign in here.

    Sign In Now

    Create an Account  

    Sign up to join our friendly community. It's easy!  

    Register a New Account

    Sign In to follow this  
    • Recently Browsing   0 members

      No registered users viewing this page.

    ×

    Thank You for the Continued Support!

    Simtropolis depends on donations to fund site maintenance costs.
    Without your support, we just would not be in our 24th year online!  You really help make this a great community. *:thumb:

    But we still need your support to stay online. If you're able to, please consider a donation to help us stay up and running. This helps sustain a platform where we can share our community creations for years to come.

    Make a Donation, Get a Gift!

    Expand your city with the best from the Simtropolis Exchange.
    Make a Donation and get one or all three discs today!

    STEX Collections

    By way of a "Thank You" gift, we'd like to send you our STEX Collector's DVD. It's some of the best buildings, lots, maps and mods collected for you over the years. Check out the STEX Collections for more info.

    Each donation helps keep Simtropolis online, open and free!

    Thank you for reading and enjoy the site!

    More About STEX Collections