Skip to content

Commit 9576adb

Browse files
committed
Merge branch 'release/0.17.0.1766'
2 parents 363021a + fce9c6d commit 9576adb

File tree

112 files changed

+5132
-2410
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

112 files changed

+5132
-2410
lines changed

CHANGELOG.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,45 @@
1+
# Version 0.17.0.1766 - 2019-04-20
2+
3+
## Additions
4+
- Added simple base screen.
5+
- Allows the player to start a new mission.
6+
- Allows the player to quit to the main menu.
7+
- Allows the player to recruit new stalkers.
8+
- Allows the player to edit each stalkers inventory and to store items in the base.
9+
- Allows the player to sell and buy items inside of a shop menu.
10+
- Starting a new game will direct the player directly to the base screen.
11+
- Shows overview over the player's faction.
12+
- Missions can be aborted and the game will return back to the base screen.
13+
- Added button to the option menu which allows opening the save / modding directory.
14+
- Added keybinding that centers the camera on the currently selected character.
15+
- Added better save game validation.
16+
- Added sorting mechanics for paginated lists.
17+
- Added keybindings for the "split item stack" and "drag full item stack" actions so they can be changed.
18+
19+
## Fixes
20+
- Fixed inventory volume being set incorrectly after loading a savegame.
21+
- Fixed health points being set incorrectly after loading a savegame.
22+
- Fixed items of paginated list not being moved correctly when the paginated list was moved.
23+
- Fixed positioning of UI child elements.
24+
- Fixed splitting of item stacks.
25+
26+
## Other Changes
27+
- Changed view range based on character classes.
28+
- Changed values for shooting and throwing skills based on character classes.
29+
- Changed prefab editor to be more performant.
30+
- Changed translator to load translations from a single .lua file.
31+
- Changed translator to load external translations.
32+
- Changed savegame screen
33+
- Saves are now displayed as a paginated list for easy navigation
34+
- Saves can now be deleted by clicking on the "X" button
35+
- Improved information about saves
36+
- Changed all items to be stackable.
37+
- Item stacks are now merged automatically.
38+
- Changed detection for mouse dragging events which makes it easier to distinguish dragging events from normal mouse clicking.
39+
40+
41+
42+
143
# Version 0.16.1.1627 - 2018-09-02 (LÖVE 11.1)
244

345
## Additions

LICENSE.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,16 @@
1-
All rights reserved (c) 2016 - 2018 Robert Machmer
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016 - 2019 Robert Machmer
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
214

315
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
416
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
# On The Roadside
22

