Exemplo n.º 1
0
        public override void ProcessInput(Event ev)
        {
            if (!base.CheckCanInteract())
            {
                return;
            }
            if (Designator_ExportToXmlFromArea.selectedArea != null)
            {
                base.ProcessInput(ev);
            }

            Designator_ExportToXmlFromArea.MakeAllowedAreaListFloatMenu(delegate(Area a)
            {
                Log.Clear();

                KCSG_Utilities.EdgeFromArea(a.ActiveCells.ToList(), out int height, out int width);
                List <IntVec3> cellExport = KCSG_Utilities.AreaToSquare(a, height, width);

                List <string> justCreated = new List <string>();
                Dictionary <IntVec3, List <Thing> > pairsCellThingList = new Dictionary <IntVec3, List <Thing> >();

                KCSG_Utilities.FillCellThingsList(cellExport, base.Map, pairsCellThingList);

                KCSG_Utilities.CreateSymbolIfNeeded(cellExport, base.Map, justCreated, pairsCellThingList, a);

                KCSG_Utilities.CreateStructureDef(cellExport, base.Map, KCSG_Utilities.FillpairsSymbolLabel(), pairsCellThingList, a);

                Log.TryOpenLogWindow();
            }, false, true, base.Map);
        }
 private void CreateLayoutSymbols()
 {
     this.symbols.Clear();
     // Base
     this.symbols    = KCSG_Utilities.CreateSymbolIfNeeded(this.cells, this.map, symbolPrefix, pairsCellThingList);
     this.structureL = KCSG_Utilities.CreateStructureDef(this.cells, this.map, symbolPrefix, KCSG_Utilities.FillpairsSymbolLabel(), pairsCellThingList);
     // Defname change
     structureL.SetElementValue("defName", defname);
     // Royalty change
     if (this.needRoyalty)
     {
         if (structureL.Element("requireRoyalty") == null)
         {
             structureL.Add(new XElement("requireRoyalty", true));
         }
     }
     else
     {
         if (structureL.Element("requireRoyalty") != null)
         {
             structureL.Element("requireRoyalty").Remove();
         }
     }
     // isStorage change
     if (this.isStorage)
     {
         if (structureL.Element("isStorage") == null)
         {
             structureL.Add(new XElement("isStorage", true));
         }
     }
     else
     {
         if (structureL.Element("isStorage") != null)
         {
             structureL.Element("isStorage").Remove();
         }
     }
     // Tags changes
     if (tags.Count > 0)
     {
         XElement temp1 = new XElement("tags");
         foreach (var item in this.tags)
         {
             temp1.Add(new XElement("li", item));
         }
         structureL.Add(temp1);
     }
 }
Exemplo n.º 3
0
        public override void DesignateMultiCell(IEnumerable <IntVec3> cells)
        {
            Log.Clear();

            List <string> justCreated = new List <string>();
            Dictionary <IntVec3, List <Thing> > pairsCellThingList = new Dictionary <IntVec3, List <Thing> >();

            KCSG_Utilities.FillCellThingsList(cells.ToList(), base.Map, pairsCellThingList);

            KCSG_Utilities.CreateSymbolIfNeeded(cells.ToList(), base.Map, justCreated, pairsCellThingList);

            KCSG_Utilities.CreateStructureDef(cells.ToList(), base.Map, KCSG_Utilities.FillpairsSymbolLabel(), pairsCellThingList);

            Log.TryOpenLogWindow();
        }