private void CloseWindow(bool isPublic) { MyGuiScreenGamePlay.ActiveGameplayScreen = MyGuiScreenGamePlay.TmpGameplayScreenHolder; MyGuiScreenGamePlay.TmpGameplayScreenHolder = null; MySession.Static.Gpss.ScanText(m_textBox.Description.Text.ToString(), PublicTitle); SyncObject.SendChangeDescriptionMessage(m_textBox.Description.Text, isPublic); SyncObject.SendChangeOpenMessage(false); }
bool ModAPI.Ingame.IMyTextPanel.WritePrivateText(string value, bool append) { if (m_isOpen) { return(false); } if (append == false) { m_privateDescriptionHelper.Clear(); } m_privateDescriptionHelper.Append(value); SyncObject.SendChangeDescriptionMessage(m_privateDescriptionHelper, false); return(true); }
private void CloseWindow(bool isPublic) { MyGuiScreenGamePlay.ActiveGameplayScreen = MyGuiScreenGamePlay.TmpGameplayScreenHolder; MyGuiScreenGamePlay.TmpGameplayScreenHolder = null; MySession.Static.Gpss.ScanText(m_textBox.Description.Text.ToString(), PublicTitle); foreach (var block in CubeGrid.CubeBlocks) { if (block.FatBlock != null && block.FatBlock.EntityId == EntityId) { SyncObject.SendChangeDescriptionMessage(m_textBox.Description.Text, isPublic); SyncObject.SendChangeOpenMessage(false); return; } } }
public override void UpdateAfterSimulation() { base.UpdateAfterSimulation(); if (IsBeingHacked) { PrivateDescription.Clear(); SyncObject.SendChangeDescriptionMessage(PrivateDescription, false); } PowerReceiver.Update(); if (IsFunctional && IsWorking) { if (ShowTextOnScreen && IsInRange() == false) { if (!m_isOutofRange) { m_isOutofRange = true; ReleaseRenderTexture(); } return; } if (ShowTextOnScreen && (NeedsToDrawText() || m_isOutofRange || m_forceUpdateText)) { m_descriptionChanged = false; m_forceUpdateText = false; m_fontColorChanged = false; m_fontSizeChanged = false; m_backgroundColorChanged = false; Render.RenderTextToTexture(EntityId, ShowTextFlag == ShowTextOnScreenFlag.PUBLIC ? m_publicDescription.ToString() : m_privateDescription.ToString(), FontSize * BlockDefinition.TextureResolution / DEFAULT_RESOLUTION, FontColor, BackgroundColor, BlockDefinition.TextureResolution, BlockDefinition.TextureAspectRadio); FailedToRenderTexture = false; } m_isOutofRange = false; if (ShowTextOnScreen == false) { UpdateTexture(); } } }