diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2023-01-24 00:27:50 +0100 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2025-01-27 16:43:44 +0100 |
| commit | 73d40903aecad3efcf7c6055c133f0db86558203 (patch) | |
| tree | e9c8f00fb186e270da92f273f570579f2d0b0d95 /go/ui/mapView.go | |
| parent | fbba48698d8f8b83dfd7d914b0e37338e0d4e2ef (diff) | |
| download | muhqs-game-73d40903aecad3efcf7c6055c133f0db86558203.tar.gz muhqs-game-73d40903aecad3efcf7c6055c133f0db86558203.zip | |
intermediate commit
Diffstat (limited to 'go/ui/mapView.go')
| -rw-r--r-- | go/ui/mapView.go | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/go/ui/mapView.go b/go/ui/mapView.go index 39c92ae4..6c887920 100644 --- a/go/ui/mapView.go +++ b/go/ui/mapView.go @@ -1,9 +1,11 @@ package ui import ( + "fmt" "log" "math" "strings" + "unicode" "golang.org/x/exp/slices" @@ -33,6 +35,10 @@ func NewMapView(g *game.State) *MapView { return &vw } +func (mv *MapView) GetHeight() int { + return len(mv.gameState.Map.Tiles) * TILE_HEIGHT +} + func rotateStreetImg(x, y int, radian float64, op *ebiten.DrawImageOptions) { // Move the image's center to the screen's upper-left corner. // This is a preparation for rotating. When geometry matrices are applied, @@ -130,11 +136,14 @@ func (vw *MapView) drawPermanentsLayer(screen *ebiten.Image) { if vw.permanentsLayer == nil { vw.permanentsLayer = vw.newLayerImage() - for _, p := range vw.gameState.Permanents { + for i, p := range vw.gameState.Permanents { permanentSymbol := assets.GetSymbol(strings.ToLower(p.GetCard().Name)) - // TODO: Implement generic symbols if permanentSymbol == nil { - continue + symbol := fmt.Sprintf("%c%d", unicode.ToUpper(rune(p.GetCard().Type.String()[0])), i) + permanentSymbol = assets.GetGenericSymbol(symbol) + if permanentSymbol == nil { + log.Fatalf("Failed to generate generic symbol %s", symbol) + } } t := p.GetTile() @@ -225,3 +234,7 @@ func (vw *MapView) HighlightPermanent(p game.Permanent) { func (vw *MapView) ClearPermanentsHighlights() { vw.HighlightPermanents([]game.Permanent{}) } + +func (*MapView) Render(Widget) *ebiten.Image { + return nil +} |
