use of main.content.values.properties.PROPERTY in project Eidolons by IDemiurge.
the class ResourceMaster method updateImagePath.
private static void updateImagePath(ObjType type) {
for (PROPERTY prop : props) {
if (!type.checkProperty(prop))
continue;
String path = getNewImagePath(prop, type);
type.setProperty(prop, path);
}
}
use of main.content.values.properties.PROPERTY in project Eidolons by IDemiurge.
the class ContentManager method getPROP.
public static PROPERTY getPROP(String valueName) {
PROPERTY property = propCache.get(valueName);
if (property != null) {
if (property != G_PROPS.EMPTY_VALUE) {
return property;
}
}
property = getPROP(valueName, true);
if (property == null) {
property = getPROP(valueName, false);
}
if (property == null) {
LogMaster.log(LogMaster.CORE_DEBUG, "PROPERTY NOT FOUND: " + valueName + "!");
}
if (property == null) {
property = G_PROPS.EMPTY_VALUE;
}
propCache.put(valueName, property);
if (property == G_PROPS.EMPTY_VALUE) {
return null;
}
return property;
}
use of main.content.values.properties.PROPERTY in project Eidolons by IDemiurge.
the class MC_ControlPanel method doFilter.
public static void doFilter(boolean alt, boolean shift) {
// if (alt) {
// AHK_Master.getPanel().resetFilter();
// }
PROPERTY filterProp = null;
if (alt) {
filterProp = AT_PROPS.MUSIC_TYPE;
} else {
int choice = DialogMaster.optionChoice(filter_vals, "Value to Filter by?");
if (choice >= 0) {
filterProp = filter_vals[choice];
}
}
String filterVal = null;
if (filterProp != null) {
filterVal = CreationHelper.getInput(filterProp);
}
// strict filter
if (!shift) {
MusicListPanel panel = MusicCore.getFilterView(filterVal, filterProp);
// additionalViews.put(panel.getName(), panel); TODO
AHK_Master.getPanel().getViewsPanel().addView(panel);
AHK_Master.getPanel().getViewsPanel().viewClicked(panel.getView().getName());
return;
}
AHK_Master.getPanel().setFilterProp(filterProp);
AHK_Master.getPanel().setFilterValue(filterVal);
// AHK_Master.getPanel().setFilterOut(shift);
// if (c)
// AHK_Master.getPanel().setHighlight_disable_remove(
// DialogMaster.ask("What to do with filtered lists?", true,
// "Highlight",
// "Disable", "Remove"));
// else
AHK_Master.getPanel().setHighlight_disable_remove(null);
AHK_Master.getPanel().setViewAndRefresh(null);
AHK_Master.getPanel().refresh();
}
use of main.content.values.properties.PROPERTY in project Eidolons by IDemiurge.
the class MC_ControlPanel method filterViaDialog.
public static List<ObjType> filterViaDialog(List<ObjType> types, boolean ctrl, boolean shift) {
String filterValue;
PROPERTY filterProp;
boolean filterIn = !shift;
boolean template = ctrl || DialogMaster.confirm("Template or Custom filter?");
if (template) {
// MusicMouseListener.s
boolean group_tag = DialogMaster.confirm("Group or Tag Template?");
Object[] values;
if (group_tag) {
filterProp = AT_PROPS.MUSIC_TYPE;
values = MusicCore.std_groups[DialogMaster.optionChoice("Choose Template", (Object[]) MusicCore.std_groups)];
} else {
filterProp = AT_PROPS.MUSIC_TAGS;
values = MusicCore.std_tags[DialogMaster.optionChoice("Choose Template", (Object[]) MusicCore.std_tags)];
}
filterValue = StringMaster.constructContainer(ListMaster.toStringList(values));
} else {
if (!shift) {
filterIn = DialogMaster.confirm("Filter In or Filter Out?");
}
filterProp = filter_vals[DialogMaster.optionChoice(filter_vals, "Filter by...?")];
filterValue = CreationHelper.getInput(filterProp, null, null, INPUT_REQ.MULTI_ENUM);
}
return (List<ObjType>) FilterMaster.filter(types, filterProp.getName(), filterValue, AT_OBJ_TYPE.MUSIC_LIST, true, !filterIn, null);
}
use of main.content.values.properties.PROPERTY in project Eidolons by IDemiurge.
the class MusicCore method getGroupedView.
public static MusicListPanel getGroupedView(int option, Class<?> constClass) {
if (option == -1) {
return null;
}
PROPERTY filterProp = ContentManager.getPROP(constClass.getSimpleName());
// String[] array = (AHK_Master.qwerty + " " +
// AHK_Master.qwerty.substring(1).toUpperCase() + " 123")
// .split(" ");
String viewName = "All " + StringMaster.getWellFormattedString(constClass.getSimpleName());
Map<String, List<String>> map = new XLinkedMap<>();
List<String> musicConsts = EnumMaster.getEnumConstantNames(constClass);
if (option != 0) {
musicConsts = getMusicConsts(constClass, option);
viewName = getViewName(constClass, option);
}
Map<ObjType, String> multiPropMap = new HashMap<>();
loop: for (String g : musicConsts) {
// map.
List<String> list = new ArrayList<>();
// for (MusicList musList : listTypeMap.values()) {
typeLoop: for (ObjType type : DataManager.getTypes(AT_OBJ_TYPE.MUSIC_LIST)) {
if (type.checkProperty(filterProp, g)) {
if (filterProp.isContainer()) {
containerLoop: for (String sub : StringMaster.open(type.getProperty(filterProp))) {
for (String c : musicConsts) {
if (StringMaster.compare(c, sub)) {
if (c.equalsIgnoreCase(g)) {
break containerLoop;
} else {
multiPropMap.put(type, c);
continue typeLoop;
}
}
}
}
}
list.add(AHK_Master.getScriptLineForList(type));
}
}
map.put(g, list);
}
for (ObjType sub : multiPropMap.keySet()) {
for (String c : map.keySet()) {
if (multiPropMap.get(sub).equals(c)) {
map.get(c).add(AHK_Master.getScriptLineForList(sub));
}
}
}
for (String sub : map.keySet()) {
map.put(sub, new ArrayList<>(new LinkedHashSet<>(map.get(sub))));
}
// TODO adapt to max list size also
int wrap = 5 - map.size() / 2;
MusicListPanel musicListPanel = new MusicListPanel("", null);
G_Panel view = // AHK_Master.getPanel()
musicListPanel.initView(map, false, wrap, musicConsts);
musicListPanel.setView(view);
view.setName(viewName);
return musicListPanel;
}
Aggregations