Skip to content

Commit

Permalink
Fixed how the object tooltips were not showing
Browse files Browse the repository at this point in the history
  • Loading branch information
unternehmen committed Sep 15, 2017
1 parent 8823049 commit df7ccd8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 5 additions & 1 deletion dialog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,11 @@ end
--- Show arbitrary text in the dialog box when the dialog is inactive.
-- @param str the string to show
function dialog.showtext(str)
love.graphics.print(str, 0, virtualheight - 30)
if not dialog.isactive() then
love.graphics.setFont(font)
love.graphics.setColor(255, 255, 255, 255)
love.graphics.print(str, 0, virtualheight - 30)
end
end


Expand Down
9 changes: 3 additions & 6 deletions main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,6 @@ function primeobjects()
end

function states.play.init()
-- the list of objects, things in the game world which you can click
rooms.enter(rooms.ship)
end

Expand Down Expand Up @@ -255,11 +254,9 @@ function states.play.draw()
-- draw the active dialog if applicable
dialog.draw()

-- draw the name of the picked object if there is no dialog
if not dialog.isactive() then
if picked then
dialog.showtext(picked.name)
end
-- draw the name of the picked object
if picked then
dialog.showtext(picked.name)
end
end

Expand Down

0 comments on commit df7ccd8

Please sign in to comment.