use of main.content.C_OBJ_TYPE in project Eidolons by IDemiurge.
the class LE_Palette method newPalette.
public void newPalette() {
int optionChoice = DialogMaster.optionChoice("Choose object TYPE...", default_palette);
OBJ_TYPE TYPE;
List<ObjType> typeList;
if (optionChoice == -1) {
if (DialogMaster.confirm("Multi-type Palette?")) {
optionChoice = DialogMaster.optionChoice("Choose object multi TYPE...", multi_types);
if (optionChoice == -1) {
return;
}
TYPE = multi_types[optionChoice];
typeList = DataManager.getTypes(TYPE);
} else {
return;
}
} else {
TYPE = default_palette[optionChoice];
typeList = DataManager.getTypes(TYPE);
}
// int index = DialogMaster.optionChoice("Choose object TYPE...",
// palettes.toArray());
// PaletteWorkspace ws = palettes.getOrCreate(index);
List<String> listData = DataManager.toStringList(typeList);
List<String> secondListData = (TYPE instanceof C_OBJ_TYPE) ? new ArrayList<>() : DataManager.toStringList(typeList);
// if (ws != null) {
// secondListData = DataManager.convertToStringList(ws.getTypeList());
// }
String data = new ListChooser(listData, secondListData, false, TYPE).choose();
if (data == null) {
return;
}
List<ObjType> list = DataManager.toTypeList(data, TYPE);
String name = DialogMaster.inputText();
imagePath = new ImageChooser().launch(imagePath, "");
PaletteWorkspace ws = new PaletteWorkspace(name, list, imagePath);
addWorkspaceTab(ws);
saveWorkspace(ws);
}
use of main.content.C_OBJ_TYPE in project Eidolons by IDemiurge.
the class VendorListsPanel method initListMap.
public Map<String, HC_PagedListPanel> initListMap(String tabName) {
List<String> group = getListGroup(tabName);
ArrayList<String> specialLists = new ArrayList<>();
Map<String, HC_PagedListPanel> map = new XLinkedMap<>();
for (String listName : group) {
if (checkSpecial(listName)) {
specialLists.add(listName);
continue;
}
if (!responsive) {
if (!checkList(listName, false)) {
continue;
}
}
if (!showAll) {
if (!checkList(listName, true)) {
continue;
}
}
List<String> types = DataManager.getTypesSubGroupNames(TYPE, listName);
if (Launcher.ILYA_MODE) {
if (TYPE == DC_TYPE.SPELLS || TYPE == DC_TYPE.SKILLS) {
FilterMaster.filterByProp(types, G_PROPS.WORKSPACE_GROUP.getName(), "" + MetaEnums.WORKSPACE_GROUP.DESIGN, TYPE, true);
FilterMaster.filterByProp(types, G_PROPS.WORKSPACE_GROUP.getName(), "" + MetaEnums.WORKSPACE_GROUP.IMPLEMENT, TYPE, true);
FilterMaster.filterByProp(types, PROPS.ITEM_SHOP_CATEGORY.getName(), "" + ItemEnums.ITEM_SHOP_CATEGORY.SPECIAL, TYPE, true);
// so you see, it wouldn't be hard to filter the items for
// each shop in macro
}
}
if (types == null) {
// shot in the leg!
continue;
}
if (types.isEmpty()) {
continue;
}
List<ObjType> data;
// if (checkSpecial(listName))
// data = getSpecialData();
// else {
OBJ_TYPE T = TYPE;
if (T instanceof C_OBJ_TYPE) {
if (tabName.equalsIgnoreCase(DC_TYPE.JEWELRY.getName())) {
T = DC_TYPE.JEWELRY;
}
if (tabName.equalsIgnoreCase(ItemEnums.ITEM_TYPE.ALCHEMY.toString())) {
T = DC_TYPE.ITEMS;
}
// if (TYPE != OBJ_TYPES.SPELLS)
if (tabName.equalsIgnoreCase(ItemEnums.ARMOR_TYPE.LIGHT.toString()) || tabName.equalsIgnoreCase(ItemEnums.ARMOR_TYPE.HEAVY.toString())) {
T = DC_TYPE.ARMOR;
}
}
// TODO is there a
data = DataManager.toTypeList(types, T);
if (getFilter() != null) {
data = getFilter().filter(data);
}
if (getSpecialFilter() != null) {
data = getSpecialFilter().filter(data);
}
if (getSorter() != null) {
try {
Collections.sort(data, getSorter());
} catch (Exception e) {
main.system.ExceptionMaster.printStackTrace(e);
// main.system.ExceptionMaster.printStackTrace(e);
}
}
putList(listName, data, map);
}
for (String listName : specialLists) {
List<ObjType> data = getSpecialData();
if (getSorter() != null) {
Collections.sort(data, getSorter());
}
putList(listName, data, map);
}
return map;
}
use of main.content.C_OBJ_TYPE in project Eidolons by IDemiurge.
the class HC_PagedListPanel method paint.
@Override
public void paint(Graphics g) {
super.paint(g);
g.setFont(getFont());
g.setColor(ColorManager.GOLDEN_WHITE);
if (TYPE != null) {
if (list_type == HC_LISTS.VENDOR) {
if (img == null) {
PARAMETER mastery = ContentManager.getPARAM(listName);
if (mastery == null) {
mastery = ContentManager.getMastery(listName);
}
if (TYPE instanceof C_OBJ_TYPE) {
} else {
switch((DC_TYPE) TYPE) {
case SPELLS:
case SKILLS:
img = ImageManager.getValueIcon(mastery);
break;
case CLASSES:
}
}
int y = getTextY() - 5;
if (img != null) {
g.drawImage(img, 12, y, 28, 28, null);
g.drawImage(img, getWidth() - img.getWidth(null) - 12, y, 28, 28, null);
g.drawImage(img, (getWidth() - img.getWidth(null)) / 2, y, null);
}
}
}
}
if (getTextY() >= 0) {
g.drawString(listName, getTextX(), getTextY());
} else {
setToolTipText(listName);
}
}
Aggregations