summaryrefslogtreecommitdiff
path: root/tools.go
diff options
context:
space:
mode:
authorKevin Chabowski <kevin@kch42.de>2013-08-17 14:57:40 +0200
committerKevin Chabowski <kevin@kch42.de>2013-08-17 14:57:40 +0200
commita12232f527666695c57a6014401c1a34c2fb6611 (patch)
tree76825b119d7862d16af962b94ca9d3499be689b6 /tools.go
parenta6990de0ba8260d1021188b862c38478f401c721 (diff)
downloadbiomed-a12232f527666695c57a6014401c1a34c2fb6611.tar.gz
biomed-a12232f527666695c57a6014401c1a34c2fb6611.tar.bz2
biomed-a12232f527666695c57a6014401c1a34c2fb6611.zip
GUI is now locked on slow operations (e.g. Filling).
Diffstat (limited to 'tools.go')
-rw-r--r--tools.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/tools.go b/tools.go
index 6397223..e4fd34a 100644
--- a/tools.go
+++ b/tools.go
@@ -15,6 +15,7 @@ type XZPos struct {
type Tool interface {
SingleClick() bool // Whether only one click should be performed (true) or the action should be repeated, if the mouse is dragged
+ IsSlow() bool
Do(bio mcmap.Biome, biogs BiomeGetSetter, x, z int)
}
@@ -23,6 +24,7 @@ type drawTool struct {
}
func (d *drawTool) SingleClick() bool { return false }
+func (d *drawTool) IsSlow() bool { return false }
func (d *drawTool) Do(bio mcmap.Biome, biogs BiomeGetSetter, x, z int) {
rad := d.radGetter()
@@ -44,6 +46,7 @@ func NewDrawTool(radGetter func() int) *drawTool {
type fillTool struct{}
func (f *fillTool) SingleClick() bool { return true }
+func (f *fillTool) IsSlow() bool { return true }
func chkBounds(x, z, xStart, zStart, xEnd, zEnd int) bool {
return (x >= xStart) && (z >= zStart) && (x < xEnd) && (z < zEnd)