示例#1
0
            public DerivedDialog(ComponentPlayer player, Dialog dialog, ListPanelWidget listView, DataType dataType = DataType.Copy)
            {
                this.dataType = dataType;
                this.player   = player;
                this.dialog   = dialog;
                this.listView = listView;
                XElement node = ContentManager.Get <XElement>("NewWidgets/Dialog/通用界面3");

                WidgetsManager.LoadWidgetContents(this, this, node);
                Children.Find <LabelWidget>("名称", true).Text = "请输入名称";
                this.cancelButton = Children.Find <ButtonWidget>("取消", true);
                this.OK           = Children.Find <ButtonWidget>("确定", true);
                this.TextBox      = Children.Find <TextBoxWidget>("方块ID", true);
                this.TextBox.Text = "";
                this.Children.Find <BlockIconWidget>("方块").IsVisible = false;
            }
示例#2
0
        public HelpScreen()
        {
            WidgetsManager.LoadWidgetContents(this, this, ContentManager.Get <XElement>("Screens/HelpScreen"));
            m_topicsList       = Children.Find <ListPanelWidget>("TopicsList", true);
            m_recipaediaButton = Children.Find <ButtonWidget>("RecipaediaButton", true);
            m_bestiaryButton   = Children.Find <ButtonWidget>("BestiaryButton", true);

            m_topicsList.ItemWidgetFactory = delegate(object item)
            {
                var      helpTopic3 = (HelpTopic)item;
                XElement node2      = ContentManager.Get <XElement>("Widgets/HelpTopicItem");
                var      obj        = (ContainerWidget)WidgetsManager.LoadWidget(this, node2, null);
                obj.Children.Find <LabelWidget>("HelpTopicItem.Title", true).Text = helpTopic3.Title;
                return(obj);
            };
            m_topicsList.ItemClicked += delegate(object item)
            {
                if (item is HelpTopic helpTopic2)
                {
                    ShowTopic(helpTopic2);
                }
            };
            for (var i = ContentManager.CombineXml(ContentManager.Get <XElement>("Help"), ModsManager.GetEntries(".hlp"), "Title", "Name", "Topic").Elements().GetEnumerator(); i.MoveNext();)
            {
                var element  = i.Current;
                var strArray = XmlUtils.GetAttributeValue(element, "DisabledPlatforms", string.Empty).Split(',');
                if (strArray.FirstOrDefault(Match) == null)
                {
                    var attributeValue1 = XmlUtils.GetAttributeValue(element, "Name", string.Empty);
                    var attributeValue2 = XmlUtils.GetAttributeValue <string>(element, "Title");
                    var str1            = string.Empty;
                    strArray = element.Value.Split('\n');
                    for (int i1 = 0; i1 < strArray.Length; i1++)
                    {
                        str1 = str1 + strArray[i1].Trim() + " ";
                    }
                    var helpTopic = new HelpTopic {
                        Name = attributeValue1, Title = attributeValue2, Text = str1.Replace("\r", "").Replace("’", "'").Replace("\\n", "\n")
                    };
                    if (!string.IsNullOrEmpty(helpTopic.Name))
                    {
                        m_topics.Add(helpTopic.Name, helpTopic);
                    }
                    m_topicsList.AddItem(helpTopic);
                }
            }
        }
示例#3
0
        public PillarsDialog(CreatorAPI creatorAPI) : base(creatorAPI)
        {
            XElement node = ContentManager.Get <XElement>("NewWidgets/Dialog/柱子界面");

            WidgetsManager.LoadWidgetContents(this, this, node);
            base.GeneralSet();
            base.setShaftXYZ();
            Y_Shaft.Text = "正Y轴";
            this.Children.Find <LabelWidget>("名称", true).Text = "柱子";
            this.Radius           = this.Children.Find <SliderWidget>("滑条1", true);
            this.radiusDelayLabel = this.Children.Find <LabelWidget>("滑条1数据", true);
            this.Height           = this.Children.Find <SliderWidget>("滑条2", true);
            this.heightDelayLabel = this.Children.Find <LabelWidget>("滑条2数据", true);
            this.Children.Find <StackPanelWidget>("Data3", true).IsVisible = false;
            this.SoildButton  = this.Children.Find <ButtonWidget>("实心", true);
            this.HollowButton = this.Children.Find <ButtonWidget>("空心", true);
        }
示例#4
0
        public FractionalTowerWidget(IInventory inventory, ComponentMachine componentFurnace)
        {
            m_componentFurnace = componentFurnace;
            WidgetsManager.LoadWidgetContents(this, this, ContentManager.Get <XElement>("Widgets/FractionalTowerWidget"));
            m_inventoryGrid   = Children.Find <GridPanelWidget>("InventoryGrid");
            m_furnaceGrid     = Children.Find <GridPanelWidget>("FurnaceGrid");
            m_result1         = Children.Find <InventorySlotWidget>("ResultSlot1");
            m_result2         = Children.Find <InventorySlotWidget>("ResultSlot2");
            m_result3         = Children.Find <InventorySlotWidget>("ResultSlot3");
            m_cir1            = Children.Find <InventorySlotWidget>("CircuitSlot1");
            m_cir2            = Children.Find <InventorySlotWidget>("CircuitSlot2");
            m_acceptsDropsBox = Children.Find <CheckboxWidget>("AcceptsElectBox");
            m_progress        = Children.Find <ValueBarWidget>("Progress");

            int num = 6, y, x;
            InventorySlotWidget inventorySlotWidget;

            for (y = 0; y < m_inventoryGrid.RowsCount; y++)
            {
                for (x = 0; x < m_inventoryGrid.ColumnsCount; x++)
                {
                    inventorySlotWidget = new InventorySlotWidget();
                    inventorySlotWidget.AssignInventorySlot(inventory, num++);
                    m_inventoryGrid.Children.Add(inventorySlotWidget);
                    m_inventoryGrid.SetWidgetCell(inventorySlotWidget, new Point2(x, y));
                }
            }

            num = 0;
            for (y = 0; y < m_furnaceGrid.RowsCount; y++)
            {
                for (x = 0; x < m_furnaceGrid.ColumnsCount; x++)
                {
                    inventorySlotWidget = new InventorySlotWidget();
                    inventorySlotWidget.AssignInventorySlot(componentFurnace, num++);
                    m_furnaceGrid.Children.Add(inventorySlotWidget);
                    m_furnaceGrid.SetWidgetCell(inventorySlotWidget, new Point2(x, y));
                }
            }
            m_result1.AssignInventorySlot(componentFurnace, num++);
            m_result2.AssignInventorySlot(componentFurnace, num++);
            m_result3.AssignInventorySlot(componentFurnace, num++);
            m_cir1.AssignInventorySlot(componentFurnace, num++);
            m_cir2.AssignInventorySlot(componentFurnace, num++);
        }
示例#5
0
        public LiquidPumpWidget(IInventory inventory, ComponentInventoryBase componentDispenser)
        {
            m_componentDispenser   = componentDispenser;
            m_componentBlockEntity = componentDispenser.Entity.FindComponent <ComponentBlockEntity>(true);
            m_subsystemTerrain     = componentDispenser.Project.FindSubsystem <SubsystemTerrain>(true);
            WidgetsManager.LoadWidgetContents(this, this, ContentManager.Get <XElement>("Widgets/LiquidPumpWidget"));
            m_inventoryGrid  = Children.Find <GridPanelWidget>("InventoryGrid");
            m_dispenserGrid  = Children.Find <GridPanelWidget>("DispenserGrid");
            m_dispenserGrid2 = Children.Find <GridPanelWidget>("DispenserGrid2");
            m_drillSlot      = Children.Find <InventorySlotWidget>("DrillSlot");
            int num = 0, y, x;

            for (y = 0; y < m_dispenserGrid.RowsCount; y++)
            {
                for (x = 0; x < m_dispenserGrid.ColumnsCount; x++)
                {
                    var inventorySlotWidget = new InventorySlotWidget();
                    inventorySlotWidget.AssignInventorySlot(componentDispenser, num++);
                    m_dispenserGrid.Children.Add(inventorySlotWidget);
                    m_dispenserGrid.SetWidgetCell(inventorySlotWidget, new Point2(x, y));
                }
            }
            for (y = 0; y < m_dispenserGrid2.RowsCount; y++)
            {
                for (x = 0; x < m_dispenserGrid2.ColumnsCount; x++)
                {
                    var inventorySlotWidget2 = new InventorySlotWidget();
                    inventorySlotWidget2.AssignInventorySlot(componentDispenser, num++);
                    m_dispenserGrid2.Children.Add(inventorySlotWidget2);
                    m_dispenserGrid2.SetWidgetCell(inventorySlotWidget2, new Point2(x, y));
                }
            }
            num = 6;
            for (y = 0; y < m_inventoryGrid.RowsCount; y++)
            {
                for (x = 0; x < m_inventoryGrid.ColumnsCount; x++)
                {
                    var inventorySlotWidget3 = new InventorySlotWidget();
                    inventorySlotWidget3.AssignInventorySlot(inventory, num++);
                    m_inventoryGrid.Children.Add(inventorySlotWidget3);
                    m_inventoryGrid.SetWidgetCell(inventorySlotWidget3, new Point2(x, y));
                }
            }
            m_drillSlot.AssignInventorySlot(componentDispenser, 8);
        }
示例#6
0
        public ModDialog(CreatorAPI creatorAPI)
        {
            this.creatorAPI = creatorAPI;
            this.player     = creatorAPI.componentMiner.ComponentPlayer;
            XElement node = ContentManager.Get <XElement>("NewWidgets/Widget/模组界面");

            WidgetsManager.LoadWidgetContents(this, this, node);
            this.OK = Children.Find <ButtonWidget>("确定", true);
            this.ExportOnekeyButton    = Children.Find <ButtonWidget>("导出一键", true);
            this.ImportButton          = Children.Find <ButtonWidget>("导入配置", true);
            this.ExportCopyButton      = Children.Find <ButtonWidget>("导出复制", true);
            this.ExportOldCopyButton   = Children.Find <ButtonWidget>("导出旧复制", true);
            this.ExportOldOnekeyButton = Children.Find <ButtonWidget>("导出旧一键", true);
            this.DerivedSpecialButton  = Children.Find <ButtonWidget>("导出特殊", true);
            this.DeleteButton          = Children.Find <ButtonWidget>("删除", true);
            this.ListView = Children.Find <ListPanelWidget>("ListView", true);
            UpList();
        }
示例#7
0
        public SphereDialog(CreatorAPI creatorAPI) : base(creatorAPI)
        {
            XElement node = ContentManager.Get <XElement>("NewWidgets/Dialog/球体界面");

            WidgetsManager.LoadWidgetContents(this, this, node);
            base.GeneralSet();
            this.XRadius              = this.Children.Find <SliderWidget>("X半径滑条", true);
            this.YRadius              = this.Children.Find <SliderWidget>("Y半径滑条", true);
            this.ZRadius              = this.Children.Find <SliderWidget>("Z半径滑条", true);
            this.XdelayLabel          = this.Children.Find <LabelWidget>("X半径", true);
            this.YdelayLabel          = this.Children.Find <LabelWidget>("Y半径", true);
            this.ZdelayLabel          = this.Children.Find <LabelWidget>("Z半径", true);
            this.SoildButton          = this.Children.Find <ButtonWidget>("实心", true);
            this.HollowButton         = this.Children.Find <ButtonWidget>("空心", true);
            this.AdvancedButton       = this.Children.Find <ButtonWidget>("高级");
            this.AdvancedGenerate     = this.Children.Find <Widget>("高级生成");
            this.DoublePositionButton = this.Children.Find <ButtonWidget>("2点模式");
        }
