Compare commits
No commits in common. "2f5f682a5928a7c604480aba69c7c00cb517d78d" and "ea26db29f3f92a811c031bb199b9318137621c7c" have entirely different histories.
2f5f682a59
...
ea26db29f3
@ -64,8 +64,8 @@ func NewConeflowerTraits() FlowerTraits {
|
||||
Spread: 0.0005,
|
||||
Life: 0.99993,
|
||||
Resistance: FlowerResistance{
|
||||
Cold: 0.6,
|
||||
Hot: 0.9,
|
||||
Cold: 0.7,
|
||||
Hot: 0.8,
|
||||
Dry: 0.8,
|
||||
Wet: 0.5,
|
||||
},
|
||||
|
7
game.go
7
game.go
@ -261,12 +261,7 @@ func (g *Game) TogglePause(ctx ui.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
func (g *Game) Tool() Tool {
|
||||
if g.tool == nil {
|
||||
return &NoTool{}
|
||||
}
|
||||
return g.tool
|
||||
}
|
||||
func (g *Game) Tool() Tool { return g.tool }
|
||||
|
||||
func (g *Game) ToolChanged() ui.EventHandler { return &g.toolChanged }
|
||||
|
||||
|
@ -195,7 +195,7 @@ func (c *GameControls) Handle(ctx ui.Context, event ui.Event) bool {
|
||||
case ui.KeyR:
|
||||
c.dialogs.ShowResearch(ctx)
|
||||
case ui.KeyEscape:
|
||||
if c.game.Tool().Type() == "none" {
|
||||
if c.game.Tool() == nil {
|
||||
c.dialogs.ShowIntro(ctx)
|
||||
} else {
|
||||
c.game.CancelTool(ctx)
|
||||
|
@ -31,7 +31,7 @@ func (h *Herbarium) Reset() {
|
||||
})
|
||||
h.Add("loosestrife", FlowerDescriptor{
|
||||
Name: "Loosestrife",
|
||||
Description: "A simple flower that will spread in temperate and damp climates.",
|
||||
Description: "A simple flower that will spread in temperate and wet climates.",
|
||||
IconTemplate: "flower-loosestrife-%s",
|
||||
BuyPrice: 100,
|
||||
SellPrice: 20,
|
||||
|
@ -41,7 +41,7 @@ func (b *IconButton) Render(ctx ui.Context) {
|
||||
}
|
||||
|
||||
func (b *IconButton) RenderActive(ctx ui.Context) {
|
||||
if b.Active || (!b.Disabled && b.IsOver()) {
|
||||
if b.Active && !b.Disabled && !b.IsOver() {
|
||||
ctx.Renderer().FillRectangle(b.Bounds(), hoverTransparentColor)
|
||||
}
|
||||
}
|
||||
|
@ -106,41 +106,6 @@ func (r *terrainRenderer) Handle(ctx ui.Context, event ui.Event) bool {
|
||||
r.isometric.PanTile(geom.PtF32(1, -1))
|
||||
}
|
||||
}
|
||||
|
||||
if r.hover != nil && r.game.Tool().Type() == "plant-flower" {
|
||||
terrain := r.game.Terrain
|
||||
temp := func() string {
|
||||
temp := terrain.Temp.Value(r.hover.X, r.hover.Y)
|
||||
switch {
|
||||
case temp < .3:
|
||||
return "very cold"
|
||||
case temp < .4:
|
||||
return "cold"
|
||||
case temp > .7:
|
||||
return "very hot"
|
||||
case temp > .6:
|
||||
return "hot"
|
||||
default:
|
||||
return "moderate"
|
||||
}
|
||||
}()
|
||||
humid := func() string {
|
||||
humid := terrain.Humid.Value(r.hover.X, r.hover.Y)
|
||||
switch {
|
||||
case humid < .3:
|
||||
return " and very arid"
|
||||
case humid < .4:
|
||||
return " and arid"
|
||||
case humid > .7:
|
||||
return " and very damp"
|
||||
case humid > .6:
|
||||
return " and damp"
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
}()
|
||||
ctx.ShowTooltip(fmt.Sprintf("It is %s%s over here", temp, humid))
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
||||
|
6
tools.go
6
tools.go
@ -17,12 +17,6 @@ func (t *PlantFlowerTool) ClickedTile(game *Game, tile geom.Point) {
|
||||
game.PlantFlower(t.FlowerID, tile)
|
||||
}
|
||||
|
||||
type NoTool struct{}
|
||||
|
||||
func (t *NoTool) Type() string { return "none" }
|
||||
|
||||
func (t *NoTool) ClickedTile(*Game, geom.Point) {}
|
||||
|
||||
type ShovelTool struct{}
|
||||
|
||||
func (t *ShovelTool) Type() string { return "shovel" }
|
||||
|
Loading…
Reference in New Issue
Block a user