public bool isVersionReady(AgentSetVersion s) { if (status) { for (int i = 0; i < MetaData.Count; i++) if (MetaData[i].value == "NOT SET") return false; for (int i = 0; i < Strings.Count; i++) if (Strings.strings[i].value == "NOT SET") return false; for (int i = 0; i < ManifestSource.RequiredAgents.Count; i++) if (!s.isPluginActive(ManifestSource.RequiredAgents[i])) return false; } return true; }
public void OnGUI(AgentVersion version, AgentDependency deps, AgentSetVersion vset) { GUIStyle status_style = GreenLabel; if (version.MetaData.Count > 0) { EditorGUILayout.LabelField("Meta-Datas", SubBoldLabel); for (int i = 0; i < version.MetaData.Count; i++) { version.MetaData[i].value = EditorGUILayout.TextField(version.MetaData[i].name, version.MetaData[i].value); version.MetaData[i].resource = EditorGUILayout.TextField("Resource", version.MetaData[i].resource); } } else EditorGUILayout.LabelField("No Meta-Data is Required", SubBoldLabel); if (version.ManifestSource.Strings.Count > 0) { EditorGUILayout.LabelField("Strings", SubBoldLabel); for (int i = 0; i < version.Strings.Count; i++) { version.Strings.strings[i].value = EditorGUILayout.TextField(version.Strings.strings[i].name, version.Strings.strings[i].value); } } else EditorGUILayout.LabelField("No String Resource is Required", SubBoldLabel); if (version.ManifestSource.Permission.Count > 0) { EditorGUILayout.LabelField("Permissions", SubBoldLabel); status_style = GreenLabel; for (int i = 0; i < version.ManifestSource.Permission.Count; i++) { status_style = GreenLabel; string perm = version.ManifestSource.Permission[i].name; if (!manifest.hasPermission(perm)) status_style = RedLabel; EditorGUILayout.LabelField(perm, status_style); } } else EditorGUILayout.LabelField("No Permission is Required", SubBoldLabel); if (version.ManifestSource.Activity.Count > 0) { EditorGUILayout.LabelField("Activities", SubBoldLabel); for (int i = 0; i < version.ManifestSource.Activity.Count; i++) { ManifestActivity act = version.ManifestSource.Activity[i]; status_style = GreenLabel; if (!manifest.hasActivity(act.name)) status_style = RedLabel; EditorGUILayout.LabelField(act.name, status_style); for (int j = 0; j < act.meta_data.Count; j++) { act.meta_data[j].value = EditorGUILayout.TextField(act.meta_data[j].name, act.meta_data[j].value); act.meta_data[j].resource = EditorGUILayout.TextField("Resource", act.meta_data[j].resource); } } } else EditorGUILayout.LabelField("No Activity is Required", SubBoldLabel); if (version.ManifestSource.RequiredAgents.Count > 0) { EditorGUILayout.LabelField("Dependencies", SubBoldLabel); for (int i = 0; i < version.ManifestSource.RequiredAgents.Count; i++) { status_style = GreenLabel; if (!deps.hasAgent(version.ManifestSource.RequiredAgents[i])) { status_style = RedLabel; EditorGUILayout.LabelField("Warning: No plugin with filename: " + version.ManifestSource.RequiredAgents[i] + " found. Maybe your Plugin Manager is out-dated.", YellowLabel); } else if (!vset.isPluginActive(version.ManifestSource.RequiredAgents[i])) status_style = RedLabel; EditorGUILayout.LabelField(version.ManifestSource.RequiredAgents[i], status_style); } } else EditorGUILayout.LabelField("No Additional Plugins Required"); }