Game settings screen, and minor fix on discordRPC

- Uses BG previously from the input config screen, which has gotten a new BG
- Minor tweak on the input config screen to display all inputs names regardless of if they are bound or not
- Added Mod1 function to `funcs.lua`, may be useful again sometime
- Added game settings
  * Manual locking (per gamemode, per ruleset, on harddrop or on softdrop)
  * Piece colours (per ruleset, TTC or Arika)
  * World Reverse toggle
- Moved the discordRPC `libs/` directory, as it's a third party library
- Edited the `discordRPC.lua` file to look for the dll at the right place regardless of how you run the game (until we fuse it that is)

This should have probably been done in several commits, sorry about that
This commit is contained in:
Oshisaure
2020-10-11 00:42:56 +01:00
parent f28dc08ae2
commit 05230ac046
21 changed files with 245 additions and 66 deletions

View File

@@ -143,7 +143,7 @@ function Grid:copyBottomRow()
for col = 1, 10 do
self.grid[24][col] = (self.grid[23][col] == empty) and empty or {
skin = self.grid[23][col].skin,
colour = "G"
colour = "X"
}
end
return true
@@ -161,7 +161,7 @@ function Grid:applyPiece(piece)
if y + 1 > 0 then
self.grid[y+1][x+1] = {
skin = piece.skin,
colour = piece.shape
colour = piece.colour
}
end
end
@@ -177,7 +177,7 @@ function Grid:applyBigPiece(piece)
if y*2+a > 0 then
self.grid[y*2+a][x*2+b] = {
skin = piece.skin,
colour = piece.shape
colour = piece.colour
}
end
end

View File

@@ -2,7 +2,7 @@ local Object = require 'libs.classic'
local Piece = Object:extend()
function Piece:new(shape, rotation, position, block_offsets, gravity, lock_delay, skin, big)
function Piece:new(shape, rotation, position, block_offsets, gravity, lock_delay, skin, colour, big)
self.shape = shape
self.rotation = rotation
self.position = position
@@ -10,6 +10,7 @@ function Piece:new(shape, rotation, position, block_offsets, gravity, lock_delay
self.gravity = gravity
self.lock_delay = lock_delay
self.skin = skin
self.colour = colour
self.ghost = false
self.locked = false
self.big = big
@@ -21,7 +22,7 @@ function Piece:withOffset(offset)
return Piece(
self.shape, self.rotation,
{x = self.position.x + offset.x, y = self.position.y + offset.y},
self.block_offsets, self.gravity, self.lock_delay, self.skin, self.big
self.block_offsets, self.gravity, self.lock_delay, self.skin, self.colour, self.big
)
end
@@ -31,7 +32,7 @@ function Piece:withRelativeRotation(rot)
while new_rot >= 4 do new_rot = new_rot - 4 end
return Piece(
self.shape, new_rot, self.position,
self.block_offsets, self.gravity, self.lock_delay, self.skin, self.big
self.block_offsets, self.gravity, self.lock_delay, self.skin, self.colour, self.big
)
end
@@ -148,13 +149,13 @@ function Piece:draw(opacity, brightness, grid, partial_das)
local y = self.position.y + offset.y
if self.big then
love.graphics.draw(
blocks[self.skin][self.shape],
blocks[self.skin][self.colour],
64+x*32+partial_das*2, 16+y*32+gravity_offset*2,
0, 2, 2
)
else
love.graphics.draw(
blocks[self.skin][self.shape],
blocks[self.skin][self.colour],
64+x*16+partial_das, 16+y*16+gravity_offset
)
end