private void CreateCurrentPlayerTargetConditionsList() { currentPlayerTargetConditionsList = EditorUtils.SetupReorderableList("Target player conditions", currentPlayerTarget.conditions, ref currentPlayerTargetCondition, (rect, x) => { EditorGUI.LabelField(new Rect(rect.x, rect.y, 200, EditorGUIUtility.singleLineHeight), x.GetReadableString(gameConfig)); }, (x) => { currentPlayerTargetCondition = x; }, () => { var menu = new GenericMenu(); var conditionTypes = AppDomain.CurrentDomain.GetAllDerivedTypes(typeof(PlayerCondition)); foreach (var type in conditionTypes) { menu.AddItem(new GUIContent(StringUtils.DisplayCamelCaseString(type.Name)), false, CreatePlayerTargetConditionCallback, type); } menu.ShowAsContext(); }, (x) => { currentPlayerTargetCondition = null; }); }
private void CreateCurrentCardAbilitiesList() { currentCardAbilitiesList = EditorUtils.SetupReorderableList("Abilities", currentCard.abilities, ref currentCardAbility, (rect, x) => { EditorGUI.LabelField(new Rect(rect.x, rect.y, 200, EditorGUIUtility.singleLineHeight), x.name); }, (x) => { currentCardAbility = x; currentPlayerTargetConditionsList = null; currentPlayerTarget = null; currentPlayerTargetCondition = null; currentCardTargetConditionsList = null; currentCardTarget = null; currentCardTargetCondition = null; if (currentCardAbility is ActivatedAbility) { CreateCurrentEffectCostsList(); } }, () => { var menu = new GenericMenu(); menu.AddItem(new GUIContent("Triggered ability"), false, CreateCardAbilityCallback, 0); menu.AddItem(new GUIContent("Activated ability"), false, CreateCardAbilityCallback, 1); menu.ShowAsContext(); }, (x) => { currentCardAbility = null; currentPlayerTargetConditionsList = null; currentPlayerTarget = null; currentPlayerTargetCondition = null; currentCardTargetConditionsList = null; currentCardTarget = null; currentCardTargetCondition = null; }); }