Пример #1
0
        /// <summary>
        /// Execute the Extended Form
        /// </summary>
        /// <param name="wrp">the sdsc you want to show</param>
        /// <returns>true, if something was changed</returns>
        public static bool Execute(SimPe.PackedFiles.Wrapper.SDesc wrp)
        {
            SdscExtendedForm f = new SdscExtendedForm();

            f.LoadWantTable(wrp.Version);
            byte[] data = wrp.CurrentStateData.ToArray();

            f.rbhex.Checked = (Ambertation.BaseChangeShort.DigitBase == 16);
            f.rbbin.Checked = (Ambertation.BaseChangeShort.DigitBase == 2);
            f.rbdec.Checked = (!f.rbhex.Checked && !f.rbbin.Checked);
            f.propchanged   = false;


            f.ShowData(data);
            f.ok    = false;
            f.Text += " (version=" + wrp.Version.ToString() + ")";
            f.ShowDialog();

            if (f.ok)
            {
                f.UpdateData(data);
                wrp.FileDescriptor.UserData = data;
                wrp.ProcessData(wrp.FileDescriptor, wrp.Package);
            }
            return(f.ok);
        }
Пример #2
0
 private void ties_DoubleClickSim(object sender, System.Drawing.Image thumb, SimPe.PackedFiles.Wrapper.SDesc sdesc)
 {
     if (sdesc != null && sdesc != currentsdsc)
     {
         //Ambertation.Windows.Forms.Graph.ImagePanel ip = pool.FindItem(sdesc);
         pool.SelectedElement = sdesc;
     }
 }
Пример #3
0
        internal void pool_SelectedSimChanged(object sender, System.Drawing.Image thumb, SimPe.PackedFiles.Wrapper.SDesc sdesc)
        {
            if (cbLock.Checked)
            {
                return;
            }

            thumb       = null;
            lastsdsc    = null;
            currentsdsc = sdesc;
            ties.UpdateGraph(sdesc, wrapper);
        }
Пример #4
0
        /// <summary>
        /// Searches Sims
        /// </summary>
        /// <param name="pfd"></param>
        /// <param name="package"></param>
        /// <param name="prov"></param>
        /// <returns>Null if no match or a valid SearchItem Object</returns>
        public SearchItem SdscSearch(Interfaces.Files.IPackedFileDescriptor pfd, Interfaces.Files.IPackageFile package, Interfaces.IProviderRegistry prov)
        {
            string name = tbsimname.Text.Trim().ToLower();

            SimPe.PackedFiles.Wrapper.SDesc sdesc = new SimPe.PackedFiles.Wrapper.SDesc(prov.SimNameProvider, prov.SimFamilynameProvider, prov.SimDescriptionProvider);
            sdesc.ProcessData(pfd, package);

            string ext = "";

            if (sdesc.Unlinked != 0x00)
            {
                ext += "unlinked";
            }
            if (!sdesc.AvailableCharacterData)
            {
                if (ext.Trim() != "")
                {
                    ext += ", no Character Data";
                }
            }

            if (ext.Trim() != "")
            {
                ext = " (" + ext + ")";
            }

            string simname = sdesc.SimName + " " + sdesc.SimFamilyName;

            simname = simname.Trim().ToLower();
            if (simname == name)
            {
                return(new SearchItem(simname + ext, pfd));
            }

            simname = sdesc.SimName + " " + sdesc.HouseholdName;
            simname = simname.Trim().ToLower();
            if (simname == name)
            {
                return(new SearchItem(simname + ext, pfd));
            }


            return(null);
        }
Пример #5
0
        private void ties_SelectedSimChanged(object sender, System.Drawing.Image thumb, SimPe.PackedFiles.Wrapper.SDesc sdesc)
        {
            if (sdesc != null)
            {
                cbrel.Tag        = null;
                this.lbname.Text = sdesc.SimName + " " + sdesc.SimFamilyName;
                cbrel.Enabled    = (sdesc != currentsdsc);
                if (cbrel.Enabled)
                {
                    SimPe.PackedFiles.Wrapper.Supporting.FamilyTieSim  fts = wrapper.FindTies(currentsdsc);
                    SimPe.PackedFiles.Wrapper.Supporting.FamilyTieItem fti = fts.FindTie(sdesc);
                    cbrel.SelectedValue = fti.Type;
                    cbrel.Tag           = fti;
                }
            }
            else
            {
                cbrel.Enabled = (ties.SelectedElement != null);
                if (!cbrel.Enabled)
                {
                    lbname.Text = "";
                    cbrel.Tag   = null;
                }
            }

            llrem.Enabled = cbrel.Enabled;
        }
Пример #6
0
 private void pool_ClickOverSim(object sender, System.Drawing.Image thumb, SimPe.PackedFiles.Wrapper.SDesc sdesc)
 {
     lastsdsc   = sdesc;
     this.thumb = thumb;
 }