From 8a9a153fe834068117b1dce519c8cf15772f3c7f Mon Sep 17 00:00:00 2001
From: shijian <2954700422@qq.com>
Date: Wed, 13 Sep 2023 00:11:38 +0800
Subject: [PATCH 1/4] =?UTF-8?q?=E8=A7=86=E4=B8=BA=E7=89=8C=E6=98=BE?=
=?UTF-8?q?=E7=A4=BA=E7=9A=84=E9=80=89=E9=A1=B9=E5=A2=9E=E5=8A=A0=E5=9B=BE?=
=?UTF-8?q?=E7=89=87=E9=80=89=E9=A1=B9?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
game/game.js | 141 +++++++++++++++++++++++++++------
image/card/cardtempname_bg.png | Bin 0 -> 2399 bytes
layout/default/layout.css | 26 ++++++
tream | 46 +++++++++++
4 files changed, 189 insertions(+), 24 deletions(-)
create mode 100644 image/card/cardtempname_bg.png
create mode 100644 tream
diff --git a/game/game.js b/game/game.js
index 213296f7e..9ef06116c 100644
--- a/game/game.js
+++ b/game/game.js
@@ -3056,12 +3056,13 @@
},
cardtempname:{
name:'视为卡牌名称显示',
- intro:'显示强制视为类卡牌(如武魂)等名称的显示方式',
+ intro:'显示强制视为类卡牌(如武魂),包括拆顺对话框内的判定牌(国色)转换等名称的显示方式',
init:'default',
unfrequent:true,
item:{
default:'纵向',
horizon:'横向',
+ image:'图片',
off:'禁用',
},
onclick:function(item){
@@ -3072,14 +3073,9 @@
if(hs[i]._tempName){
switch(item){
case 'default':
- var node=hs[i]._tempName;
- node.classList.add('vertical');
- node.innerHTML=get.verticalStr(node.tempname);
- break;
case 'horizon':
- var node=hs[i]._tempName;
- node.classList.remove('vertical');
- node.innerHTML=node.tempname;
+ case 'image':
+ ui.create.cardTempName(hs[i]);
break;
default:
hs[i]._tempName.delete();
@@ -39741,27 +39737,124 @@
},
create:{
cardTempName:function(card,applyNode){
- const getApplyNode=applyNode||card;
- const cardName=get.name(card);
- const cardNature=get.nature(card);
+ let getApplyNode=applyNode||card;
+ let cardName=get.name(card);
+ let cardNature=get.nature(card);
let tempname=get.translation(cardName);
- const node=getApplyNode._tempName||ui.create.div('.tempname',getApplyNode);
+ let cardTempNameConfig=lib.config.cardtempname;
+ let node=getApplyNode._tempName||ui.create.div('.tempname',getApplyNode);
getApplyNode._tempName=node;
- let datasetNature='fire';
- if(get.position(card)=='j'&&card.viewAs&&card.viewAs!=card.name) {
- datasetNature = 'wood';
- tempname=get.translation(card.viewAs);
+ if(cardTempNameConfig!='image'){
+ //清空,避免和下面的image部分有冲突
+ node.innerHTML='';
+ let datasetNature='fire';
+ if(get.position(card)=='j'&&card.viewAs&&card.viewAs!=card.name) {
+ datasetNature = 'wood';
+ tempname=get.translation(card.viewAs);
+ }else{
+ if(cardName=='sha'){
+ if(cardNature) tempname=get.translation(cardNature)+tempname;
+ if(cardNature=='thunder') datasetNature='thunder';
+ if(cardNature=='kami') datasetNature='kami';
+ if(cardNature=='ice') datasetNature='ice';
+ }
+ }
+ if(cardTempNameConfig=='default') getApplyNode._tempName.classList.add('vertical');
+ getApplyNode._tempName.dataset.nature=datasetNature;
}else{
- if(cardName=='sha'){
- if(cardNature) tempname=get.translation(cardNature)+tempname;
- if(cardNature=='thunder') datasetNature='thunder';
- if(cardNature=='kami') datasetNature='kami';
- if(cardNature=='ice') datasetNature='ice';
+ if(get.position(card)=='j'&&card.viewAs&&card.viewAs!=card.name) {
+ cardName=card.viewAs;
+ tempname=get.translation(card.viewAs);
+ }
+ let bg=node.querySelector('div');
+ if (bg) {
+ Array.from(node.childNodes).filter(v=>v!=bg).forEach(v=>node.removeChild(v));
+ }
+ else bg=ui.create.div(node);
+ node.classList.add('tempimage');
+ let img=lib.card[cardName].image;
+ if(img){
+ if(img.indexOf('db:')==0){
+ img=img.slice(3);
+ }
+ else if(img.indexOf('ext:')!=0){
+ img=null;
+ }
+ }
+ if(lib.card[cardName].fullskin){
+ if(img){
+ if(img.indexOf('ext:')==0){
+ bg.setBackgroundImage(img.replace(/ext:/,'extension/'));
+ }
+ else{
+ bg.setBackgroundDB(img);
+ }
+ }
+ else{
+ if(lib.card[cardName].modeimage){
+ bg.setBackgroundImage('image/mode/'+lib.card[cardName].modeimage+'/card/'+cardName+'.png');
+ }
+ else{
+ if(cardName=='sha'&&cardNature=='stab') bg.setBackgroundImage('image/card/cisha.png');
+ else bg.setBackgroundImage('image/card/'+cardName+'.png');
+ }
+ }
+ }
+ else if(lib.card[cardName].image=='background'){
+ if(cardNature) bg.setBackground(cardName+'_'+cardNature,'card');
+ else bg.setBackground(cardName,'card');
+ }
+ else if(lib.card[cardName].fullimage){
+ if(img){
+ if(img.indexOf('ext:')==0){
+ bg.setBackgroundImage(img.replace(/ext:/,'extension/'));
+ bg.style.backgroundSize='cover';
+ }
+ else{
+ bg.setBackgroundDB(img);
+ }
+ }
+ else if(lib.card[cardName].image){
+ if(lib.card[cardName].image.indexOf('character:')==0){
+ bg.setBackground(lib.card[cardName].image.slice(10),'character');
+ }
+ else{
+ bg.setBackground(lib.card[cardName].image);
+ }
+ }
+ else{
+ let cardPack=lib.cardPack['mode_'+get.mode()];
+ if(Array.isArray(cardPack)&&cardPack.contains(cardName)){
+ bg.setBackground('mode/'+get.mode()+'/card/'+cardName);
+ }
+ else{
+ bg.setBackground('card/'+cardName);
+ }
+ }
+ }
+ else if(lib.card[cardName].image=='card'){
+ if(cardNature) bg.setBackground(cardName+'_'+cardNature,'card');
+ else bg.setBackground(cardName,'card');
+ }
+ else if(typeof lib.card[cardName].image=='string'&&!lib.card[cardName].fullskin){
+ if(img){
+ if(img.indexOf('ext:')==0){
+ bg.setBackgroundImage(img.replace(/ext:/,'extension/'));
+ bg.style.backgroundSize='cover';
+ }
+ else{
+ bg.setBackgroundDB(img);
+ }
+ }
+ else{
+ bg.setBackground(lib.card[cardName].image);
+ }
+ }
+ else{
+ console.warn('卡牌图片解析失败');
}
}
- if(lib.config.cardtempname=='default') getApplyNode._tempName.classList.add('vertical');
- getApplyNode._tempName.dataset.nature=datasetNature;
- getApplyNode._tempName.innerHTML=lib.config.cardtempname=='default'?get.verticalStr(tempname):tempname;
+ getApplyNode._tempName.innerHTML+=`${cardTempNameConfig=='default'?get.verticalStr(tempname):tempname}`;
getApplyNode._tempName.tempname=tempname;
return node;
},
diff --git a/image/card/cardtempname_bg.png b/image/card/cardtempname_bg.png
new file mode 100644
index 0000000000000000000000000000000000000000..15829475068c0ee348a1cc72939278388077292e
GIT binary patch
literal 2399
zcmbVO4Nwzj8V)+G2u6=XG^HM{Tl_7X-E1~LyO(Go2@=~NrXX-PoZakh!VXC`WETSX
zLy?$5)GAk++L9?Gs0uM6c~r5Q5YJ7
zNJU0CHDnOVvt>ah!OuY&r50gSga*=)N|jbkkYoykV=6t0=~0y$QE4dxqi`GwUof!d
zXPuPYoF29XzKn38B>5;54Fm$pfLbZ|U8ssANfg6T97g~G5zD<2U50qY7bY0YoXGfj
zpTrAZD8xuRgc8XJ1Eu3Gczh9BuNV#!2pC#M`%sk<3%N7~WSI!gSK@b%8D|-kb8{Zf
zD~SNBieP<(f+UEA!jDi#mVaOXgw|$@*qBs{#}hFjN|sXKMmQjoqQ&fTABWmGQ7G{<
zoTU`Vd?DnGk23i=S`z%(g5aJ=RMv!K$Ycs7hJ=>n@?KU5h)W;a!+piBMuywzmN@(WJh4HiWE$~4GoF=SmB&)_FYF7Jsa2jd%UeNzf+1T1+eQN>^nqg=d>B8V6(#JV3p!S0-+BQZeWa+&6b(Z
zD1t_Vws>Rrr=9ChbwtI=wrU6PuP*iP$+>9xXi-Vkmpevhwahy9VD1G~W8Ae3rTyZ!
z-(C3AgZrNZP7U`Yx|!bOy5H}LuKCC1nwYNK`&o5ok~gecc;buZt!tvL^(i#h<>|Hr
z;f}uV)*ac2IQ0IeMOAA$<&QSqn}7Pz{b_GU#|Nj>K|9hbfA;0ZU{4
zzFqBNs|>H#yx)+1xw&L2wzG5PjAw^?zP}mhz|@AXGX@NnKC`|%F0-(F7M*gu(Gq>G
z$x!FE=>Hafv~TUr!#weEe@9ACc{ZW?6JyiqkxZqAuGr<3H7tmZ3~aNT86EOABu0O+g@u*XpfQS(nF$lRZ_CNylMUX
zmn(j!I1mWZH{N@tKlVyrYq4
zwDttK&*IiKwGA$BSTUeKdtBj{$~v~U&9`3CZB-PHUXZuXbI1Q@!Ot_N%vdL`Rxgis
zp7~~Jz)*Rn_59qMjROVKf_c9zcusTVyUtJdy)n(a<7|7?ri#0ood>QfvftTQ-Mb<<
zI6S&z!@tvu5MTXyb49_(vi+`OEkp9IM}KHsU|w{>Dh$div {
+ width: 100%;
+ height: 100%;
+ top: 0;
+ left: 0;
+ background-size: 100%;
+ background-position: -20px -30px;
+ background-repeat: no-repeat;
+}
+.card .tempname.tempimage>span {
+ position: relative;
+ z-index: 1;
+}
.button>.tempname {
font-size: 17px;
left: 5px;
diff --git a/tream b/tream
new file mode 100644
index 000000000..57b9ee804
--- /dev/null
+++ b/tream
@@ -0,0 +1,46 @@
+
+ SSUUMMMMAARRYY OOFF LLEESSSS CCOOMMMMAANNDDSS
+
+ Commands marked with * may be preceded by a number, _N.
+ Notes in parentheses indicate the behavior if _N is given.
+ A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl-K.
+
+ h H Display this help.
+ q :q Q :Q ZZ Exit.
+ ---------------------------------------------------------------------------
+
+ MMOOVVIINNGG
+
+ e ^E j ^N CR * Forward one line (or _N lines).
+ y ^Y k ^K ^P * Backward one line (or _N lines).
+ f ^F ^V SPACE * Forward one window (or _N lines).
+ b ^B ESC-v * Backward one window (or _N lines).
+ z * Forward one window (and set window to _N).
+ w * Backward one window (and set window to _N).
+ ESC-SPACE * Forward one window, but don't stop at end-of-file.
+ d ^D * Forward one half-window (and set half-window to _N).
+ u ^U * Backward one half-window (and set half-window to _N).
+ ESC-) RightArrow * Right one half screen width (or _N positions).
+ ESC-( LeftArrow * Left one half screen width (or _N positions).
+ ESC-} ^RightArrow Right to last column displayed.
+ ESC-{ ^LeftArrow Left to first column.
+ F Forward forever; like "tail -f".
+ ESC-F Like F but stop when search pattern is found.
+ r ^R ^L Repaint screen.
+ R Repaint screen, discarding buffered input.
+ ---------------------------------------------------
+ Default "window" is the screen height.
+ Default "half-window" is half of the screen height.
+ ---------------------------------------------------------------------------
+
+ SSEEAARRCCHHIINNGG
+
+ /_p_a_t_t_e_r_n * Search forward for (_N-th) matching line.
+ ?_p_a_t_t_e_r_n * Search backward for (_N-th) matching line.
+ n * Repeat previous search (for _N-th occurrence).
+ N * Repeat previous search in reverse direction.
+ ESC-n * Repeat previous search, spanning files.
+ ESC-N * Repeat previous search, reverse dir. & spanning files.
+ ESC-u Undo (toggle) search highlighting.
+ ESC-U Clear search highlighting.
+ &_p_a_t_t_e_r_n * Display only matching lines.
From 770cf3d0594f088f6c79dc62871c2fa0ac1c74a3 Mon Sep 17 00:00:00 2001
From: shijian <2954700422@qq.com>
Date: Wed, 13 Sep 2023 00:26:27 +0800
Subject: [PATCH 2/4] delete fuxk tream
---
tream | 46 ----------------------------------------------
1 file changed, 46 deletions(-)
delete mode 100644 tream
diff --git a/tream b/tream
deleted file mode 100644
index 57b9ee804..000000000
--- a/tream
+++ /dev/null
@@ -1,46 +0,0 @@
-
- SSUUMMMMAARRYY OOFF LLEESSSS CCOOMMMMAANNDDSS
-
- Commands marked with * may be preceded by a number, _N.
- Notes in parentheses indicate the behavior if _N is given.
- A key preceded by a caret indicates the Ctrl key; thus ^K is ctrl-K.
-
- h H Display this help.
- q :q Q :Q ZZ Exit.
- ---------------------------------------------------------------------------
-
- MMOOVVIINNGG
-
- e ^E j ^N CR * Forward one line (or _N lines).
- y ^Y k ^K ^P * Backward one line (or _N lines).
- f ^F ^V SPACE * Forward one window (or _N lines).
- b ^B ESC-v * Backward one window (or _N lines).
- z * Forward one window (and set window to _N).
- w * Backward one window (and set window to _N).
- ESC-SPACE * Forward one window, but don't stop at end-of-file.
- d ^D * Forward one half-window (and set half-window to _N).
- u ^U * Backward one half-window (and set half-window to _N).
- ESC-) RightArrow * Right one half screen width (or _N positions).
- ESC-( LeftArrow * Left one half screen width (or _N positions).
- ESC-} ^RightArrow Right to last column displayed.
- ESC-{ ^LeftArrow Left to first column.
- F Forward forever; like "tail -f".
- ESC-F Like F but stop when search pattern is found.
- r ^R ^L Repaint screen.
- R Repaint screen, discarding buffered input.
- ---------------------------------------------------
- Default "window" is the screen height.
- Default "half-window" is half of the screen height.
- ---------------------------------------------------------------------------
-
- SSEEAARRCCHHIINNGG
-
- /_p_a_t_t_e_r_n * Search forward for (_N-th) matching line.
- ?_p_a_t_t_e_r_n * Search backward for (_N-th) matching line.
- n * Repeat previous search (for _N-th occurrence).
- N * Repeat previous search in reverse direction.
- ESC-n * Repeat previous search, spanning files.
- ESC-N * Repeat previous search, reverse dir. & spanning files.
- ESC-u Undo (toggle) search highlighting.
- ESC-U Clear search highlighting.
- &_p_a_t_t_e_r_n * Display only matching lines.
From 992cf6e56f0ebed4cb9387b65ff9df5cfaa188f1 Mon Sep 17 00:00:00 2001
From: shijian <2954700422@qq.com>
Date: Wed, 13 Sep 2023 00:38:47 +0800
Subject: [PATCH 3/4] =?UTF-8?q?=E4=B8=8E=E6=9C=AC=E4=BD=93=E4=BF=9D?=
=?UTF-8?q?=E6=8C=81=E4=B8=80=E8=87=B4=EF=BC=8Ccss=E5=88=A0=E9=99=A4.card?=
=?UTF-8?q?=E9=99=90=E5=AE=9A?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
layout/default/layout.css | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/layout/default/layout.css b/layout/default/layout.css
index 4269315bd..d3ada2231 100644
--- a/layout/default/layout.css
+++ b/layout/default/layout.css
@@ -4548,7 +4548,7 @@ div[data-decoration="bronze"]::after{
writing-mode: vertical-rl;
-webkit-writing-mode: vertical-rl;
}
-.card .tempname.tempimage {
+.tempname.tempimage {
top: calc(50% - 12.5px);
left: 2px;
width: calc(100% - 4px);
@@ -4561,7 +4561,7 @@ div[data-decoration="bronze"]::after{
color: black !important;
text-shadow: white 0 0 2px, white 0 0 3px;
}
-.card .tempname.tempimage>div {
+.tempname.tempimage>div {
width: 100%;
height: 100%;
top: 0;
@@ -4570,7 +4570,7 @@ div[data-decoration="bronze"]::after{
background-position: -20px -30px;
background-repeat: no-repeat;
}
-.card .tempname.tempimage>span {
+.tempname.tempimage>span {
position: relative;
z-index: 1;
}
From a96eee1edf1ec78211e3f780e0fc75e1628aff35 Mon Sep 17 00:00:00 2001
From: shijian <2954700422@qq.com>
Date: Wed, 13 Sep 2023 00:46:38 +0800
Subject: [PATCH 4/4] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dbutton=E4=B8=8B=E7=9A=84?=
=?UTF-8?q?=E5=9B=BE=E7=89=87=E8=A7=86=E4=B8=BA=E6=A0=B7=E5=BC=8F=E4=B8=8D?=
=?UTF-8?q?=E5=AF=B9=E7=9A=84=E9=97=AE=E9=A2=98?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
layout/default/layout.css | 2 ++
1 file changed, 2 insertions(+)
diff --git a/layout/default/layout.css b/layout/default/layout.css
index d3ada2231..559d269a4 100644
--- a/layout/default/layout.css
+++ b/layout/default/layout.css
@@ -4576,6 +4576,8 @@ div[data-decoration="bronze"]::after{
}
.button>.tempname {
font-size: 17px;
+}
+.button>.tempname:not(.tempimage) {
left: 5px;
top: 5px;
}