This commit is contained in:
libccy 2017-04-19 12:33:31 +08:00
parent 3f3c3cc827
commit 053a61a3de
1 changed files with 79 additions and 67 deletions

View File

@ -19801,6 +19801,9 @@
ui.connectClients.info=clients; ui.connectClients.info=clients;
ui.connectClientsCount.innerHTML=clients.length; ui.connectClientsCount.innerHTML=clients.length;
} }
if(_status.connectClientsCallback){
_status.connectClientsCallback();
}
}, },
updateevents:function(events){ updateevents:function(events){
if(events&&ui.connectEvents){ if(events&&ui.connectEvents){
@ -35612,12 +35615,19 @@
uiintro.style.bottom='75px'; uiintro.style.bottom='75px';
uiintro.refresh=function(){ uiintro.refresh=function(){
if(button.focused) return;
uiintro.content.innerHTML=''; uiintro.content.innerHTML='';
uiintro.addText('创建约战'); uiintro.addText('创建约战');
button.textnode=uiintro.content.lastChild.lastChild; button.textnode=uiintro.content.lastChild.lastChild;
uiintro.add('<input type="text" style="width:calc(100% - 10px);resize: none;border: none;border-radius: 2px;box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px 1px;margin-top: -2px;margin-bottom: 2px;">'); uiintro.add('<input type="text" style="width:calc(100% - 10px);resize: none;border: none;border-radius: 2px;box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px 1px;margin-top: -2px;margin-bottom: 2px;">');
uiintro.content.lastChild.style.paddingTop=0; uiintro.content.lastChild.style.paddingTop=0;
button.input=uiintro.content.lastChild.lastChild; button.input=uiintro.content.lastChild.lastChild;
button.input.onfocus=function(){
button.focused=true;
}
button.input.onblur=function(){
delete button.focused;
}
if(button.interval){ if(button.interval){
button.input.disabled=true; button.input.disabled=true;
button.input.style.opacity=0.6; button.input.style.opacity=0.6;
@ -35762,7 +35772,11 @@
} }
uiintro.refresh(); uiintro.refresh();
ui.window.appendChild(uiintro); ui.window.appendChild(uiintro);
_status.connectEventsCallback=uiintro.refresh; _status.connectEventsCallback=function(){
if(uiintro.parentNode==ui.window){
uiintro.refresh();
}
};
} }
}, },
connectClients:function(){ connectClients:function(){
@ -35795,84 +35809,82 @@
uiintro.style.top='auto'; uiintro.style.top='auto';
uiintro.style.bottom='75px'; uiintro.style.bottom='75px';
uiintro.addText('发状态'); uiintro.refresh=function(){
button.textnode=uiintro.content.lastChild.lastChild; if(button.focused) return;
uiintro.add('<input type="text" style="width:calc(100% - 10px);resize: none;border: none;border-radius: 2px;box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px 1px;margin-top: -2px;margin-bottom: 2px;">'); uiintro.content.innerHTML='';
uiintro.content.lastChild.style.paddingTop=0; uiintro.addText('发状态');
button.input=uiintro.content.lastChild.lastChild; button.textnode=uiintro.content.lastChild.lastChild;
if(button.interval){ uiintro.add('<input type="text" style="width:calc(100% - 10px);resize: none;border: none;border-radius: 2px;box-shadow: rgba(0, 0, 0, 0.2) 0px 0px 0px 1px;margin-top: -2px;margin-bottom: 2px;">');
button.input.disabled=true; uiintro.content.lastChild.style.paddingTop=0;
button.input.style.opacity=0.6; button.input=uiintro.content.lastChild.lastChild;
if(button.intervaltext){ button.input.onfocus=function(){
button.textnode.innerHTML=button.intervaltext; button.focused=true;
} }
} button.input.onblur=function(){
button.input.onkeydown=function(e){ delete button.focused;
if(e.keyCode==13&&!this.disabled){ }
game.send('server','status',this.value); if(button.interval){
this.disabled=true;
this.style.opacity=0.6;
button.textnode.innerHTML='发状态(10)';
var num=10;
var that=this;
button.input.disabled=true; button.input.disabled=true;
button.input.style.opacity=0.6; button.input.style.opacity=0.6;
for(var i=0;i<uiintro.content.childNodes.length;i++){ if(button.intervaltext){
if(uiintro.content.childNodes[i].isme){ button.textnode.innerHTML=button.intervaltext;
var menode=uiintro.content.childNodes[i]; }
if(!this.value){ }
if(menode.nextSibling&&menode.nextSibling.classList.contains('videotext')){ button.input.onkeydown=function(e){
menode.nextSibling.remove(); if(e.keyCode==13&&!this.disabled){
} game.send('server','status',this.value);
this.disabled=true;
this.style.opacity=0.6;
button.textnode.innerHTML='发状态(10)';
button.intervaltext=button.textnode.innerHTML;
var num=10;
var that=this;
button.input.disabled=true;
button.input.style.opacity=0.6;
this.value='';
button.interval=setInterval(function(){
num--;
if(num>0){
button.textnode.innerHTML='发状态('+num+')';
button.intervaltext=button.textnode.innerHTML;
} }
else{ else{
if(menode.nextSibling&&menode.nextSibling.classList.contains('videotext')){ button.textnode.innerHTML='发状态';
menode.nextSibling.innerHTML=this.value; button.input.disabled=false;
} button.input.style.opacity='';
else{ clearInterval(button.interval);
var newnode=ui.create.div('.menubutton.videotext',this.value); delete button.interval;
uiintro.content.insertBefore(newnode,menode.nextSibling); delete button.intervaltext;
}
} }
} },1000);
} }
this.value='';
button.interval=setInterval(function(){
num--;
if(num>0){
button.textnode.innerHTML='发状态('+num+')';
button.intervaltext=button.textnode.innerHTML;
}
else{
button.textnode.innerHTML='发状态';
button.input.disabled=false;
button.input.style.opacity='';
clearInterval(button.interval);
delete button.interval;
delete button.intervaltext;
}
},1000);
} }
}
for(var i=0;i<this.info.length;i++){ for(var i=0;i<button.info.length;i++){
var node=ui.create.div('.menubutton.videonode.pointerdiv',uiintro.content); var node=ui.create.div('.menubutton.videonode.pointerdiv',uiintro.content);
ui.create.div('.menubutton.videoavatar',node).setBackground(this.info[i][1]||'caocao','character'); ui.create.div('.menubutton.videoavatar',node).setBackground(button.info[i][1]||'caocao','character');
if(this.info[i][4]==game.wsid){ if(button.info[i][4]==game.wsid){
ui.create.div('.name','<span class="thundertext thunderauto">'+(this.info[i][0]||'无名玩家'),node);node.isme=true; ui.create.div('.name','<span class="thundertext thunderauto">'+(button.info[i][0]||'无名玩家'),node);node.isme=true;
}
else if(button.info[i][2]){
ui.create.div('.name',(button.info[i][0]||'无名玩家'),node);
}
else{
ui.create.div('.name','<span style="opacity:0.6">'+(button.info[i][0]||'无名玩家'),node);
}
if(button.info[i][3]){
ui.create.div('.menubutton.videotext',uiintro.content,button.info[i][3]);
}
} }
else if(this.info[i][2]){ };
ui.create.div('.name',(this.info[i][0]||'无名玩家'),node);
}
else{
ui.create.div('.name','<span style="opacity:0.6">'+(this.info[i][0]||'无名玩家'),node);
}
if(this.info[i][3]){
ui.create.div('.menubutton.videotext',uiintro.content,this.info[i][3]);
}
}
uiintro.refresh();
ui.window.appendChild(uiintro); ui.window.appendChild(uiintro);
_status.connectClientsCallback=function(){
if(uiintro.parentNode==ui.window){
uiintro.refresh();
}
};
} }
}, },
autoskin:function(){ autoskin:function(){