From ad25c652ce82d02959feaefc7be97848b03c7ee7 Mon Sep 17 00:00:00 2001 From: libccy Date: Sun, 26 Mar 2017 14:00:38 +0800 Subject: [PATCH] s --- game/game.js | 103 +++++++++++++++++++++++++++++++++++++- game/update.js | 8 +-- layout/default/layout.css | 16 ++++-- layout/default/phone.css | 3 ++ 4 files changed, 122 insertions(+), 8 deletions(-) diff --git a/game/game.js b/game/game.js index 73bcde9c2..e53db3002 100644 --- a/game/game.js +++ b/game/game.js @@ -371,6 +371,12 @@ else{ map.touchscreen.hide(); } + if(lib.device){ + map.enable_vibrate.show(); + } + else{ + map.enable_vibrate.hide(); + } if(lib.config.touchscreen){ map.mousewheel.hide(); map.hover_all.hide(); @@ -2369,6 +2375,27 @@ else{ map.show_handcardbutton.hide(); } + if(lib.device){ + if(lib.device=='android'){ + map.show_statusbar_android.show(); + map.show_statusbar_ios.hide(); + } + else if(lib.device=='ios'){ + map.show_statusbar_ios.show(); + map.show_statusbar_android.hide(); + } + if(!game.download){ + setTimeout(function(){ + if(!window.StatusBar){ + map.show_statusbar.hide(); + } + },5000); + } + } + else{ + map.show_statusbar_ios.hide(); + map.show_statusbar_android.hide(); + } if(get.is.phoneLayout()){ map.remember_round_button.show(); map.reset_round_button.show(); @@ -2497,7 +2524,7 @@ show_time2:{ name:'显示时间', intro:'在触屏按钮处显示当前时间', - init:true, + init:false, unfrequent:true, onclick:function(bool){ game.saveConfig('show_time2',bool); @@ -2522,6 +2549,56 @@ ui.roundmenu.dataset.watchface=item; } }, + show_statusbar_android:{ + name:'显示状态栏', + init:false, + unfrequent:true, + content:function(bool){ + game.saveConfig('show_statusbar',bool); + if(window.StatusBar&&lib.device=='android'){ + if(bool){ + window.StatusBar.overlaysWebView(false); + window.StatusBar.backgroundColorByName('black'); + window.StatusBar.show(); + } + else{ + ui.window.classList.remove('statusbar'); + window.StatusBar.hide(); + } + } + } + }, + show_statusbar_ios:{ + name:'显示状态栏', + init:'off', + unfrequent:true, + item:{ + default:'默认', + overlay:'嵌入', + off:'关闭' + }, + onclick:function(bool){ + game.saveConfig('show_statusbar_ios',bool); + if(window.StatusBar&&lib.device=='ios'){ + if(bool!='off'){ + if(lib.config.show_statusbar_ios=='default'){ + window.StatusBar.overlaysWebView(false); + ui.window.classList.remove('statusbar'); + } + else{ + window.StatusBar.overlaysWebView(true); + ui.window.classList.add('statusbar'); + } + window.StatusBar.backgroundColorByName('black'); + window.StatusBar.show(); + } + else{ + ui.window.classList.remove('statusbar'); + window.StatusBar.hide(); + } + } + } + }, show_card_prompt:{ name:'显示出牌信息', intro:'出牌时在使用者上显示卡牌名称', @@ -6153,6 +6230,29 @@ if(ui.updateUpdate){ ui.updateUpdate(); } + if(window.StatusBar){ + if(lib.device=='android'){ + if(lib.config.show_statusbar_android){ + window.StatusBar.overlaysWebView(false); + window.StatusBar.backgroundColorByName('black'); + window.StatusBar.show(); + } + } + else if(lib.device=='ios'){ + if(lib.config.show_statusbar_ios!='off'){ + if(lib.config.show_statusbar_ios=='default'){ + window.StatusBar.overlaysWebView(false); + ui.window.classList.remove('statusbar'); + } + else{ + window.StatusBar.overlaysWebView(true); + ui.window.classList.add('statusbar'); + } + window.StatusBar.backgroundColorByName('black'); + window.StatusBar.show(); + } + } + } } } if(!lib.config.touchscreen){ @@ -6210,6 +6310,7 @@ break; } } + game.metaZoom=zoom; } } game.documentZoom=1; diff --git a/game/update.js b/game/update.js index 7e476abbe..532aedb87 100644 --- a/game/update.js +++ b/game/update.js @@ -1,8 +1,8 @@ window.noname_update={ - version:'1.9.15', + version:'1.9.16', // update:'1.9.14', changeLog:[ - 'bug修复', + '状态栏选项(需更新ios/android客户端)', ], files:[ 'game/game.js', @@ -22,8 +22,8 @@ window.noname_update={ // 'mode/tafang.js', 'mode/stone.js', // 'theme/woodden/style.css', - // 'layout/default/layout.css', - // 'layout/default/phone.css', + 'layout/default/layout.css', + 'layout/default/phone.css', // 'layout/default/menu.css', // 'theme/style/cardback/*', // 'layout/long/layout.css', diff --git a/layout/default/layout.css b/layout/default/layout.css index 8ac22a918..f5a0e6443 100644 --- a/layout/default/layout.css +++ b/layout/default/layout.css @@ -42,9 +42,19 @@ table { transition-property: opacity; overflow: hidden } -#window.ipad { - height: calc(100% - 15px); - top: 15px; +#window.statusbar { + top: 30px; + height: calc(100% - 30px); + overflow: visible; +} +#window.statusbar::before{ + content:''; + position:absolute; + left: 0; + top: -30px; + width: 100%; + height: 30px; + background: rgba(0,0,0,0.4); } #window>.tutorial_tap { width: 30px; diff --git a/layout/default/phone.css b/layout/default/phone.css index 97fee46fb..1a923b956 100644 --- a/layout/default/phone.css +++ b/layout/default/phone.css @@ -49,6 +49,9 @@ #system>div:not(.shown){ transform: translateY(-80px); } +#window.statusbar #system>div:not(.shown){ + transform: translateY(-120px); +} #system>#system1{ width: 140px; }