Skip to content

Commit 7f7f9cf

Browse files
committed
Merge branch 'release/0.12.2.1222'
2 parents 2f1de59 + 86ea824 commit 7f7f9cf

File tree

7 files changed

+30
-7
lines changed

7 files changed

+30
-7
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
# Version 0.12.2.1222 - 2017-11-29
2+
3+
## Fixes
4+
- Fixed outdated save game versions crashing the game
5+
- Fixed buttons not being set to inactive state correctly
6+
7+
8+
9+
110
# Version 0.12.1.1218 - 2017-11-29
211

312
## Fixes

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# On The Roadside
22

3-
[![Version](https://img.shields.io/badge/Version-0.12.1.1218-blue.svg)](https://github.com/rm-code/on-the-roadside/releases/latest)
3+
[![Version](https://img.shields.io/badge/Version-0.12.2.1222-blue.svg)](https://github.com/rm-code/on-the-roadside/releases/latest)
44
[![LOVE](https://img.shields.io/badge/L%C3%96VE-0.10.2-EA316E.svg)](http://love2d.org/)
55
[![Build Status](https://travis-ci.com/rm-code/On-The-Roadside.svg?token=q3rLXeyGTBN9VB2zsWMr&branch=develop)](https://travis-ci.com/rm-code/On-The-Roadside)
66

src/SaveHandler.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,12 @@ function SaveHandler.load( path )
6363
end
6464

6565
function SaveHandler.loadVersion( path )
66-
return Compressor.load( path .. '/' .. VERSION_FILE ).version
66+
local result, error = Compressor.load( path .. '/' .. VERSION_FILE )
67+
if not result then
68+
Log.warn( error, 'SaveHandler' )
69+
return '<undefined>'
70+
end
71+
return result.version
6772
end
6873

6974
function SaveHandler.getSaveFolder()

src/ui/elements/UIButton.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@ end
4141
-- Public Methods
4242
-- ------------------------------------------------
4343

44-
function UIButton:initialize( px, py, x, y, w, h, callback, text, alignMode, active )
44+
function UIButton:initialize( px, py, x, y, w, h, callback, text, alignMode )
4545
UIElement.initialize( self, px, py, x, y, w, h )
4646

4747
self.callback = callback
4848
self.text = text
4949
self.alignMode = alignMode or 'center'
50-
self.active = active or true
50+
self.active = true
5151
end
5252

5353
function UIButton:draw()

src/ui/screens/SavegameScreen.lua

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,9 @@ function SavegameScreen.new()
111111
end
112112
end
113113

114-
return UIButton( lx, ly, 0, 0, BUTTON_LIST_WIDTH, 1, callback, str, 'center', version == getVersion() )
114+
local button = UIButton( lx, ly, 0, 0, BUTTON_LIST_WIDTH, 1, callback, str, 'center' )
115+
button:setActive( version == getVersion() )
116+
return button
115117
end
116118

117119

src/util/Compressor.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@ function Compressor.load( path )
3131

3232
-- Decompress and return the loaded lua file.
3333
local rawstring = love.math.decompress( compressedData, 'lz4' )
34+
35+
-- Print a warning if it can't be loaded and return false.
36+
local result, error = load( rawstring )
37+
if not result then
38+
return result, error
39+
end
40+
3441
return load( rawstring )()
3542
end
3643

version.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
local version = {
22
major = 0,
33
minor = 12,
4-
patch = 1,
5-
build = 1218,
4+
patch = 2,
5+
build = 1222,
66
}
77

88
return string.format( "%d.%d.%d.%d", version.major, version.minor, version.patch, version.build );

0 commit comments

Comments
 (0)