public void AddImagesToSelection() { if (m_selectedTextures == null) { return; } if (m_selectedTextures.Count == 0) { return; } int[] selection = new int[m_selectedTextures.Count]; for (int i = 0; i < m_selectedTextures.Count; ++i) { for (int j = 0; j < m_definitions.Count; ++j) { if (m_selectedTextures[i].Text.ToString() == m_definitions[j].Id.SubtypeName) { selection[i] = j; break; } } } SyncObject.SendAddImagesToSelectionRequest(selection); }
void ModAPI.Ingame.IMyTextPanel.AddImageToSelection(string id, bool checkExistence) { if (id == null) { return; } for (int t = 0; t < m_definitions.Count; t++) { if (m_definitions[t].Id.SubtypeName == id) { if (checkExistence) { for (int i = 0; i < m_selectedTexturesToDraw.Count; i++) { if (m_selectedTexturesToDraw[i].Id.SubtypeName == id) { return; } } } SyncObject.SendAddImagesToSelectionRequest(new int[1] { t }); return; } } }
void ModAPI.Ingame.IMyTextPanel.AddImagesToSelection(List <string> ids, bool checkExistence) { if (ids == null) { return; } List <int> selection = new List <int>(); bool doNotAdd; foreach (var id in ids) { for (int t = 0; t < m_definitions.Count; t++) { if (m_definitions[t].Id.SubtypeName == id) { doNotAdd = false; if (checkExistence) { for (int i = 0; i < m_selectedTexturesToDraw.Count; i++) { if (m_selectedTexturesToDraw[i].Id.SubtypeName == id) { doNotAdd = true; break; } } } if (!doNotAdd) { selection.Add(t); } break; } } } if (selection.Count > 0) { SyncObject.SendAddImagesToSelectionRequest(selection.ToArray()); } }