Ci mobile fix (#812)
* - Add portrait switch * - Only build mobile * 设置项添加竖屏和msaa参数,增加调整的控件 * 修正conf.lua里没拿到正确的存档路径(因为还没设置identity) * 加一些测试代码观察安卓到底有没有读到存档文件 * -Try relative * - Try set settings in main * - Make code analysis happy * - Try not use setFullScreen * - Test iOS portrait * - Add various loggings * - Try set identity first * - Try set configs in conf.lua * - Finish editing Co-authored-by: MrZ_26 <1046101471@qq.com>
This commit is contained in:
2
.github/workflows/main.yml
vendored
2
.github/workflows/main.yml
vendored
@@ -261,7 +261,7 @@ jobs:
|
||||
dir: ./ColdClear
|
||||
- name: Build iOS packages
|
||||
id: build-packages
|
||||
uses: love-actions/love-actions-ios@v1
|
||||
uses: love-actions/love-actions-ios@main
|
||||
with:
|
||||
app-name: ${{ needs.get-info.outputs.app-name }}
|
||||
bundle-id: ${{ steps.process-app-name.outputs.bundle-id }}
|
||||
|
||||
44
conf.lua
44
conf.lua
@@ -2,23 +2,22 @@ SYSTEM=love._os if SYSTEM=='OS X' then SYSTEM='macOS' end
|
||||
MOBILE=SYSTEM=='Android' or SYSTEM=='iOS'
|
||||
FNNS=SYSTEM:find'\79\83'-- What does FNSF stand for? IDK so don't ask me lol
|
||||
|
||||
local _mobileFullscreen=true
|
||||
local _msaa=0
|
||||
if love.filesystem.getInfo('conf/settings') then
|
||||
local fileData=love.filesystem.read('conf/settings')
|
||||
if type(fileData)=='string' then
|
||||
if MOBILE and fileData:find('"portrait":true') then
|
||||
_mobileFullscreen=false
|
||||
end
|
||||
if fileData:find("'msaa':") then
|
||||
local num=tonumber(fileData:match("'msaa':(%d+)"))
|
||||
if num then _msaa=num end
|
||||
function love.conf(t)
|
||||
local identity='Techmino'
|
||||
local msaa=0
|
||||
local portrait=false
|
||||
|
||||
local fs=love.filesystem
|
||||
fs.setIdentity(identity)
|
||||
do -- Load grapgic settings from conf/settings
|
||||
local fileData=fs.read('conf/settings')
|
||||
if fileData then
|
||||
msaa=tonumber(fileData:match('"msaa":(%d+)')) or 0;
|
||||
portrait=MOBILE and fileData:find('"portrait":true') and true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function love.conf(t)
|
||||
t.identity='Techmino' -- Saving folder
|
||||
t.identity=identity -- Saving folder
|
||||
t.version="11.4"
|
||||
t.gammacorrect=false
|
||||
t.appendidentity=true -- Search files in source then in save directory
|
||||
@@ -30,23 +29,30 @@ function love.conf(t)
|
||||
|
||||
local W=t.window
|
||||
W.title="Techmino "..require "version".string
|
||||
W.width,W.height=1280,720
|
||||
W.minwidth,W.minheight=640,360
|
||||
if portrait then
|
||||
W.width,W.height=720,1280
|
||||
W.minwidth,W.minheight=360,640
|
||||
else
|
||||
W.width,W.height=1280,720
|
||||
W.minwidth,W.minheight=640,360
|
||||
end
|
||||
|
||||
W.vsync=0 -- Unlimited FPS
|
||||
W.msaa=_msaa -- Multi-sampled antialiasing
|
||||
W.msaa=msaa -- Multi-sampled antialiasing
|
||||
W.depth=0 -- Bits/samp of depth buffer
|
||||
W.stencil=1 -- Bits/samp of stencil buffer
|
||||
W.display=1 -- Monitor ID
|
||||
W.highdpi=true -- High-dpi mode for the window on a Retina display
|
||||
W.x,W.y=nil,nil -- Position of the window
|
||||
if love.filesystem.getInfo('media/image/icon.png') then
|
||||
|
||||
if fs.getInfo('media/image/icon.png') then
|
||||
W.icon='media/image/icon.png'
|
||||
end
|
||||
|
||||
if MOBILE then
|
||||
W.borderless=true
|
||||
W.resizable=false
|
||||
W.fullscreen=_mobileFullscreen
|
||||
W.fullscreen=true
|
||||
else
|
||||
W.borderless=false
|
||||
W.resizable=true
|
||||
|
||||
@@ -655,6 +655,8 @@ do-- Userdata tables
|
||||
highCam=true,
|
||||
nextPos=true,
|
||||
fullscreen=true,
|
||||
portrait=false,
|
||||
msaa=0,
|
||||
bg='on',
|
||||
bgAlpha=.26,
|
||||
powerInfo=false,
|
||||
|
||||
@@ -17,6 +17,7 @@ return {
|
||||
playedLong="You have been playing for a long time. Time to take a break!",
|
||||
playedTooMuch="You have been playing for far too long! Techmino is fun, but remember to take some rests!",
|
||||
settingWarn="Careful — you’re about to change some uncommon settings!",
|
||||
settingWarn2="This setting takes effect after restart",
|
||||
|
||||
atkModeName={"Random","Badges","K.O.s","Attackers"},
|
||||
royale_remain="$1 Players Left",
|
||||
@@ -531,6 +532,8 @@ return {
|
||||
power="Battery Info",
|
||||
clean="Quick Draw",
|
||||
fullscreen="Fullscreen",
|
||||
portrait="Portrait",
|
||||
msaa="MSAA level",
|
||||
|
||||
bg_on="Normal B.G.",
|
||||
bg_off="No B.G.",
|
||||
|
||||
@@ -17,6 +17,7 @@ return {
|
||||
playedLong="[Anti-adicción] Estuviste jugando un buen rato hoy. Recuerda descansar de vez en cuando.",
|
||||
playedTooMuch="[Anti-adicción] ¡Has jugado mucho por hoy! No puedes jugar más.",
|
||||
settingWarn="¡Ten cuidado con modificar esto!",
|
||||
-- settingWarn2="This setting takes effect after restart",
|
||||
|
||||
atkModeName={"Al azar","Medallas","KOs","Atacantes"},
|
||||
royale_remain="$1 Jugadores Restantes",
|
||||
@@ -531,6 +532,8 @@ return {
|
||||
power="Inf. de Batería",
|
||||
clean="Fast Draw",
|
||||
fullscreen="Pant. Completa",
|
||||
-- portrait="Portrait",
|
||||
-- msaa="MSAA level",
|
||||
|
||||
bg_on="Fondo Normal",
|
||||
bg_off="Sin Fondo",
|
||||
|
||||
@@ -7,6 +7,7 @@ return {
|
||||
playedLong="[Anti-addiction] Vous avez joué pendant un bon bout de temps aujourd'hui. Faites des pauses.",
|
||||
playedTooMuch="[Anti-addiction] Vous avez joué trop longtemps ! Vous ne pouvez plus jouer.",
|
||||
-- settingWarn="Modifing uncommon setting, be careful!",
|
||||
-- settingWarn2="This setting takes effect after restart",
|
||||
|
||||
atkModeName={"Aléatoire","Badges","K.O.s faciles","Attaquants"},
|
||||
royale_remain="$1 Joueurs restants",
|
||||
@@ -496,6 +497,8 @@ return {
|
||||
power="Infos d'alimentation",
|
||||
-- clean="Fast Draw",
|
||||
fullscreen="Plein écran",
|
||||
-- portrait="Portrait",
|
||||
-- msaa="MSAA level",
|
||||
|
||||
-- bg_on="Normal B.G.",
|
||||
-- bg_off="No B.G.",
|
||||
|
||||
@@ -18,6 +18,7 @@ return {
|
||||
playedLong="Anda telah bermain lama. Waktunya istirahat!",
|
||||
playedTooMuch="Anda telah bermain terlalu lama! Techmino sangat menyenangkan, tetapi jangan lupa istirahat!",
|
||||
settingWarn="Awas, Anda akan mengubah beberapa pengaturan yang tidak biasanya diubah!",
|
||||
-- settingWarn2="This setting takes effect after restart",
|
||||
|
||||
atkModeName={"Acak","Badge","K.O.","Penyerang"},
|
||||
royale_remain="$1 Pemain Tersisa",
|
||||
@@ -532,6 +533,8 @@ return {
|
||||
power="Info Baterai",
|
||||
clean="Gambar Cepat",
|
||||
fullscreen="Layar Penuh",
|
||||
-- portrait="Portrait",
|
||||
-- msaa="MSAA level",
|
||||
|
||||
bg_on="B.G. Normal",
|
||||
bg_off="Tidak Ada B.G.",
|
||||
|
||||
@@ -18,6 +18,7 @@ return {
|
||||
playedLong="長時間プレイしています、適度に休憩をして!",
|
||||
playedTooMuch="かなり長くプレイしています! Techminoは楽しいですが、休憩を忘れずに!",
|
||||
settingWarn="使用頻度の少ない設定に変更しています。注意してください。",
|
||||
-- settingWarn2="This setting takes effect after restart",
|
||||
|
||||
atkModeName={"ランダム","バッジ狙い","トドメ撃ち","カウンター"},
|
||||
royale_remain="残り $1 人",
|
||||
@@ -533,6 +534,8 @@ return {
|
||||
power="バッテリー",
|
||||
clean="素早い描画",
|
||||
fullscreen="フルスクリーン",
|
||||
-- portrait="Portrait",
|
||||
-- msaa="MSAA level",
|
||||
|
||||
bg_on="通常背景",
|
||||
bg_off="背景なし ",
|
||||
|
||||
@@ -8,6 +8,7 @@ return {
|
||||
playedLong="[Anti-vício] Você andou jogando bastante hoje. Certifique-se de fazer pausas.",
|
||||
playedTooMuch="[Anti-vício] Você esteve jogando demais hoje! Você não pode jogar mais.",
|
||||
-- settingWarn="Modifing uncommon setting, be careful!",
|
||||
-- settingWarn2="This setting takes effect after restart",
|
||||
|
||||
atkModeName={"Aleatório","Emblemas","K.O.s","Atacantes"},
|
||||
royale_remain="$1 Jogadores restantes",
|
||||
@@ -520,6 +521,8 @@ return {
|
||||
power="Informação bateria",
|
||||
-- clean="Fast Draw",
|
||||
fullscreen="Tela cheia",
|
||||
-- portrait="Portrait",
|
||||
-- msaa="MSAA level",
|
||||
|
||||
-- bg_on="Normal B.G.",
|
||||
-- bg_off="No B.G.",
|
||||
|
||||
@@ -282,6 +282,8 @@ return {
|
||||
power="+.",
|
||||
clean="[]→→O",
|
||||
fullscreen="|←→|",
|
||||
portrait="↑▉↓",
|
||||
msaa="/ _",
|
||||
|
||||
bg_on="__?__",
|
||||
bg_off="__.__",
|
||||
|
||||
@@ -17,6 +17,7 @@ return {
|
||||
playedLong="已经玩很久了!注意休息!",
|
||||
playedTooMuch="今天玩太久啦!打块好玩但也要适可而止哦~",
|
||||
settingWarn="正在修改不常用设置,小心操作!",
|
||||
settingWarn2="该设置需要重启后生效",
|
||||
|
||||
atkModeName={"随机","徽章","击杀","反击"},
|
||||
royale_remain="剩余 $1 名玩家",
|
||||
@@ -532,6 +533,8 @@ return {
|
||||
power="电量和时间",
|
||||
clean="绘制优化",
|
||||
fullscreen="全屏",
|
||||
portrait="竖屏",
|
||||
msaa="抗锯齿等级",
|
||||
|
||||
bg_on="普通背景",
|
||||
bg_off="关闭背景",
|
||||
|
||||
@@ -16,6 +16,7 @@ return {
|
||||
playedLong="PlayedLong=true",
|
||||
playedTooMuch="PlayedTooMuch=true",
|
||||
settingWarn="SettingWarn();",
|
||||
settingWarn2="SettingWarn2();",
|
||||
|
||||
atkModeName={"Random();","Badges();","Kills();","Back();"},
|
||||
royale_remain="LeftPlayers=$1",
|
||||
@@ -481,6 +482,8 @@ return {
|
||||
power="Set.Battery",
|
||||
clean="Set.QuickDraw",
|
||||
fullscreen="Set.Fullscreen",
|
||||
portrait="Set.Portrait",
|
||||
msaa="Set.MSAA",
|
||||
|
||||
bg_on="Set.BG(Normal);",
|
||||
bg_off="Set.BG(Off);",
|
||||
|
||||
@@ -17,6 +17,7 @@ return {
|
||||
playedLong="你玩太久了!注意休息!",
|
||||
playedTooMuch="今天玩得太久啦!Techmino好玩但也要注意休息哦~",
|
||||
settingWarn="正在修改不常用設定,小心操作!",
|
||||
settingWarn2="該設定需要重啟後生效",
|
||||
|
||||
atkModeName={"隨機","徽章","K.O.","反擊"},
|
||||
royale_remain="剩下 $1 名玩家",
|
||||
@@ -532,6 +533,8 @@ return {
|
||||
power="電量顯示",
|
||||
clean="渲染優化",
|
||||
fullscreen="全屏幕",
|
||||
portrait="豎屏",
|
||||
msaa="抗鋸齒等級",
|
||||
|
||||
bg_on="普通背景",
|
||||
bg_off="無背景",
|
||||
|
||||
@@ -42,6 +42,11 @@ function scene.draw()
|
||||
gc.pop()
|
||||
end
|
||||
|
||||
local function _msaaShow(S)
|
||||
S=S.disp()
|
||||
return S==0 and 0 or 2^S
|
||||
end
|
||||
|
||||
scene.widgetScrollHeight=900
|
||||
scene.widgetList={
|
||||
WIDGET.newText{name='title', x=640,y=15,lim=630,font=80},
|
||||
@@ -70,21 +75,23 @@ scene.widgetList={
|
||||
|
||||
WIDGET.newSelector{name='frame', x=400,y=890,lim=280,w=460,list={8,10,13,17,22,29,37,47,62,80,100},disp=SETval('frameMul'),code=function(v) SETTING.frameMul=v;Z.setFrameMul(SETTING.frameMul) end},
|
||||
|
||||
WIDGET.newSwitch{name='text', x=450,y=980,lim=360,disp=SETval('text'), code=SETrev('text')},
|
||||
WIDGET.newSwitch{name='score', x=450,y=1030,lim=360,disp=SETval('score'), code=SETrev('score')},
|
||||
WIDGET.newSwitch{name='bufferWarn', x=450,y=1100,lim=360,disp=SETval('bufferWarn'), code=SETrev('bufferWarn')},
|
||||
WIDGET.newSwitch{name='showSpike', x=450,y=1150,lim=360,disp=SETval('showSpike'), code=SETrev('showSpike')},
|
||||
WIDGET.newSwitch{name='nextPos', x=450,y=1220,lim=360,disp=SETval('nextPos'), code=SETrev('nextPos')},
|
||||
WIDGET.newSwitch{name='highCam', x=450,y=1270,lim=360,disp=SETval('highCam'), code=SETrev('highCam')},
|
||||
WIDGET.newSwitch{name='warn', x=450,y=1340,lim=360,disp=SETval('warn'), code=SETrev('warn')},
|
||||
WIDGET.newSwitch{name='text', x=450,y=980,lim=360,disp=SETval('text'), code=SETrev('text')},
|
||||
WIDGET.newSwitch{name='score', x=450,y=1030,lim=360,disp=SETval('score'), code=SETrev('score')},
|
||||
WIDGET.newSwitch{name='bufferWarn', x=450,y=1100,lim=360,disp=SETval('bufferWarn'), code=SETrev('bufferWarn')},
|
||||
WIDGET.newSwitch{name='showSpike', x=450,y=1150,lim=360,disp=SETval('showSpike'), code=SETrev('showSpike')},
|
||||
WIDGET.newSwitch{name='nextPos', x=450,y=1220,lim=360,disp=SETval('nextPos'), code=SETrev('nextPos')},
|
||||
WIDGET.newSwitch{name='highCam', x=450,y=1270,lim=360,disp=SETval('highCam'), code=SETrev('highCam')},
|
||||
WIDGET.newSwitch{name='warn', x=450,y=1340,lim=360,disp=SETval('warn'), code=SETrev('warn')},
|
||||
|
||||
WIDGET.newSwitch{name='clickFX', x=950,y=980,lim=360,disp=SETval('clickFX'), code=function() SETTING.clickFX=not SETTING.clickFX applySettings() end},
|
||||
WIDGET.newSwitch{name='power', x=950,y=1070,lim=360,disp=SETval('powerInfo'), code=function() SETTING.powerInfo=not SETTING.powerInfo applySettings() end},
|
||||
WIDGET.newSwitch{name='clean', x=950,y=1160,lim=360,disp=SETval('cleanCanvas'), code=function() SETTING.cleanCanvas=not SETTING.cleanCanvas applySettings() end},
|
||||
WIDGET.newSwitch{name='fullscreen', x=950,y=1250,lim=360,disp=SETval('fullscreen'), code=function() SETTING.fullscreen=not SETTING.fullscreen applySettings() end,hideF=function() return MOBILE end},
|
||||
WIDGET.newSwitch{name='clickFX', x=950,y=980,lim=360,disp=SETval('clickFX'), code=function() SETTING.clickFX=not SETTING.clickFX; applySettings() end},
|
||||
WIDGET.newSwitch{name='power', x=950,y=1050,lim=360,disp=SETval('powerInfo'), code=function() SETTING.powerInfo=not SETTING.powerInfo; applySettings() end},
|
||||
WIDGET.newSwitch{name='clean', x=950,y=1120,lim=360,disp=SETval('cleanCanvas'), code=function() SETTING.cleanCanvas=not SETTING.cleanCanvas; applySettings() end},
|
||||
WIDGET.newSwitch{name='fullscreen', x=950,y=1190,lim=360,disp=SETval('fullscreen'), code=function() SETTING.fullscreen=not SETTING.fullscreen; applySettings() end,hideF=function() return MOBILE end},
|
||||
WIDGET.newSwitch{name='portrait', x=950,y=1190,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=1250,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=1340,w=200,h=80,code=function() SETTING.bg='on'applySettings() end},
|
||||
WIDGET.newKey{name='bg_off', x=900,y=1340,w=200,h=80,code=function() SETTING.bg='off'applySettings() end},
|
||||
WIDGET.newKey{name='bg_on', x=680,y=1340,w=200,h=80,code=function() SETTING.bg='on'; applySettings() end},
|
||||
WIDGET.newKey{name='bg_off', x=900,y=1340,w=200,h=80,code=function() SETTING.bg='off'; applySettings() end},
|
||||
WIDGET.newKey{name='bg_custom', x=1120,y=1340,w=200,h=80,
|
||||
code=function()
|
||||
if love.filesystem.getInfo('conf/customBG') then
|
||||
|
||||
Reference in New Issue
Block a user