Skip to content
Snippets Groups Projects
Commit 82d55fcc authored by dg's avatar dg
Browse files

PlayerDisplay does not run every frame, betetr performance!

git-svn-id: http://svn.net-core.org/repos/t-engine4@621 51575b47-30f0-44d4-a5cc-537603b46e54
parent cb7e5e1d
No related branches found
No related tags found
No related merge requests found
......@@ -48,7 +48,6 @@ local page_to_hotkey = {"", "SECOND_", "THIRD_"}
function _M:display()
local a = self.actor
if not a or not a.changed then return self.surface end
a.changed = false
local hks = {}
for i = 1, 12 do
......
......@@ -128,6 +128,8 @@ end
function _M:act()
if not engine.Actor.act(self) then return end
self.changed = true
-- Cooldown talents
self:cooldownTalents()
-- Regen resources
......
......@@ -326,6 +326,7 @@ function _M:display()
self.logdisplay:display():toScreen(self.logdisplay.display_x, self.logdisplay.display_y)
self.player_display:display():toScreen(self.player_display.display_x, self.player_display.display_y)
self.hotkeys_display:display():toScreen(self.hotkeys_display.display_x, self.hotkeys_display.display_y)
if self.player then self.player.changed = false end
-- Now the map, if any
if self.level and self.level.map and self.level.map.finished then
......
......@@ -41,6 +41,8 @@ end
-- Displays the stats
function _M:display()
if not game.player or not game.player.changed then return self.surface end
self.surface:erase(self.bgcolor[1], self.bgcolor[2], self.bgcolor[3])
local cur_exp, max_exp = game.player.exp, game.player:getExpChart(game.player.level+1)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment