修复`ui.create.identityCard`在触屏模式的问题

This commit is contained in:
copcap 2023-10-27 03:07:26 +08:00
parent bcf4916f0a
commit e7799ed3f5
No known key found for this signature in database
GPG Key ID: 9AE7B8AF097EC926
2 changed files with 7 additions and 7 deletions

View File

@ -145,7 +145,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
}).join('、')}`, }).join('、')}`,
}, },
$createButton:function(item,type,position,noclick,node){ $createButton:function(item,type,position,noclick,node){
node=ui.create.identityCard(item,position,null,noclick); node=ui.create.identityCard(item,position,noclick);
node.link=item; node.link=item;
return node; return node;
}, },
@ -176,7 +176,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
[list,function(item,type,position,noclick,node){ [list,function(item,type,position,noclick,node){
return lib.skill.jxlianpo.$createButton(item,type,position,noclick,node); return lib.skill.jxlianpo.$createButton(item,type,position,noclick,node);
}], }],
]) ],true);
'step 1' 'step 1'
var choice=result.links[0],mark=`jxlianpo_mark_${choice}`; var choice=result.links[0],mark=`jxlianpo_mark_${choice}`;
player.when({global:'roundStart'}) player.when({global:'roundStart'})
@ -192,13 +192,13 @@ game.import('character',function(lib,game,ui,get,ai,_status){
} }
}); });
player.addMark(mark,1,false); player.addMark(mark,1,false);
var videoId=lib.status.videoId++; event.videoId=lib.status.videoId++;
var createDialog=function(player,identity,id){ var createDialog=function(player,identity,id){
var dialog=ui.create.dialog(`${get.translation(player)}展示了“${get.translation(identity+'2')}”的身份牌<br>`,'forcebutton'); var dialog=ui.create.dialog(`${get.translation(player)}展示了“${get.translation(identity+'2')}”的身份牌<br>`,'forcebutton');
dialog.videoId=id; dialog.videoId=id;
ui.create.spinningIdentityCard(identity,dialog); ui.create.spinningIdentityCard(identity,dialog);
}; };
game.broadcastAll(createDialog,player,choice,videoId); game.broadcastAll(createDialog,player,choice,event.videoId);
var color=''; var color='';
if(choice=='zhong') color='#y'; if(choice=='zhong') color='#y';
else if(choice=='fan') color='#g'; else if(choice=='fan') color='#g';
@ -206,7 +206,7 @@ game.import('character',function(lib,game,ui,get,ai,_status){
game.log(player,'展示了',`${color}${get.translation(choice+'2')}`,'的身份牌'); game.log(player,'展示了',`${color}${get.translation(choice+'2')}`,'的身份牌');
game.delay(3); game.delay(3);
'step 2' 'step 2'
game.broadcastAll('closeDialog',videoId); game.broadcastAll('closeDialog',event.videoId);
} }
}, },
global:{ global:{

View File

@ -43336,8 +43336,8 @@
}, },
create:{ create:{
//创建身份牌实例 //创建身份牌实例
identityCard:function(identity,position,info,noclick){ identityCard:function(identity,position,noclick){
const card=ui.create.card(position,info,noclick); const card=ui.create.card(position,'noclick',noclick);
card.classList.add('button'); card.classList.add('button');
card._customintro=uiintro=>uiintro.add(`${get.translation(`${identity}${2}`)}的身份牌`); card._customintro=uiintro=>uiintro.add(`${get.translation(`${identity}${2}`)}的身份牌`);
const fileName=`image/card/identity_${identity}.jpg`; const fileName=`image/card/identity_${identity}.jpg`;