[Glade.Widget]
private Gtk.Window MainWindow;
[Glade.Widget]
+ private Gtk.CheckMenuItem useNewSyntax;
+ [Glade.Widget]
private Gtk.DrawingArea DrawingArea;
[Glade.Widget]
private Gtk.CheckButton SolidCheckButton;
SelectionChanged();
FillTileGroupComboBox();
FillTileList();
+
+ useNewSyntax.Active = tileset.IsNew;
+ if (tileset.IsNew)
+ Console.WriteLine("Warning: new syntax of 0.3.x files \"More tiles in one image\" isn't currently supported for WRITING");
+
}
protected void OnImportImage(object o, EventArgs e) {
}
protected void OnSave(object o, EventArgs e) {
- if (tileset.TooNew)
- Console.WriteLine(
- "Sorry, the file you are editing is too new, there will be huge data loss if you save this.");
- else
+ if (tileset.IsNew && useNewSyntax.Active) {
+ MessageDialog dialog = new MessageDialog(MainWindow, DialogFlags.Modal | DialogFlags.DestroyWithParent, MessageType.Error, ButtonsType.Ok,
+ "Sorry, the file you are editing is too new and 0.3.x syntax is not supported yet.");
+ dialog.Run();
+ dialog.Destroy();
+ } else {
tileset.Write(tilesetfile);
+ }
}
protected void OnQuit(object o, EventArgs e) {
public const int TILE_WIDTH = 32;
public const int TILE_HEIGHT = 32;
- private bool tooNew = false;
+ private bool isNew = false;
/// <summary>Whether version of tileset file is too new</summary>
- public bool TooNew {
+ public bool IsNew {
get {
- return tooNew;
+ return isNew;
}
}
}
public void ParseTiles(Lisp.Parser parser) {
- tooNew = false;
+ isNew = false;
int d = parser.Depth;
while(parser.Parse() && parser.Depth >= d) {
if(parser.Depth == d && parser.Type != Parser.LispType.START_LIST) {
break;
case "tiles":
ParseMoreTiles(parser);
- tooNew = true;
- Console.WriteLine(
- "Warning: new syntax of \"More tiles in one image\" file isn't currently supported");
- Console.WriteLine(
- "And this means: YOU WON'T BE ABLE TO SAVE YOUR CHANGES !!!");
+ isNew = true;
break;
default:
throw new Exception("Unexpected listentry: " +
</child>
<child>
- <widget class="GtkSeparatorMenuItem" id="trennlinie1">
+ <widget class="GtkSeparatorMenuItem" id="separator1">
<property name="visible">True</property>
</widget>
</child>
<property name="use_underline">True</property>
</widget>
</child>
+
+ <child>
+ <widget class="GtkSeparatorMenuItem" id="separator2">
+ <property name="visible">True</property>
+ </widget>
+ </child>
+
+ <child>
+ <widget class="GtkCheckMenuItem" id="useNewSyntax">
+ <property name="visible">True</property>
+ <property name="label" translatable="yes">Use 0.3.x syntax</property>
+ <property name="use_underline">True</property>
+ <property name="active">False</property>
+ </widget>
+ </child>
</widget>
</child>
</widget>