Skip to content

Commit

Permalink
few path fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdugne committed Sep 15, 2017
1 parent fa2cc40 commit 3469a81
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 17 deletions.
6 changes: 3 additions & 3 deletions cherry/components/chapters.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ local analytics = require 'cherry.libs.analytics'
local animation = require 'cherry.libs.animation'
local Text = require 'cherry.libs.text'
local gesture = require 'cherry.libs.gesture'
local Screen = require 'cherry.components.Screen'
local Screen = require 'cherry.components.screen'
local Scroller = require 'cherry.components.scroller'
local Panel = require 'cherry.components.panel'
local GUI = require 'cherry.components.gui'
Expand Down Expand Up @@ -245,7 +245,7 @@ function Chapters:drawClosedChapter(options, panel, parent)
y = y1,
width = panel.width * 0.4,
height = panel.height * 0.15,
item = 'mini-phantom',
path = 'assets/images/gui/items/mini-phantom.icon.png',
step = options.percentLevels,
disabled = true
})
Expand All @@ -256,7 +256,7 @@ function Chapters:drawClosedChapter(options, panel, parent)
y = y2,
width = panel.width * 0.4,
height = panel.height * 0.15,
item = 'gem',
path = 'cherry/assets/images/gui/items/gem.icon.png',
step = options.percentGems,
disabled = true
})
Expand Down
1 change: 0 additions & 1 deletion cherry/components/icon.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ local Icon = {}
--------------------------------------------------------------------------------

function Icon:draw(options)
print(options.path)
local icon = display.newImage(
options.parent,
options.path
Expand Down
12 changes: 1 addition & 11 deletions cherry/components/profile.lua
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
--------------------------------------------------------------------------------

local _ = require 'cherry.libs.underscore'
local file = require 'cherry.libs.file'
local ProgressBar = require 'cherry.components.progress-bar'

--------------------------------------------------------------------------------
Expand All @@ -20,18 +19,9 @@ end
--------------------------------------------------------------------------------

function Profile:status(options)
local path = nil
if(options.item) then
path = 'assets/images/gui/items/'.. options.item ..'.icon.png'

if(not file.exists(path)) then
path = 'cherry/assets/images/gui/items/'.. options.item ..'.icon.png'
end
end

local progress = ProgressBar:new()
progress:draw(_.extend({
path = path
path = options.path or 'cherry/assets/images/gui/items/gem.icon.png'
}, options))

progress:set(0)
Expand Down
2 changes: 1 addition & 1 deletion cherry/libs/file.lua
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ end

function file.exists(filename)
local path = system.pathForFile( filename, system.ResourceDirectory)
return path
return path ~= nil
end

--------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion cherry/main.lua
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
--------------------------------------------------------------------------------
_G.CHERRY_VERSION = '2.6.0'
_G.CHERRY_VERSION = '2.6.1'
--------------------------------------------------------------------------------
-- corona
_G.composer = _G.composer or require 'composer'
Expand Down

0 comments on commit 3469a81

Please sign in to comment.