示例#8
0
        public OnekeyGenerationDialog(CreatorAPI creatorAPI)
        {
            this.creatorAPI       = creatorAPI;
            this.player           = creatorAPI.componentMiner.ComponentPlayer;
            this.subsystemTerrain = player.Project.FindSubsystem <SubsystemTerrain>(true);
            XElement node = ContentManager.Get <XElement>("NewWidgets/Dialog/一键界面");

            WidgetsManager.LoadWidgetContents(this, this, node);
            this.CreateButton   = Children.Find <ButtonWidget>("创建", true);
            this.OnAndOffButton = Children.Find <ButtonWidget>("开启", true);
            this.DerivedButton  = Children.Find <ButtonWidget>("导出", true);
            this.ImportButton   = Children.Find <ButtonWidget>("导入", true);
            this.DeleteButton   = Children.Find <ButtonWidget>("删除", true);
            this.OKButton       = Children.Find <ButtonWidget>("确定", true);
            this.ListView       = Children.Find <ListPanelWidget>("ListView", true);
            this.TypeButton     = Children.Find <ButtonWidget>("类型", true);
            UpList();
        }
示例#9
0
        public SetDialog(CreatorAPI creatorAPI)
        {
            this.creatorAPI       = creatorAPI;
            this.player           = creatorAPI.componentMiner.ComponentPlayer;
            this.subsystemTerrain = player.Project.FindSubsystem <SubsystemTerrain>(true);
            XElement node = ContentManager.Get <XElement>("NewWidgets/Dialog/设置界面");

            WidgetsManager.LoadWidgetContents(this, this, node);
            this.OK                  = Children.Find <ButtonWidget>("确定", true);
            this.generatingMod       = Children.Find <ButtonWidget>("生成模式", true);
            this.resettingButton     = Children.Find <ButtonWidget>("重置", true);
            this.generatingSet       = Children.Find <ButtonWidget>("生成开关", true);
            this.SetPositionMode     = Children.Find <ButtonWidget>("设点模式");
            this.unLimited           = Children.Find <ButtonWidget>("超距生成");
            this.AirIdentifyButton   = Children.Find <ButtonWidget>("空气识别");
            this.RevokeButton        = Children.Find <ButtonWidget>("撤回开关");
            this.professionButton    = Children.Find <ButtonWidget>("专业模式");
            this.setMainWidgetButton = this.Children.Find <ButtonWidget>("旧主界面");
        }
示例#10
0
        public MountainDialog(CreatorAPI creatorAPI)
        {
            this.creatorAPI = creatorAPI;
            this.player     = creatorAPI.componentMiner.ComponentPlayer;
            XElement node = ContentManager.Get <XElement>("NewWidgets/Dialog/山脉界面");

            WidgetsManager.LoadWidgetContents(this, this, node);
            this.OK           = Children.Find <ButtonWidget>("确定", true);
            this.cancelButton = Children.Find <ButtonWidget>("取消", true);
            this.num_1        = Children.Find <LabelWidget>("滑条1数据", true);
            this.num_2        = Children.Find <LabelWidget>("滑条2数据", true);
            this.num_3        = Children.Find <LabelWidget>("滑条3数据", true);
            this.TextBox      = Children.Find <TextBoxWidget>("方块ID", true);
            this.num1         = Children.Find <SliderWidget>("滑条1", true);
            this.num2         = Children.Find <SliderWidget>("滑条2", true);
            this.num3         = Children.Find <SliderWidget>("滑条3", true);
            num3.Value        = 100f;
            this.restting     = Children.Find <ButtonWidget>("重置", true);
        }
示例#11
0
        public EditCommandBlockDialog(CommandData data)
        {
            XElement node = ContentManager.Get <XElement>("Dialogs/EditCommandBlockDialog");

            WidgetsManager.LoadWidgetContents(this, this, node);
            textBox      = Children.Find <TextBoxWidget>("EditCommandBlockDialog.TextBox");
            list         = Children.Find <ListPanelWidget>("EditCommandBlockDialog.List");
            okButton     = Children.Find <ButtonWidget>("EditCommandBlockDIalog.OkButton");
            cancelButton = Children.Find <ButtonWidget>("EditCommandBlockDIalog.CancelButton");

            commandData          = data;
            command              = data.Command;
            textBox.Text         = command;
            textBox.TextChanged += TextChanged;

            list.ItemClicked += ListSelected;

            engine = GameManager.Project.FindSubsystem <SubsystemCommandEngine>(true);
        }
示例#12
0
        public ElectricFurnaceWidget(IInventory inventory, ComponentElectricFurnace componentFurnace)
        {
            m_componentFurnace = componentFurnace;
            WidgetsManager.LoadWidgetContents(this, this, ContentManager.Get <XElement>("Widgets/ElectricFurnaceWidget"));
            m_inventoryGrid   = Children.Find <GridPanelWidget>("InventoryGrid");
            m_furnaceGrid     = Children.Find <GridPanelWidget>("FurnaceGrid");
            m_fire            = Children.Find <FireWidget>("Fire");
            m_progress        = Children.Find <ValueBarWidget>("Progress");
            m_resultSlot      = Children.Find <InventorySlotWidget>("ResultSlot");
            m_remainsSlot     = Children.Find <InventorySlotWidget>("RemainsSlot");
            m_circuitSlot     = Children.Find <InventorySlotWidget>("CircuitSlot");
            m_acceptsDropsBox = Children.Find <CheckboxWidget>("AcceptsElectBox");
            m_circuit2Slot    = Children.Find <InventorySlotWidget>("Circuit2Slot");
            int num = 6, y, x;
            InventorySlotWidget inventorySlotWidget;

            for (y = 0; y < m_inventoryGrid.RowsCount; y++)
            {
                for (x = 0; x < m_inventoryGrid.ColumnsCount; x++)
                {
                    inventorySlotWidget = new InventorySlotWidget();
                    inventorySlotWidget.AssignInventorySlot(inventory, num++);
                    m_inventoryGrid.Children.Add(inventorySlotWidget);
                    m_inventoryGrid.SetWidgetCell(inventorySlotWidget, new Point2(x, y));
                }
            }
            num = 0;
            for (y = 0; y < m_furnaceGrid.RowsCount; y++)
            {
                for (x = 0; x < m_furnaceGrid.ColumnsCount; x++)
                {
                    inventorySlotWidget = new InventorySlotWidget();
                    inventorySlotWidget.AssignInventorySlot(componentFurnace, num++);
                    m_furnaceGrid.Children.Add(inventorySlotWidget);
                    m_furnaceGrid.SetWidgetCell(inventorySlotWidget, new Point2(x, y));
                }
            }
            m_resultSlot.AssignInventorySlot(componentFurnace, componentFurnace.ResultSlotIndex);
            m_remainsSlot.AssignInventorySlot(componentFurnace, componentFurnace.RemainsSlotIndex);
            m_circuitSlot.AssignInventorySlot(componentFurnace, componentFurnace.Cir1SlotIndex);
            m_circuit2Slot.AssignInventorySlot(componentFurnace, componentFurnace.Cir2SlotIndex);
        }
        public LoadingScreen()
        {
            WidgetsManager.LoadWidgetContents((Widget)this.ScreenWidget, (object)this, ContentManager.Get <XElement>("Screens/LoadingScreen"));

            LabelWidget ExternalAssemblyInfo = new LabelWidget();

            ExternalAssemblyInfo.Text = "Powered By GScience Studio\n";
            //下列两行代码请勿随意删除
            ExternalAssemblyInfo.Text += "Author:" + Info.author + "\n";
            ExternalAssemblyInfo.Text += "Version:" + Info.version;

            ExternalAssemblyInfo.Color     = Color.LightBlue;
            ExternalAssemblyInfo.FontScale = 0.5f;
            this.ScreenWidget.Children.Add(ExternalAssemblyInfo);

            this.AddLoadAction((Action)(() => CommunityContentManager.Initialize()));
            this.AddLoadAction((Action)(() => MotdManager.Initialize()));
            this.AddLoadAction((Action)(() => LightingManager.Initialize()));
            this.AddLoadAction((Action)(() => StringsManager.LoadStrings()));
            this.AddLoadAction((Action)(() => TextureAtlasManager.LoadAtlases()));
            ReadOnlyList <ContentInfo> readOnlyList = ContentManager.List();

            // ISSUE: explicit reference operation
            using (ReadOnlyList <ContentInfo> .Enumerator enumerator = ((ReadOnlyList <ContentInfo>)@readOnlyList).GetEnumerator())
            {
                // ISSUE: explicit reference operation
                while (((ReadOnlyList <ContentInfo> .Enumerator)@enumerator).MoveNext())
                {
                    // ISSUE: explicit reference operation
                    ContentInfo localContentInfo = ((ReadOnlyList <ContentInfo> .Enumerator)@enumerator).Current;
                    this.AddLoadAction((Action)(() => ContentManager.Get((string)localContentInfo.Name)));
                }
            }
            this.AddLoadAction((Action)(() => DatabaseManager.LoadDatabase()));
            this.AddLoadAction((Action)(() => WorldsManager.Initialize()));
            this.AddLoadAction((Action)(() => BlocksTexturesManager.Initialize()));
            this.AddLoadAction((Action)(() => CharacterSkinsManager.Initialize()));
            this.AddLoadAction((Action)(() => FurniturePacksManager.Initialize()));
            this.AddLoadAction((Action)(() => BlocksManager.Initialize()));
            this.AddLoadAction((Action)(() => CraftingRecipesManager.Initialize()));
            this.AddLoadAction((Action)(() => GScienceStudio.InputManager.Initialize()));
        }
        public ImageDialog(ComponentPlayer player, TerrainRaycastResult?Point1, TerrainRaycastResult?Point2, TerrainRaycastResult?Point3, SubsystemTerrain subsystemTerrain)
        {
            this.player = player;
            this.Point1 = Point1;
            this.Point2 = Point2;
            this.Point3 = Point3;


            this.subsystemTerrain = subsystemTerrain;
            WidgetsManager.LoadWidgetContents(this, this, ContentManager.Get <XElement>("WE/DialogsWE/ZoneWidget"));



            list_build = Children.Find <ListPanelWidget>("ListView", true);

            AddButton  = this.Children.Find <ButtonWidget>("AddButton", true);
            MoreButton = this.Children.Find <ButtonWidget>("MoreButton", true);
            Cancel     = this.Children.Find <ButtonWidget>("Cancel", true);
            Title      = this.Children.Find <LabelWidget>("Dialog.Title", true);


            Title.Text = "Image in SC";

            names_item.Add("Delete");
            //names_item.Add("Rename");
            names_item.Add("Create");

            foreach (string category in names_item)
            {
                m_categories.Add(new Category()
                {
                    Name = category,
                });
            }


            MoreButton.IsEnabled = false;


            update_builds();
        }
示例#15
0
        public BlastFurnaceWidget(IInventory inventory, ComponentBlastFurnace componentFurnace)
        {
            m_componentFurnace = componentFurnace;
            WidgetsManager.LoadWidgetContents(this, this, ContentManager.Get <XElement>("Widgets/BlastFurnaceWidget"));
            m_inventoryGrid = Children.Find <GridPanelWidget>("InventoryGrid");
            m_furnaceGrid   = Children.Find <GridPanelWidget>("FurnaceGrid");
            m_fire          = Children.Find <FireWidget>("Fire");
            m_progress      = Children.Find <ValueBarWidget>("Progress");
            m_resultSlot    = Children.Find <InventorySlotWidget>("ResultSlot");
            m_remainsSlot   = Children.Find <InventorySlotWidget>("RemainsSlot");
            m_remainsSlot2  = Children.Find <InventorySlotWidget>("RemainsSlot2");
            m_remainsSlot3  = Children.Find <InventorySlotWidget>("RemainsSlot3");
            int num = 6, y, x;
            InventorySlotWidget inventorySlotWidget;

            for (y = 0; y < m_inventoryGrid.RowsCount; y++)
            {
                for (x = 0; x < m_inventoryGrid.ColumnsCount; x++)
                {
                    inventorySlotWidget = new InventorySlotWidget();
                    inventorySlotWidget.AssignInventorySlot(inventory, num++);
                    m_inventoryGrid.Children.Add(inventorySlotWidget);
                    m_inventoryGrid.SetWidgetCell(inventorySlotWidget, new Point2(x, y));
                }
            }
            num = 0;
            for (y = 0; y < m_furnaceGrid.RowsCount; y++)
            {
                for (x = 0; x < m_furnaceGrid.ColumnsCount; x++)
                {
                    inventorySlotWidget = new InventorySlotWidget();
                    inventorySlotWidget.AssignInventorySlot(componentFurnace, num++);
                    m_furnaceGrid.Children.Add(inventorySlotWidget);
                    m_furnaceGrid.SetWidgetCell(inventorySlotWidget, new Point2(x, y));
                }
            }
            m_resultSlot.AssignInventorySlot(componentFurnace, 8);
            m_remainsSlot.AssignInventorySlot(componentFurnace, 9);
            m_remainsSlot2.AssignInventorySlot(componentFurnace, 10);
            m_remainsSlot3.AssignInventorySlot(componentFurnace, 11);
        }
示例#16
0
        //protected readonly InventorySlotWidget m_remainsSlot;

        //protected readonly InventorySlotWidget m_resultSlot;

        public FireBoxWidget(IInventory inventory, T component, string path)
        {
            m_componentFurnace = component;
            WidgetsManager.LoadWidgetContents(this, this, ContentManager.Get <XElement>(path));
            m_inventoryGrid = Children.Find <GridPanelWidget>("InventoryGrid");
            m_fire          = Children.Find <FireWidget>("Fire");
            m_progress      = Children.Find <ValueBarWidget>("Progress");
            m_fuelSlot      = Children.Find <InventorySlotWidget>("FuelSlot");
            int num = 6;

            for (int i = 0; i < m_inventoryGrid.RowsCount; i++)
            {
                for (int j = 0; j < m_inventoryGrid.ColumnsCount; j++)
                {
                    var inventorySlotWidget = new InventorySlotWidget();
                    inventorySlotWidget.AssignInventorySlot(inventory, num++);
                    m_inventoryGrid.Children.Add(inventorySlotWidget);
                    m_inventoryGrid.SetWidgetCell(inventorySlotWidget, new Point2(j, i));
                }
            }
            m_fuelSlot.AssignInventorySlot(component, component.FuelSlotIndex);
        }
示例#17
0
        public MachineToolWidget(IInventory inventory, ComponentLargeCraftingTable componentCraftingTable)
        {
            m_componentCraftingTable = componentCraftingTable;
            WidgetsManager.LoadWidgetContents(this, this, ContentManager.Get <XElement>("Widgets/MachineToolWidget"));
            m_inventoryGrid       = Children.Find <GridPanelWidget>("InventoryGrid");
            m_craftingGrid        = Children.Find <GridPanelWidget>("CraftingGrid");
            m_craftingResultSlot  = Children.Find <InventorySlotWidget>("CraftingResultSlot");
            m_craftingRemainsSlot = Children.Find <InventorySlotWidget>("CraftingRemainsSlot");
            int num = 6, y, x;
            InventorySlotWidget inventorySlotWidget;

            for (y = 0; y < m_inventoryGrid.RowsCount; y++)
            {
                for (x = 0; x < m_inventoryGrid.ColumnsCount; x++)
                {
                    inventorySlotWidget = new InventorySlotWidget();
                    inventorySlotWidget.AssignInventorySlot(inventory, num++);
                    m_inventoryGrid.Children.Add(inventorySlotWidget);
                    m_inventoryGrid.SetWidgetCell(inventorySlotWidget, new Point2(x, y));
                }
            }
            num = 0;
            for (y = 0; y < m_craftingGrid.RowsCount; y++)
            {
                for (x = 0; x < m_craftingGrid.ColumnsCount; x++)
                {
                    inventorySlotWidget = new InventorySlotWidget();                    /*
                                                                                         * {
                                                                                         * Size = new Vector2(48f)
                                                                                         * };*/
                    inventorySlotWidget.AssignInventorySlot(m_componentCraftingTable, num++);
                    m_craftingGrid.Children.Add(inventorySlotWidget);
                    m_craftingGrid.SetWidgetCell(inventorySlotWidget, new Point2(x, y));
                }
            }
            m_craftingResultSlot.AssignInventorySlot(m_componentCraftingTable, m_componentCraftingTable.ResultSlotIndex);
            m_craftingRemainsSlot.AssignInventorySlot(m_componentCraftingTable, m_componentCraftingTable.RemainsSlotIndex);
        }
示例#18
0
        public DrillerWidget(IInventory inventory, ComponentInventoryBase componentDispenser)
        {
            m_componentDispenser   = componentDispenser;
            m_componentBlockEntity = componentDispenser.Entity.FindComponent <ComponentBlockEntity>(true);
            m_subsystemTerrain     = componentDispenser.Project.FindSubsystem <SubsystemTerrain>(true);
            WidgetsManager.LoadWidgetContents(this, this, ContentManager.Get <XElement>("Widgets/DrillerWidget"));
            m_inventoryGrid   = Children.Find <GridPanelWidget>("InventoryGrid");
            m_dispenserGrid   = Children.Find <GridPanelWidget>("DispenserGrid");
            m_dispenseButton  = Children.Find <ButtonWidget>("DispenseButton");
            m_shootButton     = Children.Find <ButtonWidget>("ShootButton");
            m_acceptsDropsBox = Children.Find <CheckboxWidget>("AcceptsDropsBox");
            m_drillSlot       = Children.Find <InventorySlotWidget>("DrillSlot");
            int num = 6, y, x;
            InventorySlotWidget inventorySlotWidget;

            for (y = 0; y < m_inventoryGrid.RowsCount; y++)
            {
                for (x = 0; x < m_inventoryGrid.ColumnsCount; x++)
                {
                    inventorySlotWidget = new InventorySlotWidget();
                    inventorySlotWidget.AssignInventorySlot(inventory, num++);
                    m_inventoryGrid.Children.Add(inventorySlotWidget);
                    m_inventoryGrid.SetWidgetCell(inventorySlotWidget, new Point2(x, y));
                }
            }
            num = 0;
            for (y = 0; y < m_dispenserGrid.RowsCount; y++)
            {
                for (x = 0; x < m_dispenserGrid.ColumnsCount; x++)
                {
                    inventorySlotWidget = new InventorySlotWidget();
                    inventorySlotWidget.AssignInventorySlot(componentDispenser, num++);
                    m_dispenserGrid.Children.Add(inventorySlotWidget);
                    m_dispenserGrid.SetWidgetCell(inventorySlotWidget, new Point2(x, y));
                }
            }
            m_drillSlot.AssignInventorySlot(componentDispenser, 8);
        }
示例#19
0
        public FastRun(ComponentPlayer player)
        {
            this.player = player;
            WidgetsManager.LoadWidgetContents(this, this, ContentManager.Get <XElement>("WE/DialogsWE/FastRunDialog"));
            m_title = this.Children.Find <LabelWidget>("Dialog.Title", true);



            m_speed = this.Children.Find <SliderWidget>("Dialog.Slider1", true);

            plusButton  = this.Children.Find <ButtonWidget>("Dialog.Button4", true);
            minusButton = this.Children.Find <ButtonWidget>("Dialog.Button3", true);

            m_okButton     = this.Children.Find <ButtonWidget>("Dialog.OK", true);
            m_cancelButton = this.Children.Find <ButtonWidget>("Dialog.Cancel", true);


            m_speed.MinValue = 0f;
            m_speed.MaxValue = 100;
            m_speed.Value    = ComponentWE5.speed;

            m_title.Text = "FastRun";
        }
示例#20
0
        public EngineAWidget(IInventory inventory, ComponentMachine componentFurnace, string path = "Widgets/EngineAWidget")
        {
            m_componentFurnace = componentFurnace;
            WidgetsManager.LoadWidgetContents(this, this, ContentManager.Get <XElement>(path));
            m_inventoryGrid = Children.Find <GridPanelWidget>("InventoryGrid");
            m_furnaceGrid   = Children.Find <GridPanelWidget>("FurnaceGrid");
            m_fire          = Children.Find <FireWidget>("Fire");
            m_progress      = Children.Find <ValueBarWidget>("Progress");
            m_remainsSlot   = Children.Find <InventorySlotWidget>("RemainsSlot");
            m_resultSlot    = Children.Find <InventorySlotWidget>("ResultSlot");
            int num = 6, y, x;
            InventorySlotWidget inventorySlotWidget;

            for (y = 0; y < m_inventoryGrid.RowsCount; y++)
            {
                for (x = 0; x < m_inventoryGrid.ColumnsCount; x++)
                {
                    inventorySlotWidget = new InventorySlotWidget();
                    inventorySlotWidget.AssignInventorySlot(inventory, num++);
                    m_inventoryGrid.Children.Add(inventorySlotWidget);
                    m_inventoryGrid.SetWidgetCell(inventorySlotWidget, new Point2(x, y));
                }
            }
            num = 0;
            for (y = 0; y < m_furnaceGrid.RowsCount; y++)
            {
                for (x = 0; x < m_furnaceGrid.ColumnsCount; x++)
                {
                    inventorySlotWidget = new InventorySlotWidget();
                    inventorySlotWidget.AssignInventorySlot(componentFurnace, num++);
                    m_furnaceGrid.Children.Add(inventorySlotWidget);
                    m_furnaceGrid.SetWidgetCell(inventorySlotWidget, new Point2(x, y));
                }
            }
            m_remainsSlot.AssignInventorySlot(componentFurnace, componentFurnace.RemainsSlotIndex);
            m_resultSlot.AssignInventorySlot(componentFurnace, componentFurnace.ResultSlotIndex);
        }
示例#21
0
        public CopyPasteDialog(CreatorAPI creatorAPI)
        {
            this.creatorAPI = creatorAPI;
            this.player     = creatorAPI.componentMiner.ComponentPlayer;
            XElement node = ContentManager.Get <XElement>("NewWidgets/Dialog/复制粘贴");

            WidgetsManager.LoadWidgetContents(this, this, node);
            this.CopyButton         = Children.Find <ButtonWidget>("复制", true);
            this.DerivedButton      = Children.Find <ButtonWidget>("导出", true);
            this.ImportButton       = Children.Find <ButtonWidget>("导入", true);
            this.DeleteButton       = Children.Find <ButtonWidget>("删除", true);
            this.cancelButton       = Children.Find <ButtonWidget>("取消", true);
            this.PasteButton        = Children.Find <ButtonWidget>("粘贴", true);
            this.MirrorButton       = Children.Find <ButtonWidget>("镜像", true);
            this.LimitButton        = Children.Find <ButtonWidget>("限制", true);
            this.DirectionSetButton = Children.Find <ButtonWidget>("旋转", true);
            this.specialCopyButton  = Children.Find <ButtonWidget>("特殊复制", true);
            this.specialPasteButton = Children.Find <ButtonWidget>("特殊粘贴", true);
            if (creatorAPI.pasteLimit)
            {
                LimitButton.Color = Color.Yellow;
            }
            else
            {
                LimitButton.Color = Color.Red;
            }
            if (creatorAPI.pasteRotate)
            {
                DirectionSetButton.Color = Color.Yellow;
            }
            else
            {
                DirectionSetButton.Color = Color.Red;
            }
            this.ListView = Children.Find <ListPanelWidget>("ListView", true);
            UpList();
        }
示例#22
0
        public CreatorWidget(CreatorAPI creatorAPI)
        {
            this.player     = creatorAPI.componentMiner.ComponentPlayer;;
            this.creatorAPI = creatorAPI;
            XElement node;

            if (creatorAPI.oldMainWidget)
            {
                node = ContentManager.Get <XElement>("NewWidgets/CreatorAPIWidget");
            }
            else
            {
                node = ContentManager.Get <XElement>("NewWidgets/NewCreatorAPIWidget");
            }
            WidgetsManager.LoadWidgetContents(this, this, node);
            this.worldSettings = player.Project.FindSubsystem <SubsystemGameInfo>(true).WorldSettings;

            this.SphereButton      = Children.Find <ButtonWidget>("球体");
            this.PrismButton       = Children.Find <ButtonWidget>("棱体");
            this.PyramidButton     = Children.Find <ButtonWidget>("棱锥");
            this.CylindricalButton = Children.Find <ButtonWidget>("圆柱");
            this.PrismColumnButton = Children.Find <ButtonWidget>("棱柱");
            this.PillarsButton     = Children.Find <ButtonWidget>("柱子");
            this.RectangularButton = Children.Find <ButtonWidget>("矩形");
            this.CircleButton      = Children.Find <ButtonWidget>("圆环");
            this.MazeButton        = Children.Find <ButtonWidget>("迷宫");
            this.FillingButton     = Children.Find <ButtonWidget>("填充");
            this.PavageButton      = Children.Find <ButtonWidget>("平铺");
            this.MountainButton    = Children.Find <ButtonWidget>("山脉");
            this.TransferButton    = Children.Find <ButtonWidget>("传送");
            this.LevelSetButton    = Children.Find <ButtonWidget>("等级");
            this.SetButton         = Children.Find <ButtonWidget>("设置");
            this.SpiralButton      = Children.Find <ButtonWidget>("螺旋");
            this.PenetrateButton   = Children.Find <ButtonWidget>("穿透");

            this.SetLinkButton = Children.Find <ButtonWidget>("连线");

            this.SetPositionButton = Children.Find <ButtonWidget>("设点");
            this.RevokeButton      = Children.Find <ButtonWidget>("撤回");
            this.SetSpawn          = Children.Find <ButtonWidget>("出生点");

            this.EditWorldButton  = Children.Find <ButtonWidget>("编辑世界");
            this.EditRegionButton = Children.Find <ButtonWidget>("编辑区域");
            this.ModButton        = Children.Find <ButtonWidget>("模组专用");
            this.ReplaceButton    = Children.Find <ButtonWidget>("方块替换");
            this.OnekeyButton     = Children.Find <ButtonWidget>("一键生成");
            this.CopyPasteButton  = Children.Find <ButtonWidget>("复制粘贴");
            this.ClearCacheButton = Children.Find <ButtonWidget>("清除缓存");
            this.SetModeButton    = Children.Find <ButtonWidget>("变更模式");

            this.RemoveItemButton   = Children.Find <ButtonWidget>("清除掉落");
            this.RemoveAnimalButton = Children.Find <ButtonWidget>("清除动物");
            this.ClearBlockButton   = Children.Find <ButtonWidget>("清理方块");
            this.TerrainTestButton  = Children.Find <ButtonWidget>("测试地形");

            this.SetPositionCarefulButton = this.Children.Find <ButtonWidget>("精准设点");
            this.AdjustPositionButton     = this.Children.Find <ButtonWidget>("点位调整");
            this.SetDifficultyButton      = this.Children.Find <ButtonWidget>("变更难度");
            this.ThreePointPlaneButton    = this.Children.Find <ButtonWidget>("3点成面");
            this.FourPointSpaceButton     = this.Children.Find <ButtonWidget>("4点空间");
            this.LightWorldButton         = this.Children.Find <ButtonWidget>("发光世界");
        }
        public Rectangle(ComponentPlayer player, int id, TerrainRaycastResult?Point1, TerrainRaycastResult?Point2, SubsystemTerrain subsystemTerrain)
        {
            m_subsystemTerrain = subsystemTerrain;
            Point       = Point1;
            this.Point2 = Point2;
            id1         = id;
            this.player = player;
            WidgetsManager.LoadWidgetContents(this, this, ContentManager.Get <XElement>("WE/DialogsWE/PillarDialog"));

            m_title = this.Children.Find <LabelWidget>("Pillar_Dialog.Title", true);

            mPosition = this.Children.Find <LabelWidget>("Pillar_Dialog.Pos", true);

            Icon_select = this.Children.Find <ButtonWidget>("Pillar_Dialog.Icon_select", true);

            mselect_pos = this.Children.Find <ButtonWidget>("Pillar_Dialog.Select_pos", true);



            m_okButton     = this.Children.Find <ButtonWidget>("Pillar_Dialog.OK", true);
            m_cancelButton = this.Children.Find <ButtonWidget>("Pillar_Dialog.Cancel", true);

            this.m_blockIconWidget = this.Children.Find <BlockIconWidget>("Pillar_Dialog.Icon", true);


            m_title.Text = "Frame or box";

            //switch_mode.Text = "Holow";

            //m_blockIconWidget.Value

            mPosition.Text = "Frame";



            m_blockIconWidget.Value = id;

            names.Add("Soild");
            names.Add("Hollow");

            names_pos.Add("Frame");
            names_pos.Add("Hollow Box");
            names_pos.Add("Soild Box");



            foreach (string category in names)
            {
                m_categories.Add(new Category()
                {
                    Name = category,
                });
            }

            foreach (string category in names_pos)
            {
                m_categories_pos.Add(new Category()
                {
                    Name = category,
                });
            }
        }
