mirror of
https://github.com/ZZZure/ZZZ-Plugin.git
synced 2025-12-16 13:17:32 +00:00
fix: 能量进度条满问题
This commit is contained in:
parent
1c65f10e24
commit
ac96925c70
3 changed files with 6 additions and 3 deletions
|
|
@ -52,6 +52,7 @@ export class EnergyProgress {
|
|||
constructor(max, current) {
|
||||
this.max = max;
|
||||
this.current = current;
|
||||
this.percent = parseInt((Number(current) / Number(max)) * 100);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -64,11 +65,10 @@ export class Energy {
|
|||
* @param {number} restore
|
||||
*/
|
||||
constructor(progress, restore) {
|
||||
this.progress = progress;
|
||||
this.progress = new EnergyProgress(progress.max, progress.current);
|
||||
this.restore = restore;
|
||||
const leftHM = converSecondsToHM(restore);
|
||||
this.progress.rest = `${leftHM[0]}小时${leftHM[1]}分钟`;
|
||||
this.percent = parseInt((progress.current / progress.max) * 100);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue