Custom image from clipboard (#1157)
* Update how text renders in button and key * Add a placeholder * Add actual code and language entry * Sort buttons * Alter to keep original behaviour * I HAVE OCD * Add back legacy behaviour
This commit is contained in:
@@ -587,6 +587,7 @@ C. Gamepad
|
||||
bg_on="Normal BG",
|
||||
bg_off="No BG",
|
||||
bg_custom="Custom BG",
|
||||
bg_custom_base64="Paste image as BG\n(PNG/JPG in Base64)",
|
||||
defaultBG="Default BG",
|
||||
resetDbg="Reset to default",
|
||||
lockBG="Lock BG",
|
||||
|
||||
@@ -197,7 +197,7 @@ return {
|
||||
|
||||
|
||||
keySettingInstruction="Nhấn một phím để gán phím đó\nescape (esc): Hủy\nbackspace: Xoá",
|
||||
customBGhelp=not MOBILE and "Kéo một tấm ảnh vào đây để áp dụng ảnh nền tuỳ chỉnh" or "Chưa hỗ trợ ảnh nền cho điện thoại",
|
||||
customBGhelp="Kéo một tấm ảnh vào đây để áp dụng ảnh nền tuỳ chỉnh",
|
||||
customBGloadFailed="Định dạng ảnh không được hỗ trợ",
|
||||
|
||||
errorMsg="Techmino bị lỗi và cần phải được khởi động lại\nBạn có thể gửi error log để giúp dev sửa game nhanh hơn.",
|
||||
@@ -583,6 +583,7 @@ C. Tay cầm chơi game (Gamepad):
|
||||
bg_on="Ảnh nền thường",
|
||||
bg_off="Không ảnh nền",
|
||||
bg_custom="Ảnh nền tự chọn",
|
||||
bg_custom_base64="Dán ảnh và cài thành ảnh nền\n(PNG/JPG ở format Base64)",
|
||||
defaultBG="Nền mặc định",
|
||||
resetDbg='Đặt lại',
|
||||
lockBG="Khóa ảnh nền",
|
||||
|
||||
@@ -33,7 +33,7 @@ function scene.draw()
|
||||
gc.push('transform')
|
||||
gc.setColor(1,1,1)
|
||||
local T=skinLib[1]
|
||||
gc.translate(-200,1410-WIDGET.scrollPos) -- -200
|
||||
gc.translate(0,1610-WIDGET.scrollPos)
|
||||
gc.setShader(SHADER.blockSatur)
|
||||
gc.draw(T,435,0)gc.draw(T,465,0)gc.draw(T,465,30)gc.draw(T,495,30)
|
||||
gc.setShader(SHADER.fieldSatur)
|
||||
@@ -50,7 +50,7 @@ local function _msaaShow(S)
|
||||
return S==0 and 0 or 2^S
|
||||
end
|
||||
|
||||
scene.widgetScrollHeight=900
|
||||
scene.widgetScrollHeight=1200
|
||||
scene.widgetList={
|
||||
WIDGET.newText{name='title', x=640,y=15,lim=630,font=80},
|
||||
|
||||
@@ -93,9 +93,9 @@ scene.widgetList={
|
||||
WIDGET.newSwitch{name='portrait', x=950,y=1150,lim=360,disp=SETval('portrait'), code=function() SETTING.portrait=not SETTING.portrait; saveSettings(); MES.new('warn',text.settingWarn2,6.26) end,hideF=function() return not MOBILE end},
|
||||
WIDGET.newSlider{name='msaa', x=950,y=1220,lim=360,w=200,axis={0,4,1},show=_msaaShow,disp=function() return SETTING.msaa==0 and 0 or math.log(SETTING.msaa,2) end,code=function(v) SETTING.msaa=v==0 and 0 or 2^v; saveSettings(); if TASK.lock('warnMessage',6.26) then MES.new('warn',text.settingWarn2,6.26) end end},
|
||||
|
||||
WIDGET.newKey{name='bg_on', x=680,y=1290,w=200,h=60,code=function() SETTING.bg='on' ; applySettings() end},
|
||||
WIDGET.newKey{name='bg_off', x=900,y=1290,w=200,h=60,code=function() SETTING.bg='off'; applySettings() end},
|
||||
WIDGET.newKey{name='bg_custom', x=1120,y=1290,w=200,h=60,
|
||||
WIDGET.newKey{name='bg_on', x=680,y=1290,w=200,h=60,font=25,code=function() SETTING.bg='on' ; applySettings() end},
|
||||
WIDGET.newKey{name='bg_off', x=900,y=1290,w=200,h=60,font=25,code=function() SETTING.bg='off'; applySettings() end},
|
||||
WIDGET.newKey{name='bg_custom', x=1120,y=1290,w=200,h=60,font=25,
|
||||
code=function()
|
||||
if love.filesystem.getInfo('conf/customBG') then
|
||||
SETTING.bg='custom'
|
||||
@@ -117,7 +117,7 @@ scene.widgetList={
|
||||
end,
|
||||
hideF=function() return SETTING.bg=='on' end
|
||||
},
|
||||
WIDGET.newSelector{name='defaultBG', x=680,y=1365,w=200,color='G',
|
||||
WIDGET.newSelector{name='defaultBG', x=680,y=1465,w=200,color='G',
|
||||
list={'space','bg1','bg2','rainbow','rainbow2','aura','rgb','glow','matrix','cubes','tunnel','galaxy','quarks','blockfall','blockrain','blockhole','blockspace'},
|
||||
disp=SETval('defaultBG'),
|
||||
code=function(v)
|
||||
@@ -126,7 +126,7 @@ scene.widgetList={
|
||||
end,
|
||||
hideF=function() return SETTING.bg~='on' end
|
||||
},
|
||||
WIDGET.newKey{name='resetDbg',x=870,y=1365,w=140,h=60,font=15,
|
||||
WIDGET.newKey{name='resetDbg',x=680,y=1540,w=200,h=60,font=20,
|
||||
code=function()
|
||||
SETTING.defaultBG='space'
|
||||
scene.widgetList.defaultBG:reset()
|
||||
@@ -134,7 +134,20 @@ scene.widgetList={
|
||||
end,
|
||||
hideF=function() return SETTING.bg~='on' or SETTING.defaultBG=='space' end
|
||||
},
|
||||
WIDGET.newSwitch{name='lockBG',x=1170,y=1365,lim=200,
|
||||
WIDGET.newKey{name='bg_custom_base64',x=1010,y=1502.5,w=420,h=135,align='M',
|
||||
code=function()
|
||||
local okay,data=pcall(love.data.decode,"data","base64",love.system.getClipboardText())
|
||||
if okay and pcall(gc.newImage,data) then
|
||||
love.filesystem.write('conf/customBG',data)
|
||||
SETTING.bg='custom'
|
||||
applySettings()
|
||||
else
|
||||
MES.new('error',text.customBGloadFailed)
|
||||
end
|
||||
end,
|
||||
-- hideF=function() return SETTING.bg=='off' end
|
||||
},
|
||||
WIDGET.newSwitch{name='lockBG',x=450,y=1465,lim=200,
|
||||
disp=SETval('lockBG'),
|
||||
code=function()
|
||||
SETTING.lockBG=not SETTING.lockBG
|
||||
@@ -143,7 +156,7 @@ scene.widgetList={
|
||||
hideF=function() return SETTING.bg~='on' end
|
||||
},
|
||||
|
||||
WIDGET.newSwitch{name='noTheme',x=1170,y=1435,
|
||||
WIDGET.newSwitch{name='noTheme',x=450,y=1540,
|
||||
disp=SETval('noTheme'),
|
||||
code=function()
|
||||
SETTING.noTheme=not SETTING.noTheme
|
||||
@@ -159,12 +172,12 @@ scene.widgetList={
|
||||
end
|
||||
},
|
||||
|
||||
WIDGET.newSelector{name='blockSatur', x=600,y=1440,w=300,color='lN',
|
||||
WIDGET.newSelector{name='blockSatur', x=800,y=1640,w=300,color='lN',
|
||||
list={'normal','soft','gray','light','color'},
|
||||
disp=SETval('blockSatur'),
|
||||
code=function(v) SETTING.blockSatur=v; applySettings() end
|
||||
},
|
||||
WIDGET.newSelector{name='fieldSatur', x=600,y=1540,w=300,color='lN',
|
||||
WIDGET.newSelector{name='fieldSatur', x=800,y=1740,w=300,color='lN',
|
||||
list={'normal','soft','gray','light','color'},
|
||||
disp=SETval('fieldSatur'),
|
||||
code=function(v) SETTING.fieldSatur=v; applySettings() end
|
||||
|
||||
Reference in New Issue
Block a user