public void RefreshObjList() { ObjectList.Items.Clear(); //We want a full refresh, so clear out all previous objects switch (loadedRSDKver) { case 3: Object_Definitions.Retro_SonicObjects RSObj = new Object_Definitions.Retro_SonicObjects(); for (int i = 0; i < objectsV1.Count; i++) { string Obj; string t = RSObj.GetObjectByType(objectsV1[i].type, objectsV1[i].subtype).Name; //Get the object name if (t != null) { Obj = t + ", " + objectsV1[i].xPos + ", " + objectsV1[i].yPos; } //If the object's definition is found, we use it's name in the list else { Obj = "Unnamed Object" + ", " + objectsV1[i].xPos + ", " + objectsV1[i].yPos; } //If not, call it "Unnamed Object" ObjectList.Items.Add(Obj); } break; case 2: Object_Definitions.SonicNexusObjects RSDK2Obj = new Object_Definitions.SonicNexusObjects(); for (int i = 0; i < objectsV2.Count; i++) { string Obj; string t = RSDK2Obj.GetObjectByType(objectsV2[i].type, objectsV2[i].subtype).Name; if (t != null) { Obj = t + ", " + objectsV2[i].xPos + ", " + objectsV2[i].yPos; } else { Obj = "Unnamed Object" + ", " + objectsV2[i].xPos + ", " + objectsV2[i].yPos; } ObjectList.Items.Add(Obj); } break; case 1: Object_Definitions.SonicCDObjects RSDK3Obj = new Object_Definitions.SonicCDObjects(); for (int i = 0; i < objectsV3.Count; i++) { string Obj; string t = RSDK3Obj.GetObjectByType(objectsV3[i].type, objectsV3[i].subtype).Name; if (t != null) { Obj = t + ", " + objectsV3[i].xPos + ", " + objectsV3[i].yPos; } else { Obj = "Unnamed Object" + ", " + objectsV3[i].xPos + ", " + objectsV3[i].yPos; } ObjectList.Items.Add(Obj); } break; case 0: Object_Definitions.Sonic1Objects RSDKBObj = new Object_Definitions.Sonic1Objects(); for (int i = 0; i < objectsV4.Count; i++) { string Obj; string t = RSDKBObj.GetObjectByType(objectsV4[i].type, objectsV4[i].subtype).Name; if (t != null) { Obj = t + ", " + objectsV4[i].xPos + ", " + objectsV4[i].yPos; } else { Obj = "Unnamed Object" + ", " + objectsV4[i].xPos + ", " + objectsV4[i].yPos; } ObjectList.Items.Add(Obj); } break; } }