public static bool TryGetAimedBlock(IMyPlayer player, out MyTextPanel panel) { panel = null; if (player == null) { return(false); } var character = ((MyCharacter)player.Character); if (character == null) { return(false); } if (!GridCache.TryGetGridById(character.AimedGrid, out var aimedGrid)) { return(false); } var aimedBlock = aimedGrid.GetCubeBlock(character.AimedBlock); if (aimedBlock.FatBlock is MyTextPanel txtPanel && Block.IsOwner(aimedBlock, player.IdentityId)) { panel = txtPanel; } return(panel != null); }
static void OnShowOnScreenSucess(ref ChangeShowOnScreenMsg msg, MyNetworkClient sender) { MyEntity entity = null; MyEntities.TryGetEntityById(msg.EntityId, out entity); MyTextPanel block = entity as MyTextPanel; if (block != null) { block.ShowTextFlag = (ShowTextOnScreenFlag)msg.Show; } }
static void OnSelectImageSucess(ref SelectImagesMsg msg, MyNetworkClient sender) { MyEntity entity = null; MyEntities.TryGetEntityById(msg.EntityId, out entity); MyTextPanel block = entity as MyTextPanel; if (block != null) { block.SelectItems(msg.Selection); } }
static void OnChangeIntervalSucess(ref ChangeIntervalMsg msg, MyNetworkClient sender) { MyEntity entity = null; MyEntities.TryGetEntityById(msg.EntityId, out entity); MyTextPanel block = entity as MyTextPanel; if (block != null) { block.ChangeInterval = msg.Interval; } }
static void OnChangeFontSizeSucess(ref ChangeFontSizeMsg msg, MyNetworkClient sender) { MyEntity entity = null; MyEntities.TryGetEntityById(msg.EntityId, out entity); MyTextPanel block = entity as MyTextPanel; if (block != null) { block.FontSize = msg.FontSize; } }
static void OnShowOnScreenRequest(ref ChangeShowOnScreenMsg msg, MyNetworkClient sender) { MyEntity entity = null; MyEntities.TryGetEntityById(msg.EntityId, out entity); MyTextPanel block = entity as MyTextPanel; if (block != null) { block.ShowTextFlag = (ShowTextOnScreenFlag)msg.Show; Sync.Layer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success); } }
static void OnSelectImageRequest(ref SelectImagesMsg msg, MyNetworkClient sender) { MyEntity entity = null; MyEntities.TryGetEntityById(msg.EntityId, out entity); MyTextPanel block = entity as MyTextPanel; if (block != null) { block.SelectItems(msg.Selection); Sync.Layer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success); } }
static void OnChangeIntervalRequest(ref ChangeIntervalMsg msg, MyNetworkClient sender) { MyEntity entity = null; MyEntities.TryGetEntityById(msg.EntityId, out entity); MyTextPanel block = entity as MyTextPanel; if (block != null) { block.ChangeInterval = msg.Interval; Sync.Layer.SendMessageToAll(ref msg, MyTransportMessageEnum.Success); } }
public static bool TryGetAimedTextPanel(IMyPlayer player, out MyTextPanel textpanel) { if (player.Character is MyCharacter character && character.AimedGrid != 0) { var aimedBlock = (MyEntities.GetEntityById(character.AimedGrid) as MyCubeGrid) ?.GetCubeBlock(character.AimedBlock); if (aimedBlock?.BlockDefinition is MyTextPanelDefinition) { textpanel = aimedBlock.FatBlock as MyTextPanel; return(true); } } textpanel = null; return(false); }
public MyUseObjectTextPanel(IMyEntity owner, string dummyName, MyModelDummy dummyData, uint key) : base(owner, dummyData) { m_textPanel = (MyTextPanel)owner; m_localMatrix = dummyData.Matrix; }
public MySyncTextPanel(MyTextPanel block) : base(block) { m_block = block; }
public static void SuffixLCDInitialized(MyTextPanel __instance) { typeof(MyTextPanel).GetField("m_publicTitle", BindingFlags.NonPublic | BindingFlags.Instance).SetValue(__instance, new StringBuilder(32000)); }
public MyRenderComponentTextPanel(MyTextPanel panel) { m_textPanel = panel; }
public MyUseObjectTextPanel(MyCubeBlock owner, string dummyName, MyModelDummy dummyData, int key) { m_textPanel = (MyTextPanel)owner; m_localMatrix = dummyData.Matrix; }