跟随对话框

This commit is contained in:
dljgs1 2019-04-17 19:54:22 +08:00
parent 4d35d7b35e
commit 69b52acb46

View File

@ -403,9 +403,9 @@ ui.prototype._getPosition = function (content) {
py = core.status.event.data.y;
}
content = content.replace("\b", "\\b")
.replace(/\\b\[(up|center|down|hero|null)(,(hero|null|\d+,\d+))?]/g, function (s0, s1, s2, s3) {
.replace(/\\b\[(up|center|down|hero|null)(,(hero|null|\d+,\d+|\d+))?]/g, function (s0, s1, s2, s3) {
pos = s1;
if (s3 == 'hero' || s1=='hero') {
if (s3 == 'hero' || s1=='hero' && !s3) {
px = core.status.hero.loc.x;
py = core.status.hero.loc.y;
}
@ -414,8 +414,14 @@ ui.prototype._getPosition = function (content) {
}
else if (s3) {
var str = s3.split(',');
px = parseInt(str[0]);
py = parseInt(str[1]);
if(str.length==1){
var follower = (core.status.hero.followers||{})[parseInt(str[0])-1]||{};
px = follower.x || null;
py = follower.y || null;
}else{
px = parseInt(str[0]);
py = parseInt(str[1]);
}
}
if(pos=='hero' || pos=='null'){
pos = py==null?'center':(py>=core.__HALF_SIZE__? 'up':'down');