public override void Init(MyObjectBuilder_CubeBlock objectBuilder, MyCubeGrid cubeGrid)
        {
            SyncFlag = true;

            var sinkComp = new MyResourceSinkComponent();

            sinkComp.Init(
                BlockDefinition.ResourceSinkGroup,
                BlockDefinition.RequiredPowerInput,
                () => (Enabled && IsFunctional) ? ResourceSink.MaxRequiredInput : 0f);
            ResourceSink = sinkComp;

            base.Init(objectBuilder, cubeGrid);

            MyObjectBuilder_TextPanel ob = (MyObjectBuilder_TextPanel)objectBuilder;

            PrivateTitle.Append(ob.Title);
            PrivateDescription.Append(ob.Description);
            PublicDescription.Append(ob.PublicDescription);
            PublicTitle.Append(ob.PublicTitle);

            m_currentPos = ob.CurrentShownTexture;
            AccessFlag   = ob.AccessFlag;

            if (Sync.IsServer && Sync.Clients != null)
            {
                Sync.Clients.ClientRemoved += TextPanel_ClientRemoved;
            }

            FontColor                  = ob.FontColor;
            BackgroundColor            = ob.BackgroundColor;
            NeedsUpdate               |= MyEntityUpdateEnum.EACH_FRAME;
            Render.NeedsDrawFromParent = true;
            this.ChangeInterval        = ob.ChangeInterval;
            FontSize     = ob.FontSize;
            ShowTextFlag = ob.ShowText;
            if (ob.SelectedImages != null)
            {
                foreach (var savedTextureName in ob.SelectedImages)
                {
                    foreach (var textureDefinition in m_definitions)
                    {
                        if (textureDefinition.Id.SubtypeName == savedTextureName)
                        {
                            m_selectedTexturesToDraw.Add(textureDefinition);
                            break;
                        }
                    }
                }
                m_currentPos = Math.Min(m_currentPos, m_selectedTexturesToDraw.Count);
                RaisePropertiesChanged();
            }


            ResourceSink.Update();
            ResourceSink.IsPoweredChanged += PowerReceiver_IsPoweredChanged;
            SlimBlock.ComponentStack.IsFunctionalChanged += ComponentStack_IsFunctionalChanged;
        }
Beispiel #2
0
 private void EnterPublicTitle(string title)
 {
     PublicTitle.Click();
     PublicTitle.SendKeys("Public Title" + title);
 }