示例#24
0
        public Square(ComponentPlayer player, int id, TerrainRaycastResult?Point1, SubsystemTerrain subsystemTerrain)
        {
            m_subsystemTerrain = subsystemTerrain;
            Point       = Point1;
            id1         = id;
            this.player = player;
            WidgetsManager.LoadWidgetContents(this, this, ContentManager.Get <XElement>("WE/DialogsWE/SquareDialog"));

            m_title = this.Children.Find <LabelWidget>("Square_Dialog.Title", true);

            Mode      = this.Children.Find <LabelWidget>("Square_Dialog.Mode", true);
            mPosition = this.Children.Find <LabelWidget>("Square_Dialog.Pos", true);

            Icon_select = this.Children.Find <ButtonWidget>("Square_Dialog.Icon_select", true);

            mselect_pos = this.Children.Find <ButtonWidget>("Square_Dialog.Select_pos", true);

            m_radius = this.Children.Find <SliderWidget>("Square_Dialog.Slider1", true);
            m_lenght = this.Children.Find <SliderWidget>("Square_Dialog.Slider2", true);

            plusButton  = this.Children.Find <ButtonWidget>("Square_Dialog.Button4", true);
            minusButton = this.Children.Find <ButtonWidget>("Square_Dialog.Button3", true);

            lenght_plusButton  = this.Children.Find <ButtonWidget>("Square_Dialog.Button2", true);
            lenght_minusButton = this.Children.Find <ButtonWidget>("Square_Dialog.Button1", true);



            mSelect_mode = this.Children.Find <ButtonWidget>("Square_Dialog.Select_mode", true);

            m_okButton     = this.Children.Find <ButtonWidget>("Square_Dialog.OK", true);
            m_cancelButton = this.Children.Find <ButtonWidget>("Square_Dialog.Cancel", true);

            this.m_blockIconWidget = this.Children.Find <BlockIconWidget>("Square_Dialog.Icon", true);


            m_title.Text = "Square";

            //switch_mode.Text = "Holow";

            //m_blockIconWidget.Value

            mPosition.Text = "Flat";
            Mode.Text      = "Hollow";


            m_radius.MinValue = 1f;
            m_radius.MaxValue = 100;
            m_radius.Value    = 1f;

            m_lenght.MinValue = 1f;
            m_lenght.MaxValue = 100;
            m_lenght.Value    = 1f;

            m_blockIconWidget.Value = id;

            names.Add("Soild");
            names.Add("Hollow");

            names_pos.Add("Flat");
            names_pos.Add("Pos_X");
            names_pos.Add("Pos_Y");


            foreach (string category in names)
            {
                m_categories.Add(new Category()
                {
                    Name = category,
                });
            }

            foreach (string category in names_pos)
            {
                m_categories_pos.Add(new Category()
                {
                    Name = category,
                });
            }
        }
示例#25
0
        public Img(ComponentPlayer player, string path, TerrainRaycastResult?Point1, SubsystemTerrain subsystemTerrain)
        {
            path_img = path;



            Point = new Point3(Point1.Value.CellFace.Point.X, Point1.Value.CellFace.Point.Y, Point1.Value.CellFace.Point.Z);
            m_subsystemTerrain = subsystemTerrain;


            this.player = player;
            WidgetsManager.LoadWidgetContents(this, this, ContentManager.Get <XElement>("WE/DialogsWE/ImgDialog"));
            // WidgetsManager.LoadWidgetContents(this, this, XElement.Load(@"D:\Games\WSC\Content\WE\DialogsWE\ImgDialog.xml"));

            m_okButton     = this.Children.Find <ButtonWidget>("Img_Dialog.OK", true);
            m_cancelButton = this.Children.Find <ButtonWidget>("Img_Dialog.Cancel", true);


            m_type_creatingButton = this.Children.Find <ButtonWidget>("Img_Dialog.type_cr_btn", true);
            m_type_creatingLabel  = this.Children.Find <LabelWidget>("Img_Dialog.type_cr_text", true);

            m_resizeSlider = this.Children.Find <SliderWidget>("Img_Dialog.resize_sl", true);
            m_furniture_resolutionSlider = this.Children.Find <SliderWidget>("Img_Dialog.furn_res_sl", true);
            m_deep_colorSlider           = this.Children.Find <SliderWidget>("Img_Dialog.Slider_deep", true);
            m_color_ofsetSlider          = this.Children.Find <SliderWidget>("Img_Dialog.ofst_sl", true);

            m_posButton = this.Children.Find <ButtonWidget>("Img_Dialog.pos_sel", true);
            m_rotButton = this.Children.Find <ButtonWidget>("Img_Dialog.rot_sel", true);

            m_posLabel = this.Children.Find <LabelWidget>("Img_Dialog.pos_txt", true);
            m_rotLabel = this.Children.Find <LabelWidget>("Img_Dialog.rot_txt", true);


            m_colors_useBox = this.Children.Find <CheckboxWidget>("Img_Dialog.Line0", true);
            m_color_saveBox = this.Children.Find <CheckboxWidget>("Img_Dialog.Line1", true);
            m_mirrorBox     = this.Children.Find <CheckboxWidget>("Img_Dialog.mirror", true);

            m_resizeSlider.MinValue = 1f;
            m_resizeSlider.MaxValue = 8f;

            m_furniture_resolutionSlider.MinValue = 2f;
            m_furniture_resolutionSlider.MaxValue = 16f;


            m_color_ofsetSlider.MinValue = 0f;
            m_color_ofsetSlider.MaxValue = 8f;


            m_deep_colorSlider.MinValue = 2f;
            m_deep_colorSlider.MaxValue = 16f;



            t_c_txt = "Furniture";


            m_colors_useBox.IsChecked = false;
            m_color_saveBox.IsChecked = false;

            m_resizeSlider.Value = 2;
            m_furniture_resolutionSlider.Value = 16;
            m_deep_colorSlider.Value           = 16;



            pos_txt = "Horizontally";
            rot_txt = "Front";
        }