use of main.content.OBJ_TYPE 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?
}
use of main.content.OBJ_TYPE in project Eidolons by IDemiurge.
the class CreationHelper method getInput.
public static String getInput(VALUE val, Entity entity, String value, INPUT_REQ preferredInputMode) {
Class<?> ENUM_CLASS = EnumMaster.getEnumClass(val.getName());
OBJ_TYPE TYPE = ContentManager.getOBJ_TYPE(val.getName());
ListChooser.setTooltip("Input for " + val.getName());
INPUT_REQ inputReq = preferredInputMode;
if (inputReq == null) {
inputReq = val.getInputReq();
if (inputReq == null) {
if (ENUM_CLASS != null) {
inputReq = INPUT_REQ.SINGLE_ENUM;
}
}
}
switch(inputReq) {
case STRING:
return DialogMaster.inputText("Set value for " + val.getName(), value);
case INTEGER:
return "" + DialogMaster.inputInt("Set value for " + val.getName(), StringMaster.getInteger(val.getDefaultValue()));
case MULTI_ENUM:
return ListChooser.chooseEnum(ENUM_CLASS, SELECTION_MODE.MULTIPLE);
case MULTI_TYPE:
return ListChooser.chooseType(TYPE, SELECTION_MODE.MULTIPLE);
case SINGLE_ENUM:
return ListChooser.chooseEnum(ENUM_CLASS, SELECTION_MODE.SINGLE);
case SINGLE_TYPE:
return ListChooser.chooseType(TYPE);
case SINGLE_TYPE_VAR:
return null;
case MULTI_TYPE_VAR:
return null;
case MULTI_ENUM_VAR:
return null;
case SINGLE_ENUM_VAR:
return null;
}
return null;
}
use of main.content.OBJ_TYPE in project Eidolons by IDemiurge.
the class AE_Manager method getDoc.
public static Node getDoc(String typeName) {
OBJ_TYPE TYPE = ArcaneVault.getSelectedOBJ_TYPE();
// if (!ArcaneVault.isDialogueMode()) {
// TYPE = DC_TYPE.ABILS;
// } else {
// TYPE = DC_TYPE.DIALOGUE;
// }
ObjType type;
if (ArcaneVault.isMacroMode()) {
type = DataManager.getType(typeName);
// DialogueType diagType = (DialogueType) type;
// return diagType.getDoc();
}
type = DataManager.getType(typeName, TYPE.getName());
XmlDocHolder abilType = (XmlDocHolder) type;
// return XML_Converter.getDoc(abilType.getProperty(G_PROPS.ABILITIES));
return abilType.getDoc();
}
use of main.content.OBJ_TYPE in project Eidolons by IDemiurge.
the class TypeBuilder method buildType.
public static ObjType buildType(Node node, String typeType) {
if (typeInitializer == null) {
typeInitializer = new TypeInitializer();
}
OBJ_TYPE objType = ContentManager.getOBJ_TYPE(typeType);
ObjType type = null;
if (objType != null) {
type = getTypeInitializer().getNewType(objType);
buildType(node, type);
} else {
LogMaster.error("type with name \"" + typeType + "\" not found!");
}
return type;
}
use of main.content.OBJ_TYPE in project Eidolons by IDemiurge.
the class SaveMaster method load.
public static void load(String fileName) {
/*
* load types... init world from save -
* dynamic values - can they be set for Type?
*/
String content = FileManager.readFile(new File(getSavePath() + fileName + ".xml"));
for (Node node : XML_Converter.getNodeList(XML_Converter.getDoc(content))) {
OBJ_TYPE TYPE = ContentManager.getOBJ_TYPE(node.getNodeName());
XML_Reader.createCustomTypeList(XML_Converter.getStringFromXML(node), TYPE, MacroGame.getGame(), true, true);
}
}
Aggregations