private void InventoryContentsChanged(MyInventoryBase inv) { if (!string.IsNullOrEmpty(m_grid.Name)) { bool isPowered = MyVisualScriptLogicProvider.HasPower(m_grid.Name) && m_block.IsWorking; //UpdateBar(isPowered); } }
public bool HasPower() { // Check if grid powered if (MyVisualScriptLogicProvider.HasPower(entityName) == false) { return(false); } else { return(true); } }
public bool IsPowered() { if (!ActiveEntity()) { return(false); } if (string.IsNullOrWhiteSpace(MyVisualScriptLogicProvider.GetEntityName(CubeGrid.EntityId))) { MyVisualScriptLogicProvider.SetName(CubeGrid.EntityId, CubeGrid.EntityId.ToString()); } return(MyVisualScriptLogicProvider.HasPower(CubeGrid.EntityId.ToString())); }
public bool IsWorking() { if (string.IsNullOrEmpty(m_mycubegrid.Name)) // if gridname is null create one { m_mycubegrid.Name = "INCORRECT_NAME_" + m_mycubegrid.EntityId.ToString(); MyAPIGateway.Entities.SetEntityName(m_mycubegrid, true); } if (!string.IsNullOrEmpty(m_mycubegrid.Name)) // gridname is not null { return(MyVisualScriptLogicProvider.HasPower(m_mycubegrid.Name) && m_block.IsWorking); } return(false); }