removes runtime errors by commenting out the code causing it :D

here's hoping this doesn't cause more problems down the line... lol. in theory this will only cause problems if:
 - the GUI includes a textbox
 - the UI uses keyboard shortcuts (will cause issues for mac users)
This commit is contained in:
duncathan 2019-09-10 03:41:06 -06:00
parent 27581f737d
commit 11287c053a
4 changed files with 36 additions and 36 deletions

View file

@ -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

View file

@ -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

View file

@ -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 = Backend.getClipboardText() or ''
local pasted = '' --or Backend.getClipboardText()
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 }

View file

@ -6,7 +6,7 @@ Class = require 'lib.classic'
_ = require 'lib.moses'
Serpent = require 'lib.serpent'
Terebi = require 'lib.terebi'
-- Luigi = require 'lib.luigi.layout'
Luigi = require 'lib.luigi.layout'
lf = love.filesystem
lg = love.graphics