Skip to content

Commit

Permalink
fix positioning
Browse files Browse the repository at this point in the history
  • Loading branch information
Student Main committed Dec 11, 2018
1 parent 51e0213 commit 8deea2d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/runtime/character.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,10 @@ export default class Character {

dress: {
[dressname: string]: {
[subvariant: string]: string[]
[subvariant: string]: {
name: string,
prefix: string
}
}
} = {};
face: {
Expand Down Expand Up @@ -96,7 +99,7 @@ export default class Character {
if (this.dress[dname] === undefined) {
this.dress[dname] = {};
}
this.dress[dname][dno] = [dvstr, pfx];
this.dress[dname][dno] = { name: dvstr, prefix: pfx };
});
f.filter(l => l.length === 4).forEach(l => {
const [, fno, , fvstr] = l;
Expand Down Expand Up @@ -281,7 +284,8 @@ export default class Character {
if (!this.dressOpt) this.dressOpt = Object.keys(this.dress)[0];
const i = this.dress[this.dressOpt][mainId];
if (!i) debugger;
const [mainImg, pfx] = i;
const mainImg = i.name;
const pfx = i.prefix;
const varImg = this.face[pfx][varId];
if (varImg === undefined) return;
// 35 50 75 100 120 140 bgexpand original
Expand Down Expand Up @@ -315,4 +319,4 @@ export default class Character {
// emmmm, not now...
return ctl;
}
}
}
2 changes: 1 addition & 1 deletion src/ui/layer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ class YZLayer {
let _width;
let _height;
// need get size
if (!size) [_width, _height] = await this.sublayer[name].GetSize();
if (!size || !size.x || !size.y) [_width, _height] = await this.sublayer[name].GetSize();
else {
size.x = _width;
size.y = _height;
Expand Down

0 comments on commit 8deea2d

Please sign in to comment.