3-
[![Version](https://img.shields.io/badge/Version-0.16.1.1627-blue.svg)](https://github.com/rm-code/on-the-roadside/releases/latest)
3+
[![Version](https://img.shields.io/badge/Version-0.17.0.1766-blue.svg)](https://github.com/rm-code/on-the-roadside/releases/latest)
44
[![LOVE](https://img.shields.io/badge/L%C3%96VE-11.1-EA316E.svg)](http://love2d.org/)
5+
[![License](http://img.shields.io/badge/Licence-MIT-brightgreen.svg)](LICENSE.md)
56
[![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)
67

78
_On the Roadside_ is a turn-based strategy game in which you take control of a squad of mercenaries fighting for survival in a world shaped by unknown forces. It currently is in the very _early stages_ of development.
@@ -25,4 +26,3 @@ This game is still in early stages of development by a one-man team ([@rm-code](
2526

2627
### Generating the Documentation
2728

28-
OTR uses LuaDoc to generate a documentation. By default the documentation will be generated in a `../docs` folder.

src/util/ArrayRotation.lua renamed to lib/ArrayRotation.lua

Lines changed: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,30 @@
1-
---
2-
-- Allows the rotation of two-dimensional arrays by 90, 180 and 270 degrees.
3-
-- Works with square and non square arrays.
4-
-- @module ArrayRotation
5-
--
6-
7-
-- ------------------------------------------------
8-
-- Module
9-
-- ------------------------------------------------
1+
--==================================================================================
2+
-- Copyright (C) 2017 by Robert Machmer =
3+
-- =
4+
-- Permission is hereby granted, free of charge, to any person obtaining a copy =
5+
-- of this software and associated documentation files (the "Software"), to deal =
6+
-- in the Software without restriction, including without limitation the rights =
7+
-- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell =
8+
-- copies of the Software, and to permit persons to whom the Software is =
9+
-- furnished to do so, subject to the following conditions: =
10+
-- =
11+
-- The above copyright notice and this permission notice shall be included in =
12+
-- all copies or substantial portions of the Software. =
13+
-- =
14+
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR =
15+
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, =
16+
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE =
17+
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER =
18+
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, =
19+
-- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN =
20+
-- THE SOFTWARE. =
21+
--==================================================================================
1022

11-
local ArrayRotation = {}
23+
local ArrayRotation= {
24+
_VERSION = "1.0.0",
25+
_DESCRIPTION = "Rotation of arrays in 90° increments." ,
26+
_URL = 'https://gist.github.com/rm-code/4118d4a97d8cde16952199d94b84ead0',
27+
}
1228

1329
-- ------------------------------------------------
1430
-- Private Functions

lib/TGFParser.lua

Lines changed: 40 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
-- ============================================================================== --
22
-- MIT License --
33
-- --
4-
-- Copyright (c) 2016 - 2017 Robert Machmer --
4+
-- Copyright (c) 2016 - 2018 Robert Machmer --
55
-- --
66
-- Permission is hereby granted, free of charge, to any person obtaining a copy --
77
-- of this software and associated documentation files (the "Software"), to deal --
@@ -23,43 +23,57 @@
2323
-- ============================================================================== --
2424

2525
local TGFParser = {
26-
_VERSION = '1.0.3',
26+
_VERSION = '1.1.0',
2727
_DESCRIPTION = 'A parser for "Trivial Graph Format" (TGF) files written in Lua.',
2828
_URL = 'https://github.com/rm-code/lua-tgf-parser/',
29-
};
29+
}
30+
31+
-- ------------------------------------------------
32+
-- Constants
33+
-- ------------------------------------------------
34+
35+
local NODE_REGEX = '(.+) (.+)'
36+
local EDGE_REGEX = '(.+) (.+) (.+)'
3037

3138
-- ------------------------------------------------
3239
-- Line iterator
3340
-- ------------------------------------------------
3441

35-
local lines = love and love.filesystem.lines or io.lines;
42+
local lines = love and love.filesystem.lines or io.lines
3643

3744
-- ------------------------------------------------
3845
-- Local Functions
3946
-- ------------------------------------------------
4047

4148
---
42-
-- Iterates over the file and separates the lines for nodes and edges into
49+
-- Iterates over the file and stores the lines for nodes and edges in
4350
-- different tables.
44-
-- @param path (string) The path of the file to load.
45-
-- @return (sequence) A sequence containing all node definitions.
46-
-- @return (sequence) A sequence containing all edge definitions.
51+
-- @tparam string path The path of the file to load.
52+
-- @treturn table A sequence containing all node definitions.
53+
-- @treturn table A sequence containing all edge definitions.
4754
--
4855
local function loadFile( path )
49-
local nodes = {};
50-
local edges = {};
51-
local target = nodes;
56+
local nodes = {}
57+
local edges = {}
58+
local target = nodes
5259

5360
-- Change the target table once the '#' separator is reached.
5461
for line in lines( path ) do
5562
if line == '#' then
56-
target = edges;
63+
target = edges
5764
else
58-
target[#target + 1] = line;
65+
target[#target + 1] = line
5966
end
6067
end
6168

62-
return nodes, edges;
69+
return nodes, edges
70+
end
71+
72+
---
73+
-- Tries to convert a string to a number.
74+
--
75+
local function convertNumber( n )
76+
return tonumber( n ) and tonumber( n ) or n
6377
end
6478

6579
-- ------------------------------------------------
@@ -68,34 +82,32 @@ end
6882

6983
---
7084
-- Parses a .tgf file.
71-
-- @param path (string) The path of the file to load.
72-
-- @return (table) The table containing the nodes and edges of the graph.
85+
-- @tparam string path The path of the file to load.
86+
-- @treturn table A table containing tables the nodes and edges of the graph.
7387
--
7488
function TGFParser.parse( path )
75-
local nodes, edges = loadFile( path );
89+
local nodes, edges = loadFile( path )
7690

7791
-- Set up the graph table.
78-
local graph = {};
79-
graph.nodes = {};
80-
graph.edges = {};
92+
local graph = {}
93+
graph.nodes = {}
94+
graph.edges = {}
8195

8296
-- Splits each line of the node definitions and stores them inside of the
8397
-- node table as nodes[id] = name.
8498
for _, line in ipairs( nodes ) do
85-
local id, name = string.match( line, '(%d+) (.+)' );
86-
id = tonumber( id );
87-
graph.nodes[id] = name;
99+
local id, label = string.match( line, NODE_REGEX )
100+
graph.nodes[#graph.nodes + 1] = { id = convertNumber( id ), label = label }
88101
end
89102

90103
-- Splits each line of the edge definitions and stores them inside of the
91104
-- edge table as edges[i] = { from = nodeId1, to = nodeId2, name = edgeName }.
92105
for _, line in ipairs( edges ) do
93-
local f, t, e = string.match( line, '(%d+) (%d+) (.+)' );
94-
f, t = tonumber( f ), tonumber( t );
95-
graph.edges[#graph.edges + 1] = { from = f, to = t, name = e };
106+
local from, to, label = string.match( line, EDGE_REGEX )
107+
graph.edges[#graph.edges + 1] = { from = convertNumber( from ), to = convertNumber( to ), label = label }
96108
end
97109

98-
return graph;
110+
return graph
99111
end
100112

101-
return TGFParser;
113+
return TGFParser

lib/screenmanager/ScreenManager.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -358,6 +358,14 @@ function ScreenManager.mousereleased( x, y, button, istouch, presses )
358358
ScreenManager.peek():mousereleased( x, y, button, istouch, presses )
359359
end
360360

361+
function ScreenManager.mousedragstarted()
362+
ScreenManager.peek():mousedragstarted()
363+
end
364+
365+
function ScreenManager.mousedragstopped()
366+
ScreenManager.peek():mousedragstopped()
367+
end
368+
361369
---
362370
-- Reroutes the quit callback to the currently active screen.
363371
-- @return quit (boolean) Abort quitting. If true, do not close the game.

main.lua

Lines changed: 32 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ local ScreenManager = require('lib.screenmanager.ScreenManager')
22
local Log = require( 'src.util.Log' )
33
local DebugGrid = require( 'src.ui.overlays.DebugGrid' )
44
local Letterbox = require( 'src.ui.overlays.Letterbox' )
5+
local DataHandler = require( 'src.DataHandler' )
56

67
-- ------------------------------------------------
78
-- Local Variables
@@ -10,6 +11,9 @@ local Letterbox = require( 'src.ui.overlays.Letterbox' )
1011
local debugGrid
1112
local letterbox
1213

14+
local mousepressed = false
15+
local mousedragged = false
16+
1317
-- ------------------------------------------------
1418
-- Constants
1519
-- ------------------------------------------------
@@ -35,14 +39,18 @@ local SCREENS = {
3539
information = require( 'src.ui.screens.InformationModal' ),
3640
inputdialog = require( 'src.ui.screens.InputDialog' ),
3741
maptest = require( 'src.ui.screens.MapTest' ),
38-
mapeditor = require( 'src.ui.screens.MapEditor' ),
39-
mapeditormenu = require( 'src.ui.screens.MapEditorMenu' ),
40-
prefabeditor = require( 'src.ui.screens.PrefabEditor' ),
41-
prefabeditormenu = require( 'src.ui.screens.PrefabEditorMenu' ),
42-
editorloading = require( 'src.ui.mapeditor.EditorLoadingScreen' ),
42+
mapeditor = require( 'src.map.editor.MapEditor' ),
43+
mapeditormenu = require( 'src.map.editor.MapEditorMenu' ),
44+
prefabeditor = require( 'src.map.editor.PrefabEditor' ),
45+
prefabeditormenu = require( 'src.map.editor.PrefabEditorMenu' ),
46+
editorloading = require( 'src.map.editor.EditorLoadingScreen' ),
4347
keybindingeditor = require( 'src.ui.screens.KeybindingScreen' ),
4448
keybindingmodal = require( 'src.ui.screens.KeybindingModal' ),
4549
playerInfo = require( 'src.ui.screens.PlayerInfo' ),
50+
base = require( 'src.base.BaseScreen' ),
51+
basemenu = require( 'src.base.BaseScreenMenu' ),
52+
recruitment = require( 'src.base.RecruitmentScreen' ),
53+
shop = require( 'src.base.ShopScreen' ),
4654
}
4755

4856
-- ------------------------------------------------
@@ -128,7 +136,12 @@ function love.update(dt)
128136
end
129137

130138
function love.quit(q)
139+
Log.info( 'Shutting down...', 'Main' )
140+
131141
ScreenManager.quit(q)
142+
143+
DataHandler.removeTemporaryFiles()
144+
Log.info( 'Thank you for playing "On The Roadside"!', 'Main' )
132145
end
133146

134147
function love.keypressed( key, scancode, isrepeat )
@@ -148,10 +161,18 @@ function love.textinput( text )
148161
end
149162

150163
function love.mousepressed( mx, my, button, isTouch, presses )
164+
mousepressed = true
151165
ScreenManager.mousepressed( mx, my, button, isTouch, presses )
152166
end
153167

154168
function love.mousereleased( mx, my, button, isTouch, presses )
169+
mousepressed = false
170+
if mousedragged then
171+
mousedragged = false
172+
ScreenManager.mousedragstopped()
173+
return
174+
end
175+
155176
ScreenManager.mousereleased( mx, my, button, isTouch, presses )
156177
end
157178

@@ -160,6 +181,12 @@ function love.mousefocus( f )
160181
end
161182

162183
function love.mousemoved( x, y, dx, dy, isTouch )
184+
if mousepressed then
185+
mousedragged = true
186+
mousepressed = false
187+
ScreenManager.mousedragstarted()
188+
end
189+
163190
ScreenManager.mousemoved( x, y, dx, dy, isTouch )
164191
end
165192

res/data/Tiles.lua

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
return {
2+
{
3+
id = 'tile_empty',
4+
passable = false
5+
},
26
{
37
id = 'tile_asphalt',
48
movementCost = {

res/data/creatures/classes.lua

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,10 @@ return {
66
},
77
stats = {
88
ap = 40,
9-
hp = 8
9+
hp = 8,
10+
viewRange = 12,
11+
shootingSkill = { min = 40, max = 70 },
12+
throwingSkill = { min = 50, max = 80 }
1013
}
1114
},
1215
{
@@ -16,7 +19,10 @@ return {
1619
},
1720
stats = {
1821
ap = 30,
19-
hp = 5
22+
hp = 5,
23+
viewRange = 10,
24+
shootingSkill = { min = 30, max = 60 },
25+
throwingSkill = { min = 40, max = 70 }
2026
}
2127
},
2228
{
@@ -26,7 +32,10 @@ return {
2632
},
2733
stats = {
2834
ap = 20,
29-
hp = 4
35+
hp = 4,
36+
viewRange = 8,
37+
shootingSkill = { min = 30, max = 40 },
38+
throwingSkill = { min = 20, max = 30 }
3039
}
3140
}
3241
}

0 commit comments

Comments
 (0)