mirror of
https://github.com/cave-story-randomizer/cave-story-randomizer
synced 2024-12-25 14:37:05 +00:00
parent
0b2e76305c
commit
32c080d84d
|
@ -21,9 +21,7 @@ function love.conf(t)
|
|||
t.modules.joystick = false
|
||||
t.modules.physics = false
|
||||
t.modules.sound = false
|
||||
t.modules.system = false
|
||||
t.modules.thread = false
|
||||
t.modules.timer = false
|
||||
t.modules.touch = false
|
||||
t.modules.video = false
|
||||
|
||||
|
|
|
@ -5,9 +5,9 @@ local Hooker = require(ROOT .. 'hooker')
|
|||
|
||||
local Backend = {}
|
||||
|
||||
--Backend.isMac = function ()
|
||||
-- return love.system.getOS() == 'OS X'
|
||||
--end
|
||||
Backend.isMac = function ()
|
||||
return love.system.getOS() == 'OS X'
|
||||
end
|
||||
|
||||
Backend.run = function () end
|
||||
|
||||
|
@ -35,9 +35,9 @@ Backend.drawRectangle = love.graphics.rectangle
|
|||
|
||||
Backend.print = love.graphics.print
|
||||
|
||||
--Backend.getClipboardText = love.system.getClipboardText
|
||||
Backend.getClipboardText = love.system.getClipboardText
|
||||
|
||||
--Backend.setClipboardText = love.system.setClipboardText
|
||||
Backend.setClipboardText = love.system.setClipboardText
|
||||
|
||||
Backend.getMousePosition = love.mouse.getPosition
|
||||
|
||||
|
@ -49,7 +49,7 @@ Backend.getWindowSize = function ()
|
|||
return love.graphics.getWidth(), love.graphics.getHeight()
|
||||
end
|
||||
|
||||
--Backend.getTime = love.timer.getTime
|
||||
Backend.getTime = love.timer.getTime
|
||||
|
||||
Backend.isKeyDown = love.keyboard.isDown
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ local Backend = require(ROOT .. 'backend')
|
|||
|
||||
local Shortcut = {}
|
||||
|
||||
--local isMac = Backend.isMac()
|
||||
local isMac = Backend.isMac()
|
||||
|
||||
local ALT = 1
|
||||
local CTRL = 2
|
||||
|
@ -16,10 +16,10 @@ local SHIFT = 4
|
|||
local GUI = 8
|
||||
|
||||
function Shortcut.appliesToPlatform (value)
|
||||
--if isMac and value:match '%f[%a]win%-'
|
||||
--or not isMac and value:match '%f[%a]mac%-' then
|
||||
-- return false
|
||||
--end
|
||||
if isMac and value:match '%f[%a]win%-'
|
||||
or not isMac and value:match '%f[%a]mac%-' then
|
||||
return false
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
|
|
|
@ -199,14 +199,14 @@ local function copyRangeToClipboard (self)
|
|||
local text = self.value
|
||||
local first, last = getRange(self)
|
||||
if last >= first + 1 then
|
||||
--Backend.setClipboardText(text:sub(first + 1, last))
|
||||
Backend.setClipboardText(text:sub(first + 1, last))
|
||||
end
|
||||
end
|
||||
|
||||
local function pasteFromClipboard (self)
|
||||
trimRange(self)
|
||||
local text = self.value
|
||||
local pasted = '' --or Backend.getClipboardText()
|
||||
local pasted = Backend.getClipboardText() or ''
|
||||
local first, last = getRange(self)
|
||||
local left = text:sub(1, first) .. pasted
|
||||
local index = #left
|
||||
|
@ -230,39 +230,39 @@ end
|
|||
|
||||
-- check command (gui) key, only on Mac.
|
||||
local isCommandPressed
|
||||
--if Backend.isMac() then
|
||||
-- isCommandPressed = function ()
|
||||
-- return Backend.isKeyDown('lgui', 'rgui')
|
||||
-- end
|
||||
--else
|
||||
if Backend.isMac() then
|
||||
isCommandPressed = function ()
|
||||
return Backend.isKeyDown('lgui', 'rgui')
|
||||
end
|
||||
else
|
||||
isCommandPressed = function ()
|
||||
return false
|
||||
end
|
||||
--end
|
||||
end
|
||||
|
||||
-- check command (gui) key on Mac and ctrl key everywhere else.
|
||||
local isCommandOrCtrlPressed
|
||||
--if Backend.isMac() then
|
||||
-- isCommandOrCtrlPressed = function ()
|
||||
-- return Backend.isKeyDown('lgui', 'rgui')
|
||||
-- end
|
||||
--else
|
||||
if Backend.isMac() then
|
||||
isCommandOrCtrlPressed = function ()
|
||||
return Backend.isKeyDown('lgui', 'rgui')
|
||||
end
|
||||
else
|
||||
isCommandOrCtrlPressed = function ()
|
||||
return Backend.isKeyDown('lctrl', 'rctrl')
|
||||
end
|
||||
--end
|
||||
end
|
||||
|
||||
-- check option (alt) key on Mac and ctrl key everywhere else.
|
||||
local isOptionOrCtrlPressed
|
||||
--if Backend.isMac() then
|
||||
-- isOptionOrCtrlPressed = function ()
|
||||
-- return Backend.isKeyDown('lalt', 'ralt')
|
||||
-- end
|
||||
--else
|
||||
if Backend.isMac() then
|
||||
isOptionOrCtrlPressed = function ()
|
||||
return Backend.isKeyDown('lalt', 'ralt')
|
||||
end
|
||||
else
|
||||
isOptionOrCtrlPressed = function ()
|
||||
return Backend.isKeyDown('lctrl', 'rctrl')
|
||||
end
|
||||
--end
|
||||
end
|
||||
|
||||
-- Special keys.
|
||||
local function createDefaultKeyActions (self)
|
||||
|
@ -418,10 +418,10 @@ This color is used to indicate the selected range of text.
|
|||
Backend.setColor(self.highlight or defaultHighlight)
|
||||
Backend.drawRectangle('fill', startX, y, width, height)
|
||||
-- draw cursor selection
|
||||
--if Backend.getTime() % 2 < 1.75 then
|
||||
-- Backend.setColor(color)
|
||||
-- Backend.drawRectangle('fill', endX, y, 1, height)
|
||||
--end
|
||||
if Backend.getTime() % 2 < 1.75 then
|
||||
Backend.setColor(color)
|
||||
Backend.drawRectangle('fill', endX, y, 1, height)
|
||||
end
|
||||
else
|
||||
Backend.setColor { color[1], color[2], color[3],
|
||||
(color[4] or 256) / 8 }
|
||||
|
|
Loading…
Reference in a new issue