public override string GetDisplayName(SubsystemTerrain subsystemTerrain, int value) { return(DisplayName); }
public virtual string GetDisplayName(SubsystemTerrain subsystemTerrain, int value) { return(DisplayName); }
public override BlockPlacementData GetDigValue(SubsystemTerrain subsystemTerrain, ComponentMiner componentMiner, int value, int toolValue, TerrainRaycastResult raycastResult) { return(GetItem(ref value).GetDigValue(subsystemTerrain, componentMiner, value, toolValue, raycastResult)); }
public override BlockPlacementData GetPlacementValue(SubsystemTerrain subsystemTerrain, ComponentMiner componentMiner, int value, TerrainRaycastResult raycastResult) { int value2 = value; return(GetItem(ref value2).GetPlacementValue(subsystemTerrain, componentMiner, value, raycastResult)); }
public override string GetDisplayName(SubsystemTerrain subsystemTerrain, int value) { return(GetItem(ref value).GetDisplayName(subsystemTerrain, value)); }
public override bool IsInteractive(SubsystemTerrain subsystemTerrain, int value) { return(GetItem(ref value).IsInteractive(subsystemTerrain, value)); }
public virtual bool IsFaceTransparent(SubsystemTerrain subsystemTerrain, int face, int value) { return(false); }
public override BoundingBox[] GetCustomInteractionBoxes(SubsystemTerrain terrain, int value) { return(base.GetCustomInteractionBoxes(terrain, value)); }
public virtual bool IsInteractive(SubsystemTerrain subsystemTerrain, int value) { return(false); }
public virtual BlockDebrisParticleSystem CreateDebrisParticleSystem(SubsystemTerrain subsystemTerrain, Vector3 position, int value, float strength) { return(new BlockDebrisParticleSystem(subsystemTerrain, position, strength, 1f, Color.White, GetFaceTextureSlot(4, value))); }
public virtual ElectricConnectorType?GetConnectorType(SubsystemTerrain terrain, int value, int face, int connectorFace, int x, int y, int z) {//设置输入输出模式 return(ElectricConnectorType.InputOutput); }
public virtual bool ShouldGenerateFace(SubsystemTerrain subsystemTerrain, int face, int value, int neighborValue) { return(true); }
public virtual BoundingBox[] GetCustomCollisionBoxes(SubsystemTerrain terrain, int value) { return(Game.Block.m_defaultCollisionBoxes); }
public ChunkData(CreatorAPI creatorAPI) { this.creatorAPI = creatorAPI; this.subsystemTerrain = creatorAPI.componentMiner.Project.FindSubsystem <SubsystemTerrain>(true); }
public override BoundingBox[] GetCustomCollisionBoxes(SubsystemTerrain terrain, int value) => m_collisionBoxes;
public Round(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/RoundDialog")); m_title = this.Children.Find <LabelWidget>("Round_Dialog.Title", true); Mode = this.Children.Find <LabelWidget>("Round_Dialog.Mode", true); mPosition = this.Children.Find <LabelWidget>("Round_Dialog.Pos", true); Icon_select = this.Children.Find <ButtonWidget>("Round_Dialog.Icon_select", true); mselect_pos = this.Children.Find <ButtonWidget>("Round_Dialog.Select_pos", true); m_radius = this.Children.Find <SliderWidget>("Round_Dialog.Slider1", true); m_lenght = this.Children.Find <SliderWidget>("Round_Dialog.Slider2", true); plusButton = this.Children.Find <ButtonWidget>("Round_Dialog.Button4", true); minusButton = this.Children.Find <ButtonWidget>("Round_Dialog.Button3", true); lenght_plusButton = this.Children.Find <ButtonWidget>("Round_Dialog.Button2", true); lenght_minusButton = this.Children.Find <ButtonWidget>("Round_Dialog.Button1", true); mSelect_mode = this.Children.Find <ButtonWidget>("Round_Dialog.Select_mode", true); m_okButton = this.Children.Find <ButtonWidget>("Round_Dialog.OK", true); m_cancelButton = this.Children.Find <ButtonWidget>("Round_Dialog.Cancel", true); this.m_blockIconWidget = this.Children.Find <BlockIconWidget>("Round_Dialog.Icon", true); m_title.Text = "Round"; //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, }); } }
public override BlockPlacementData GetPlacementValue(SubsystemTerrain subsystemTerrain, ComponentMiner componentMiner, int value, TerrainRaycastResult raycastResult) { return(new BlockPlacementData { Value = value, CellFace = raycastResult.CellFace }); }
public override BoundingBox[] GetCustomCollisionBoxes(SubsystemTerrain terrain, int value) { return(GetItem(ref value).GetCustomCollisionBoxes(terrain, value)); }
public override void Update() { if (this.SphereButton.IsClicked) { DialogsManager.ShowDialog(player.View.GameWidget, new SphereDialog(creatorAPI)); } if (this.PrismButton.IsClicked) { DialogsManager.ShowDialog(player.View.GameWidget, new PrismDialog(creatorAPI)); } if (this.PyramidButton.IsClicked) { DialogsManager.ShowDialog(player.View.GameWidget, new PyramidDialog(creatorAPI)); } if (this.CylindricalButton.IsClicked) { DialogsManager.ShowDialog(player.View.GameWidget, new CylindricalDialog(creatorAPI)); } if (this.PrismColumnButton.IsClicked) { DialogsManager.ShowDialog(player.View.GameWidget, new PrismColumnDialog(creatorAPI)); } if (this.PillarsButton.IsClicked) { DialogsManager.ShowDialog(player.View.GameWidget, new PillarsDialog(creatorAPI)); } if (this.RectangularButton.IsClicked) { DialogsManager.ShowDialog(player.View.GameWidget, new RectangularDialog(creatorAPI)); } if (this.CircleButton.IsClicked) { DialogsManager.ShowDialog(player.View.GameWidget, new CircleDialog(creatorAPI)); } if (this.MazeButton.IsClicked) { DialogsManager.ShowDialog(player.View.GameWidget, new MazeDialog(creatorAPI)); } if (this.PavageButton.IsClicked) { DialogsManager.ShowDialog(player.View.GameWidget, new PavageDialog(creatorAPI)); } if (this.FillingButton.IsClicked) { DialogsManager.ShowDialog(player.View.GameWidget, new FillingDialog(creatorAPI)); } if (this.MountainButton.IsClicked) { DialogsManager.ShowDialog(player.View.GameWidget, new MountainDialog(creatorAPI)); } if (this.TransferButton.IsClicked) { DialogsManager.ShowDialog(player.View.GameWidget, new TransferDialog(creatorAPI)); } if (this.LevelSetButton.IsClicked) { DialogsManager.ShowDialog(player.View.GameWidget, new LevelSetDialog(creatorAPI)); } if (this.SetButton.IsClicked) { DialogsManager.ShowDialog(player.View.GameWidget, new SetDialog(creatorAPI)); } if (this.SpiralButton.IsClicked) { DialogsManager.ShowDialog(player.View.GameWidget, new SpiralDialog(creatorAPI)); } if (this.PenetrateButton.IsClicked) { if (CreatorMain.Penetrate) { foreach (int blockID in CreatorMain.PenetrateBlocksID) { BlocksManager.Blocks[blockID].IsCollidable = true; } CreatorMain.PenetrateBlocksID.Clear(); } else { this.worldSettings.EnvironmentBehaviorMode = EnvironmentBehaviorMode.Static; foreach (Block block in BlocksManager.Blocks) { if (block.IsCollidable) { block.IsCollidable = false; CreatorMain.PenetrateBlocksID.Add(block.BlockIndex); } } } CreatorMain.Penetrate = !CreatorMain.Penetrate; } if (this.LightWorldButton.IsClicked) { if (CreatorMain.LightWorld) { foreach (int blockID in CreatorMain.LightWorldBlockID) { BlocksManager.Blocks[blockID].EmittedLightAmount = 0; } CreatorMain.LightWorldBlockID.Clear(); } else { foreach (Block block in BlocksManager.Blocks) { if (block.EmittedLightAmount == 0) { block.EmittedLightAmount = 15; CreatorMain.LightWorldBlockID.Add(block.BlockIndex); } } } CreatorMain.LightWorld = !CreatorMain.LightWorld; } if (CreatorMain.LightWorld) { this.LightWorldButton.Color = Color.Yellow; } else { this.LightWorldButton.Color = Color.White; } if (CreatorMain.Penetrate) { this.PenetrateButton.Color = Color.Yellow; } else { this.PenetrateButton.Color = Color.White; } if (this.EditRegionButton.IsClicked) { DialogsManager.ShowDialog(player.View.GameWidget, new EditRegionDialog(creatorAPI)); } if (this.EditWorldButton.IsClicked) { DialogsManager.ShowDialog(player.View.GameWidget, new EditWorldDialog(creatorAPI)); } if (this.ClearBlockButton.IsClicked) { this.player.ComponentGui.DisplaySmallMessage("可在设置中关闭生成在来停止正在清理的进程,在超距模式下谨慎使用清理方块", true, false); this.creatorAPI.ClearBlock = !this.creatorAPI.ClearBlock; } if (this.creatorAPI.ClearBlock) { this.ClearBlockButton.Color = Color.Yellow; } else { this.ClearBlockButton.Color = Color.White; } if (this.SetLinkButton.IsClicked) { DialogsManager.ShowDialog(player.View.GameWidget, new TwoPointLineDialog(creatorAPI)); } /* if (this.SetLinkButton.IsClicked) * { * if (this.creatorAPI.twoPointsOfAttachment) * this.creatorAPI.twoPointsOfAttachment = false; * else * this.creatorAPI.twoPointsOfAttachment = true; * } * if (this.creatorAPI.twoPointsOfAttachment) this.SetLinkButton.Color = Color.Yellow; else this.SetLinkButton.Color = Color.White;*/ if (this.SetPositionButton.IsClicked) { Vector3 position = player.ComponentBody.Position; Point3 point3 = new Point3((int)position.X, (int)position.Y, (int)position.Z); int[] p = new int[4] { 1, 2, 3, 4 }; DialogsManager.ShowDialog(null, new ListSelectionDialog("选择设置的点", p, 56f, (object e) => $"设置点{(int)e}", delegate(object e) { creatorAPI.Position[(int)e - 1] = point3; this.player.ComponentGui.DisplaySmallMessage($"成功设置点{(int)e}:\nX:{point3.X} , Y:{point3.Y} , Z:{point3.Z}", true, true); })); } if (this.creatorAPI.RevokeSwitch) { if (creatorAPI.revokeData == null) { this.RevokeButton.IsEnabled = false; } else { this.RevokeButton.IsEnabled = true; } } else { this.RevokeButton.IsEnabled = false; } if (this.RevokeButton.IsClicked) { this.creatorAPI.revokeData.Render(); this.player.ComponentGui.DisplaySmallMessage($"撤回成功", true, true); } if (this.SetSpawn.IsClicked) { Vector3 position = this.player.ComponentBody.Position; this.player.PlayerData.SpawnPosition = position + new Vector3(0f, 0.1f, 0f); this.player.ComponentGui.DisplaySmallMessage(string.Format("玩家重生点位置设置\n X: {0} Y : {1} Z : {2}", (int)position.X, (int)position.Y, (int)position.Z), true, true); } if (this.ModButton.IsClicked) { DialogsManager.ShowDialog(player.View.GameWidget, new ModDialog(creatorAPI)); } if (this.ReplaceButton.IsClicked) { DialogsManager.ShowDialog(player.View.GameWidget, new ReplaceDialog(creatorAPI)); } if (this.SetModeButton.IsClicked) { DialogsManager.ShowDialog(player.View.GameWidget, new SetModeDialog(creatorAPI)); } if (this.OnekeyButton.IsClicked) { DialogsManager.ShowDialog(player.View.GameWidget, new OnekeyGenerationDialog(creatorAPI)); } if (this.CopyPasteButton.IsClicked) { DialogsManager.ShowDialog(player.View.GameWidget, new CopyPasteDialog(creatorAPI)); } this.ClearCacheButton.IsEnabled = Directory.Exists(CreatorMain.CacheDirectory); if (this.ClearCacheButton.IsClicked) { if (FileOperation.Delete(CreatorMain.CacheDirectory)) { this.player.ComponentGui.DisplaySmallMessage("清除成功", true, true); } else { this.player.ComponentGui.DisplaySmallMessage("清除失败", true, true); } } if (this.RemoveAnimalButton.IsClicked) { int num = 0; foreach (ComponentCreature current in player.Project.FindSubsystem <SubsystemCreatureSpawn>(true).Creatures) { if (!(current is ComponentPlayer)) { current.ComponentSpawn.Despawn(); num++; } } this.player.ComponentGui.DisplaySmallMessage(string.Format("清除成功,共清除{0}只动物", num), true, false); } if (this.RemoveItemButton.IsClicked) { int num = 0; foreach (Pickable item in GameManager.Project.FindSubsystem <SubsystemPickables>(true).Pickables) { item.Count = 0; item.ToRemove = true; num++; } this.player.ComponentGui.DisplaySmallMessage(string.Format("清除成功,共清除{0}个掉落物", num), true, false); } if (this.TerrainTestButton.IsClicked) { IList <int> enumValues = EnumUtils.GetEnumValues(typeof(CreatorTerrainType)); SubsystemTerrain subsystemTerrain = GameManager.Project.FindSubsystem <SubsystemTerrain>(); DialogsManager.ShowDialog(null, new ListSelectionDialog("选择地形类型", enumValues, 56f, (object e) => ((TerrainGenerationMode)e).ToString(), delegate(object e) { ITerrainContentsGenerator myTerrain; if ((CreatorTerrainType)e == CreatorTerrainType.Flat) { myTerrain = new CreatorNormalTerrain(subsystemTerrain); } else { myTerrain = new CreatorNormalTerrain(subsystemTerrain); } subsystemTerrain.Dispose(); subsystemTerrain.Load(new ValuesDictionary()); subsystemTerrain.TerrainContentsGenerator = myTerrain; })); } if (this.SetPositionCarefulButton.IsClicked) { } if (this.AdjustPositionButton.IsClicked) { } if (this.ThreePointPlaneButton.IsClicked) { DialogsManager.ShowDialog(player.View.GameWidget, new ThreePointToPlaneDialog(creatorAPI)); } if (this.FourPointSpaceButton.IsClicked) { DialogsManager.ShowDialog(player.View.GameWidget, new FourPointSpaceDialog(creatorAPI)); } //......... if (this.SetDifficultyButton.IsClicked) { Vector3 position = player.ComponentBody.Position; Point3 point3 = new Point3((int)position.X, (int)position.Y, (int)position.Z); int[] p = new int[4] { 0, 1, 2, 3 }; string[] difference = new string[4] { "容易", "一般", "困难", "地狱" }; DialogsManager.ShowDialog(null, new ListSelectionDialog("选择难度", p, 56f, (object e) => difference[(int)e], delegate(object e) { this.player.ComponentGui.DisplaySmallMessage($"成功设置难度位: {difference[(int)e]}", true, true); })); } }
public override bool IsFaceTransparent(SubsystemTerrain subsystemTerrain, int face, int value) { return(GetItem(ref value).IsFaceTransparent(subsystemTerrain, face, value)); }
public override bool IsFaceTransparent(SubsystemTerrain subsystemTerrain, int face, int value) { return(true); }
public override void GetDropValues(SubsystemTerrain subsystemTerrain, int oldValue, int newValue, int toolLevel, List <BlockDropValue> dropValues, out bool showDebris) { GetItem(ref oldValue).GetDropValues(subsystemTerrain, oldValue, newValue, toolLevel, dropValues, out showDebris); }
public override BlockPlacementData GetPlacementValue(SubsystemTerrain subsystemTerrain, ComponentMiner componentMiner, int value, TerrainRaycastResult raycastResult) { return(ILibrary.GetPlacementValue(subsystemTerrain, componentMiner, value, raycastResult)); }
public override BlockDebrisParticleSystem CreateDebrisParticleSystem(SubsystemTerrain subsystemTerrain, Vector3 position, int value, float strength) { return(GetItem(ref value).CreateDebrisParticleSystem(subsystemTerrain, position, value, strength)); }
public ElectricConnectorType?GetConnectorType(SubsystemTerrain terrain, int value, int face, int connectorFace, int x, int y, int z) {//设置输入输出模式 return(GetItem(ref value).GetConnectorType(terrain, value, face, connectorFace, x, y, z)); }
public override bool IsInteractive(SubsystemTerrain subsystemTerrain, int value) { return(true); }
public int Paint(SubsystemTerrain subsystemTerrain, int value, int?color) { return(0); }
public override BoundingBox[] GetCustomCollisionBoxes(SubsystemTerrain terrain, int value) { return(boundingBoxes.ToArray()); }
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(); }