added Hidden Flag to Tile Manager
authorMarek Moeckel <wansti@gmx.de>
Sat, 17 Sep 2005 20:14:25 +0000 (20:14 +0000)
committerMarek Moeckel <wansti@gmx.de>
Sat, 17 Sep 2005 20:14:25 +0000 (20:14 +0000)
SVN-Revision: 2768

tools/tilemanager/Application.cs
tools/tilemanager/Tile.cs
tools/tilemanager/tiler.glade

index 389e9b6..280b725 100644 (file)
@@ -24,6 +24,8 @@ public class Application {
     [Glade.Widget]
     private Gtk.CheckButton DontUseCheckButton;
     [Glade.Widget]
+    private Gtk.CheckButton HiddenCheckButton;
+    [Glade.Widget]
     private Gtk.Entry DataEntry;
     [Glade.Widget]
     private Gtk.Entry AnimFpsEntry;
@@ -174,8 +176,7 @@ public class Application {
         try {
             pixbuf = new Pixbuf(tilesetdir + "/" + file);
             if(pixbuf.Width % 32 != 0 || pixbuf.Height % 32 != 0)
-                throw new Exception(
-                        "Image Width or Height is not a multiple of 32");
+                Console.WriteLine("Warning: Image Width or Height is not a multiple of 32");
         } catch(Exception e) {
             ShowException(e);
             return;
@@ -338,6 +339,8 @@ public class Application {
                 tile.Water = WaterCheckButton.Active;
             if(sender == SlopeCheckButton)
                 tile.Slope = SlopeCheckButton.Active;
+            if(sender == HiddenCheckButton)
+                tile.Hidden = HiddenCheckButton.Active;
             if(sender == DontUseCheckButton)
                 tile.ID = DontUseCheckButton.Active ? -1 : 0;
         }
@@ -388,6 +391,7 @@ public class Application {
                 IceCheckButton.Active = tile.Ice;
                 WaterCheckButton.Active = tile.Water;
                 SlopeCheckButton.Active = tile.Slope;
+                HiddenCheckButton.Active = tile.Hidden;
                 DontUseCheckButton.Active = tile.ID == -1;
                 DataEntry.Text = tile.Data.ToString();
                 AnimFpsEntry.Text = tile.AnimFps.ToString();
index 8625908..9c52b60 100644 (file)
@@ -16,6 +16,7 @@ public class Tile {
     public bool Ice;
     public bool Water;
     public bool Slope;
+    public bool Hidden;
     public bool Spike;
     public bool FullBox;
     public bool Brick;
@@ -68,6 +69,8 @@ public class Tile {
             writer.Write("slope-type", Data);
         if(Spike)
             writer.Write("spike", true);
+        if(Hidden)
+            writer.Write("hidden", true);
         if(Coin)
             writer.Write("coin", true);
         if(FullBox)
@@ -130,6 +133,9 @@ public class Tile {
                     case "spike":
                         Spike = parser.BoolValue;
                         break;
+                    case "hidden":
+                        Hidden = parser.BoolValue;
+                        break;
                     case "data":
                         Data = parser.IntegerValue;
                         break;
index 07302c8..94eead6 100644 (file)
                      <property name="y_options"></property>
                    </packing>
                  </child>
+              <child>
+          <widget class="GtkCheckButton" id="HiddenCheckButton">
+            <property name="visible">True</property>
+            <property name="can_focus">True</property>
+            <property name="label" translatable="yes">Hidden</property>
+            <property name="use_underline">True</property>
+            <property name="relief">GTK_RELIEF_NORMAL</property>
+            <property name="focus_on_click">True</property>
+            <property name="active">False</property>
+            <property name="inconsistent">False</property>
+            <property name="draw_indicator">True</property>
+            <signal name="toggled" handler="OnCheckButtonToggled" last_modification_time="Sun, 21 Nov 2004 13:42:00 GMT"/>
+          </widget>
+          <packing>
+            <property name="left_attach">2</property>
+            <property name="right_attach">3</property>
+            <property name="top_attach">0</property>
+            <property name="bottom_attach">1</property>
+            <property name="x_options">fill</property>
+            <property name="y_options"></property>
+          </packing>
+        </child>
                </widget>
                <packing>
                  <property name="padding">0</property>