Search in sources :

Example 6 with OBJ_TYPE

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?
}
Also used : C_OBJ_TYPE(main.content.C_OBJ_TYPE) OBJ_TYPE(main.content.OBJ_TYPE) ObjType(main.entity.type.ObjType) HashMap(java.util.HashMap)

Example 7 with OBJ_TYPE

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;
}
Also used : INPUT_REQ(main.content.VALUE.INPUT_REQ) OBJ_TYPE(main.content.OBJ_TYPE)

Example 8 with OBJ_TYPE

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();
}
Also used : C_OBJ_TYPE(main.content.C_OBJ_TYPE) OBJ_TYPE(main.content.OBJ_TYPE) ObjType(main.entity.type.ObjType) XmlDocHolder(main.data.ability.construct.XmlDocHolder)

Example 9 with OBJ_TYPE

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;
}
Also used : OBJ_TYPE(main.content.OBJ_TYPE) ObjType(main.entity.type.ObjType)

Example 10 with OBJ_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);
    }
}
Also used : OBJ_TYPE(main.content.OBJ_TYPE) Node(org.w3c.dom.Node) File(java.io.File)

Aggregations

OBJ_TYPE (main.content.OBJ_TYPE)31 ObjType (main.entity.type.ObjType)16 C_OBJ_TYPE (main.content.C_OBJ_TYPE)7 ArrayList (java.util.ArrayList)5 PROPERTY (main.content.values.properties.PROPERTY)5 Obj (main.entity.obj.Obj)5 Entity (main.entity.Entity)3 DC_SpellObj (eidolons.entity.active.DC_SpellObj)2 Unit (eidolons.entity.obj.unit.Unit)2 File (java.io.File)2 VALUE (main.content.VALUE)2 TextureRegion (com.badlogic.gdx.graphics.g2d.TextureRegion)1 Actor (com.badlogic.gdx.scenes.scene2d.Actor)1 InputEvent (com.badlogic.gdx.scenes.scene2d.InputEvent)1 ClickListener (com.badlogic.gdx.scenes.scene2d.utils.ClickListener)1 NinePatchDrawable (com.badlogic.gdx.scenes.scene2d.utils.NinePatchDrawable)1 ChoiceSequence (eidolons.client.cc.gui.neo.choice.ChoiceSequence)1 EntityChoiceView (eidolons.client.cc.gui.neo.choice.EntityChoiceView)1 HC_PagedListPanel (eidolons.client.cc.gui.pages.HC_PagedListPanel)1 SequenceManager (eidolons.client.dc.SequenceManager)1