projects
/
supertux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
349d0bc
)
splitted OnAppBarUserResponse() and code that remaps tiles.
author
Miloš Klouček
<m.kloucek.m@atlas.cz>
Sat, 16 Aug 2008 17:30:58 +0000
(17:30 +0000)
committer
Miloš Klouček
<m.kloucek.m@atlas.cz>
Sat, 16 Aug 2008 17:30:58 +0000
(17:30 +0000)
SVN-Revision: 5728
tools/tilemanager/Application.cs
patch
|
blob
|
history
diff --git
a/tools/tilemanager/Application.cs
b/tools/tilemanager/Application.cs
index
dfc1bed
..
4592200
100644
(file)
--- a/
tools/tilemanager/Application.cs
+++ b/
tools/tilemanager/Application.cs
@@
-277,27
+277,36
@@
public class Application {
ShowException(exception);
return;
}
ShowException(exception);
return;
}
- foreach(Tile tile in Selection) {
- if(tile.ID == -1)
- continue;
-
- int oldid = tile.ID;
- tile.ID = id++;
- // remap in all tilegroups...
- foreach(TileGroup tilegroup in tileset.TileGroups) {
- int idx = tilegroup.Tiles.IndexOf(oldid);
- if(idx >= 0) {
- tilegroup.Tiles[idx] = tile.ID;
- }
- }
- }
- FillTileList();
- SelectionChanged();
+ RemapTiles(id);
} finally {
AppBar.ClearPrompt();
}
}
} finally {
AppBar.ClearPrompt();
}
}
+ protected void RemapTiles(int startID) {
+ if(Tiles == null)
+ return;
+
+ // remap tiles
+ int id = startID;
+ foreach(Tile tile in Selection) {
+ if(tile.ID == -1)
+ continue;
+
+ int oldid = tile.ID;
+ tile.ID = id++;
+ // remap in all tilegroups...
+ foreach(TileGroup tilegroup in tileset.TileGroups) {
+ int idx = tilegroup.Tiles.IndexOf(oldid);
+ if(idx >= 0) {
+ tilegroup.Tiles[idx] = tile.ID;
+ }
+ }
+ }
+ FillTileList();
+ SelectionChanged();
+ }
+
protected void OnDrawingAreaExpose(object o, ExposeEventArgs e) {
if(pixbuf == null)
return;
protected void OnDrawingAreaExpose(object o, ExposeEventArgs e) {
if(pixbuf == null)
return;