Beispiel #1
0
 private void LotProvider_LoadingLot(object sender, SimPe.Interfaces.Providers.ILotItem item)
 {
     SimPe.Interfaces.Files.IPackageFile pkg = FileTable.ProviderRegistry.SimDescriptionProvider.BasePackage;
     if (pkg != null)
     {
         SimPe.Providers.LotProvider.LotItem li = item as SimPe.Providers.LotProvider.LotItem;
         //SimPe.Interfaces.Files.IPackedFileDescriptor pfd = pkg.FindFile(0x0BF999E7, 0, Data.MetaData.LOCAL_GROUP, item.Instance);
         if (item.LtxtFileIndexItem != null)
         {
             SimPe.Plugin.Ltxt ltxt = new Ltxt();
             ltxt.ProcessData(item.LtxtFileIndexItem);
             item.Tags.Add(ltxt);
             li.Owner = ltxt.OwnerInstance;
         }
     }
 }
Beispiel #2
0
        /// <summary>
        /// Is called by SimPe (through the Wrapper) when the Panel is going to be displayed, so
        /// you should updatet the Data displayed by the Panel with the Attributes stored in the
        /// passed Wrapper.
        /// </summary>
        /// <param name="wrapper">The Attributes of this Wrapper have to be displayed</param>
        public void UpdateGUI(IFileWrapper wrapper)
        {
            Ltxt wrp = (Ltxt)wrapper;

            form.wrapper = null;


            form.pb.Image = wrp.LotDescription.Image;


            form.tbver.Text    = wrp.Version.ToString();
            form.tbsubver.Text = wrp.SubVersion.ToString();

            if (form.cbtype.Items.Contains(wrp.Type))
            {
                form.cbtype.SelectedIndex = form.cbtype.Items.IndexOf(wrp.Type);
            }
            else
            {
                form.cbtype.SelectedIndex = 0;
            }
            form.tbtype.Text        = "0x" + Helper.HexString((byte)wrp.Type);
            form.flpAptBtns.Enabled = (wrp.Type == Ltxt.LotType.ApartmentBase);

            form.tbRoads.Text = "0x" + Helper.HexString(wrp.LotRoads);

            form.tbwd.Text   = wrp.LotSize.Width.ToString();
            form.tbhg.Text   = wrp.LotSize.Height.ToString();
            form.tbtop.Text  = wrp.LotPosition.Y.ToString();
            form.tbleft.Text = wrp.LotPosition.X.ToString();
            form.tbz.Text    = wrp.LotElevation.ToString();

            form.cborient.SelectedValue = wrp.Orientation;
            form.tbrotation.Text        = "0x" + Helper.HexString(wrp.LotRotation);
            form.tbu0.Text = "0x" + Helper.HexString(wrp.Unknown0);


            form.tblotname.Text = wrp.LotName;
            form.tbTexture.Text = wrp.Texture;
            form.tbdesc.Text    = wrp.LotDesc;


            form.tbinst.Text = "0x" + Helper.HexString(wrp.LotInstance);
            form.tbu3.Text   = wrp.Unknown3.ToString();
            form.tbu4.Text   = "0x" + Helper.HexString(wrp.Unknown4);
            form.tbu5.Text   = Helper.BytesToHexList(wrp.Unknown5);


            form.lb.Items.Clear();
            int x = 0, y = 0;

            foreach (float i in wrp.Unknown1)// form.lb.Items.Add("0x" + Helper.HexString(i));
            {
                form.lb.Items.Add("(" + x + "," + y + ") " + i);
                x++;
                if ((y + 1) * (wrp.LotSize.Width + 1) == form.lb.Items.Count)
                {
                    y++;
                    x = 0;
                }
            }
            form.tbElevationAt.Text = "";


            form.tbu2.Text     = "0x" + Helper.HexString(wrp.Unknown2);
            form.tbowner.Text  = "0x" + Helper.HexString(wrp.OwnerInstance);
            form.tbApBase.Text = "0x" + Helper.HexString(wrp.ApartmentBase);
            form.tbu6.Text     = Helper.BytesToHexList(wrp.Unknown6);


            form.lbApts.Items.Clear();
            foreach (Ltxt.SubLot sl in wrp.SubLots)
            {
                form.lbApts.Items.Add("0x" + Helper.HexString(sl.ApartmentSublot));
            }
            form.tbApartment.Text = form.tbSAFamily.Text = form.tbSAu2.Text = form.tbSAu3.Text = "";


            form.lbu7.Items.Clear();
            foreach (uint i in wrp.Unknown7)
            {
                form.lbu7.Items.Add("0x" + Helper.HexString(i));
            }
            form.tbu7.Text = "";


            form.tbData.Text = Helper.BytesToHexList(wrp.Followup);


            form.tbowner.ReadOnly = !(wrp.Version >= LtxtVersion.Business);
            form.tbu3.ReadOnly    = !(wrp.SubVersion >= LtxtSubVersion.Voyage);
            form.tbu4.ReadOnly    = !(wrp.SubVersion >= LtxtSubVersion.Freetime);

            form.lbApts.Enabled = form.gbApartment.Enabled = form.lbu7.Enabled =
                (wrp.Version >= LtxtVersion.Apartment || wrp.SubVersion >= LtxtSubVersion.Apartment);
            form.tbu5.ReadOnly = form.tbApBase.ReadOnly = form.tbu6.ReadOnly = form.tbu7.ReadOnly =
                !form.lbApts.Enabled;

            form.llAptBase.Enabled  = (wrp.ApartmentBase != 0);
            form.flpAptBtns.Visible = (wrp.Version >= LtxtVersion.Apartment || wrp.SubVersion >= LtxtSubVersion.Apartment) &&
                                      Helper.WindowsRegistry.HiddenMode;
            form.flpAptBtns.Enabled = (wrp.Type == Ltxt.LotType.ApartmentBase);
            form.btnDelApt.Enabled  = form.llFamily.Enabled = form.llSubLot.Enabled = false;

            form.wrapper = wrp;
        }