Can't plant flower when the control key is still down.
This commit is contained in:
parent
905aad2afa
commit
1008b7b34b
@ -42,12 +42,13 @@ func (r *terrainRenderer) Handle(ctx *Context, event sdl.Event) bool {
|
|||||||
case *sdl.MouseButtonEvent:
|
case *sdl.MouseButtonEvent:
|
||||||
if r.project.windowInteractRect.IsPointInside(e.X, e.Y) {
|
if r.project.windowInteractRect.IsPointInside(e.X, e.Y) {
|
||||||
if e.Type == sdl.MOUSEBUTTONDOWN {
|
if e.Type == sdl.MOUSEBUTTONDOWN {
|
||||||
if e.Button == sdl.BUTTON_MIDDLE || (e.Button == sdl.BUTTON_LEFT && isControlKeyDown()) {
|
controlKeyDown := isControlKeyDown()
|
||||||
|
if e.Button == sdl.BUTTON_MIDDLE || (e.Button == sdl.BUTTON_LEFT && controlKeyDown) {
|
||||||
if !r.drag.IsDragging() {
|
if !r.drag.IsDragging() {
|
||||||
r.drag.Start(Pt(e.X, e.Y))
|
r.drag.Start(Pt(e.X, e.Y))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if e.Button == sdl.BUTTON_LEFT {
|
if e.Button == sdl.BUTTON_LEFT && !controlKeyDown {
|
||||||
pos := r.project.screenToMapInt(e.X, e.Y)
|
pos := r.project.screenToMapInt(e.X, e.Y)
|
||||||
r.game.UserClickedTile(pos)
|
r.game.UserClickedTile(pos)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user