//Log.info("Load element: "+analyst.fullStr);
//1 Type
int setType = Binding.readBinding(Binding.interfaceTypeBinding, analyst.getNextString());
IMarker setMarker;
//2 ID
String markerCode = analyst.getNextString();
Binding.getBinding(Binding.interfaceElementBinding, markerCode);
//3 X
int CoordsX = analyst.getNextNumber();
//4 Y
int CoordsY = analyst.getNextNumber();
int fontID = -1;
int SizeX = -1;
int setImage;
//67948999
//5 image
analyst.getNextString();
if (!"-".equals(analyst.lastStr)) {
if (setType != ElementFactory.AnimationMarkerType) {
if (Detonator.INSTANCE.useGDXImages == false) {
setImage = Binding.readBinding(Binding.transientImageBinding, analyst.lastStr);
} else {
setImage = Binding.readBinding(Binding.transientImageBinding, analyst.lastStr);
}
} else {
setImage = Binding.readBinding(Binding.animationBinding, analyst.lastStr);
}
//Log.info("attached image " + analyst.lastStr);
} else {
setImage = -1;
}
//String markerText = "";
if (setType != ElementFactory.MarkerType) {
//6 font
String fontName = analyst.getNextString();
//Log.info("read font: "+fontName);
//fontID = Binding.readBinding(Binding.fontBinding, analyst.getNextString());
fontID = Binding.readBinding(Binding.fontBinding, fontName);
//7 size
//Log.info("read size");
SizeX = analyst.getNextNumber();
//markerText = analyst.restOfRow();
}
//if (setType == TextInfoType) {
//}
IMarker newMarker = Detonator.INSTANCE.elementFactory.spawnMarker
(setType, CoordsX, CoordsY, Detonator.INSTANCE.fontProvider.getFont(fontID), setImage);
//if (setType != MarkerType) && () {
Detonator.INSTANCE.bindGlobalInterfaceElement(markerCode, newMarker);
//}
/*
if (setType == TextBoxType) {
setMarker = new TextBox(CoordsX, CoordsY, null, " ", Fonts.getFontByID(fontID).font);
} else
if (setType == ButtonGroupType) {
setMarker = new ButtonGroup(CoordsX, CoordsY, Fonts.getFontByID(fontID).font, null);
//Log.info("image: "+setImage);
if (setImage != -1) {
setMarker.setImage(Images.getImageByID(setImage));
}
} else if (setType == InfoGroupType) {
setMarker = new InfoGroup(CoordsX, CoordsY, Fonts.getFontByID(fontID).font, null);
if (setImage != -1) {
setMarker.setImage(Images.getImageByID(setImage));
}
} else if (setType == TextInfoType) {
setMarker = new TextInfo(CoordsX, CoordsY, " ", -1, Fonts.getFontByID(fontID).font);
((TextInfo) setMarker).fontReference = Fonts.getFontByID(setType);
((TextInfo) setMarker).canBeClicked = true;
//((TextInfo)setMarker).setText(markerText);
} else if (setType == MarkerType) {
setMarker = new Marker(Images.getImageByID(setImage), Images.getImageByID(setImage), CoordsX, CoordsY);
setMarker.originalImage = Images.getImagesByID(setImage);
} else if (setType == TextMarkerType) {
setMarker = new TextMarker(Images.getImageByID(setImage), Images.getImageByID(setImage), CoordsX, CoordsY, -1);
setMarker.originalImage = Images.getImagesByID(setImage);
((TextMarker) setMarker).fontReference = Fonts.getFontByID(setType);
} if (setType == AnimationMarkerType) {
//setMarker = ElementFactory.GenericFactory.generateMarker(setType, CoordsX, CoordsY, Fonts.getFontByID(fontID), setImage);
setMarker = newMarker;
}
else {
setMarker = null;
}
*/
setMarker = newMarker;
if (setImage == -1) {
((Marker)setMarker).imageWidth = SizeX;
((Marker)setMarker).maxWidth = SizeX;
} else {
((Marker)setMarker).maxWidth = ((Marker)setMarker).imageWidth;
//Log.info("max");
}
//Detonator.INSTANCE.interfaceElements.put(markerCode, setMarker);
//Detonator.INSTANCE.interfaceElementList.add(setMarker);
//setMarker.stringID = markerCode;
Detonator.INSTANCE.interfaceElements.put(markerCode, newMarker);
Detonator.INSTANCE.interfaceElementList.add(newMarker);
newMarker.setStringID (markerCode);
//Log.info("Element " + markerCode + " was added.");
if (setImage == -1) {
((Marker)newMarker).imageWidth = SizeX;