use of eidolons.libgdx.screens.map.editor.EditorControlPanel.MAP_EDITOR_MOUSE_MODE in project Eidolons by IDemiurge.
the class EditorManager method modify.
public static void modify(boolean addOrRemove, int screenX, int screenY) {
MAP_EDITOR_MOUSE_MODE mode = EditorManager.getMode();
/*
add listener to each actor
*/
Vector2 v = EditorMapView.getInstance().getMapStage().screenToStageCoordinates(new Vector2(screenX, screenY));
int x = (int) v.x;
int y = (int) v.y;
if (mode == null)
mode = MAP_EDITOR_MOUSE_MODE.ADD;
switch(mode) {
case ADD:
if (!addOrRemove) {
EditorMapView.getInstance().getObjectStage().removeClosest(x, y);
return;
}
break;
case POINT:
MacroManager.getPointMaster().clicked(x, y);
return;
case EMITTER:
if (addOrRemove) {
EditorMapView.getInstance().getEditorParticles().clicked(x, y);
} else {
EditorMapView.getInstance().getEditorParticles().removeClosest(x, y);
}
return;
}
ObjType type = EditorMapView.getInstance().getGuiStage().getPalette().getSelectedType();
if (type == null)
return;
MacroObj obj = create(type);
added(obj, screenX, screenY);
}
Aggregations