Skip to content

Commit

Permalink
Add filepath to texture error message
Browse files Browse the repository at this point in the history
  • Loading branch information
malashin committed Jun 23, 2020
1 parent a7ee932 commit 06c132a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions gui.go
Expand Up @@ -236,6 +236,7 @@ func start() {
}
}

ansi.Println("\x1b[33;1m" + "Generating images:" + "\x1b[0m")
var i float64 = 8
// Replace hoi4 textures if mods has the same ones.
useModsTexturesIfPresent()
Expand Down
2 changes: 1 addition & 1 deletion misc.go
Expand Up @@ -377,7 +377,7 @@ func showError(err error) {
w.CenterOnScreen()
w.SetFixedSize(true)
w.Show()
w.RequestFocus()
// w.RequestFocus()

pBar.Hide()
pBar.SetValue(0)
Expand Down
8 changes: 4 additions & 4 deletions render.go
Expand Up @@ -29,7 +29,7 @@ func renderFocus(dst draw.Image, x, y int, id string) error {

err := renderSprite(dst, x+gui.BG.Position.X, y+gui.BG.Position.Y, gui.BG.Orientation, gui.BG.CenterPosition, s)
if err != nil {
return err
return fmt.Errorf("%q: %v", s.TextureFile, err)
}

symbol, ok := gfxMap[f.Icon]
Expand All @@ -39,7 +39,7 @@ func renderFocus(dst draw.Image, x, y int, id string) error {

err = renderSprite(dst, x+gui.Symbol.Position.X, y+gui.Symbol.Position.Y, gui.Symbol.Orientation, gui.Symbol.CenterPosition, symbol)
if err != nil {
return err
return fmt.Errorf("%q: %v", symbol.TextureFile, err)
}

text := f.Text
Expand Down Expand Up @@ -422,14 +422,14 @@ func (s *SpriteType) readTexture() error {
}
}

return fmt.Errorf(err.Error())
return err
}
TextureFileFound:
defer imgFile.Close()

s.Image, _, err = image.Decode(imgFile)
if err != nil {
return fmt.Errorf(err.Error())
return err
}
return nil
}
Expand Down

0 comments on commit 06c132a

Please sign in to comment.