public MyUseObjectPanelButton(MyCubeBlock owner, string dummyName, MyModelDummy dummyData, int key)
        {
            m_buttonPanel = owner as MyButtonPanel;
            m_localMatrix = dummyData.Matrix;

            int orderNumber = 0;
            var parts =  dummyName.Split('_');
            int.TryParse(parts[parts.Length - 1], out orderNumber);
            m_index = orderNumber - 1;
            if (m_index >= m_buttonPanel.BlockDefinition.ButtonCount)
            {
                MyLog.Default.WriteLine(string.Format("{0} Button index higher than defined count.", m_buttonPanel.BlockDefinition.Id.SubtypeName));
                Debug.Fail(string.Format("{0} Button index higher than defined count.", m_buttonPanel.BlockDefinition.Id.SubtypeName));
                m_index = m_buttonPanel.BlockDefinition.ButtonCount - 1;
            }
        }
Example #2
0
 public MySyncButtonPanel(MyButtonPanel panel)
     : base(panel)
 {
     m_panel = panel;
 }
Example #3
0
 public MySyncButtonPanel(MyButtonPanel panel)
     :base(panel)
 {
     m_panel = panel;
 }