mirror of
https://github.com/CCLeonOS/LeonOS.git
synced 2026-03-03 15:17:01 +00:00
fix(lgui): 替换term.blink为颜色反转实现光标效果
由于CC Tweaked不支持term.blink,改用前景色和背景色反转的方式实现光标闪烁效果
This commit is contained in:
@@ -320,9 +320,15 @@ function TextField:draw()
|
|||||||
-- Draw cursor
|
-- Draw cursor
|
||||||
if self.focused and self.enabled then
|
if self.focused and self.enabled then
|
||||||
term.setCursorPos(self.x + self.cursorPosDisplay, self.y)
|
term.setCursorPos(self.x + self.cursorPosDisplay, self.y)
|
||||||
term.blink(true)
|
-- CC Tweaked doesn't support term.blink, so we'll invert the colors instead
|
||||||
else
|
local currentFg = term.getTextColor()
|
||||||
term.blink(false)
|
local currentBg = term.getBackgroundColor()
|
||||||
|
term.setTextColor(currentBg)
|
||||||
|
term.setBackgroundColor(currentFg)
|
||||||
|
term.write(" ")
|
||||||
|
term.setTextColor(currentFg)
|
||||||
|
term.setBackgroundColor(currentBg)
|
||||||
|
term.setCursorPos(self.x + self.cursorPosDisplay, self.y)
|
||||||
end
|
end
|
||||||
|
|
||||||
term.setTextColor(oldFg)
|
term.setTextColor(oldFg)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
-- LeonOS installer
|
-- LeonOS installer
|
||||||
local INSTALLER_VERSION = "0.3.8 Beta 3 Alpha 2"
|
local INSTALLER_VERSION = "0.3.8 Beta 3 Alpha 3"
|
||||||
local DEFAULT_ROM_DIR = "/leonos"
|
local DEFAULT_ROM_DIR = "/leonos"
|
||||||
|
|
||||||
print("Start loading LeonOS installer ("..INSTALLER_VERSION..")...")
|
print("Start loading LeonOS installer ("..INSTALLER_VERSION..")...")
|
||||||
|
|||||||
Reference in New Issue
Block a user