Merge pull request #350 from dljgs1/v2.0

V2.0
This commit is contained in:
Zhang Chen 2019-04-15 21:30:12 +08:00 committed by GitHub
commit 2b57cbb49a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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|\d+,\d+))?]/g, function (s0, s1, s2, s3) {
.replace(/\\b\[(up|center|down|hero|null)(,(hero|null|\d+,\d+))?]/g, function (s0, s1, s2, s3) {
pos = s1;
if (s3 == 'hero') {
if (s3 == 'hero' || s1=='hero') {
px = core.status.hero.loc.x;
py = core.status.hero.loc.y;
}
@ -417,6 +417,9 @@ ui.prototype._getPosition = function (content) {
px = parseInt(str[0]);
py = parseInt(str[1]);
}
if(pos=='hero' || pos=='null'){
pos = py==null?'center':(py>=core.__HALF_SIZE__? 'up':'down');
}
return "";
});
return {content: content, position: pos, px: px, py: py};