use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class LE_MapMaster method replace.
public void replace(String prevFiller, String filler, List<Coordinates> coordinates) {
LevelEditor.getCurrentLevel().removeObj(prevFiller, coordinates.toArray(new Coordinates[coordinates.size()]));
ObjType type = DataManager.getType(filler);
for (Coordinates c : coordinates) {
// LevelEditor.getObjMaster().removeObj(c);
LevelEditor.getObjMaster().addObj(type, c);
}
}
use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class LE_ObjMaster method replace.
public static void replace() {
ObjType type = ArcaneVault.getSelectedType();
List<Coordinates> coordinates = LE_MapMaster.pickCoordinates();
if (!ListMaster.isNotEmpty(coordinates)) {
return;
}
ObjType type2 = ArcaneVault.getSelectedType();
if (type2 == type) {
type2 = DataManager.getType(ListChooser.chooseType(type.getOBJ_TYPE_ENUM()), type.getOBJ_TYPE_ENUM());
}
replace(type, type2, coordinates);
}
use of main.entity.type.ObjType 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.entity.type.ObjType in project Eidolons by IDemiurge.
the class LE_Palette method chooseWorkspaces.
public List<PaletteWorkspace> chooseWorkspaces() {
List<String> list = new ArrayList<>();
List<PaletteWorkspace> chosenPalettes = new ArrayList<>();
for (PaletteWorkspace ws : workspaces) {
ObjType type = new ObjType(ws.getName());
type.setOBJ_TYPE_ENUM(DC_TYPE.META);
type.setImage(imagePath);
list.add(type.getName());
}
List<String> chosen = StringMaster.openContainer(new ListChooser(list, new ArrayList<>(), false, DC_TYPE.META).choose());
for (String name : chosen) {
for (PaletteWorkspace p : palettes) {
if (p.getName().equals(name)) {
chosenPalettes.add(p);
}
}
}
return chosenPalettes;
}
use of main.entity.type.ObjType in project Eidolons by IDemiurge.
the class LE_Palette method createObjGroup.
public void createObjGroup() {
Map<ObjType, Integer> map = new HashMap<>();
int optionChoice = DialogMaster.optionChoice("Choose object TYPE...", default_palette);
if (optionChoice == -1) {
return;
}
OBJ_TYPE TYPE = default_palette[optionChoice];
Integer chance = 0;
boolean randomOff = false;
while (true) {
String type = ListChooser.chooseType(TYPE);
if (type == null) {
break;
}
if (!randomOff) {
chance = DialogMaster.inputInt("Set chance for object to be there..." + " (set negative to add '1 object only' rule for this group; use 100+ if more than one object is to be created)", chance);
if (chance == null) {
Boolean choice = DialogMaster.askAndWait("", "Continue", "Random off", "Cancel");
if (choice == null) {
return;
}
if (choice) {
chance = 0;
} else {
randomOff = true;
chance = 100;
}
}
}
map.put(DataManager.getType(type, TYPE), chance);
}
boolean addToMainPalette = false;
String data = null;
for (ObjType type : map.keySet()) {
chance = map.get(type);
if (chance != 100) {
}
// weight map format? =,
data += type.getName() + ";";
}
String path = null;
String fileName = null;
XML_Writer.write(data, path, fileName);
// write to workspace?
}
Aggregations