浏览代码

Show weight ratios

master
Fen Dweller 3 年前
父节点
当前提交
cd7570bc03
共有 1 个文件被更改,包括 9 次插入0 次删除
  1. +9
    -0
      macrovision.js

+ 9
- 0
macrovision.js 查看文件

@@ -681,6 +681,15 @@ function updateInfo() {

text += prevSelectedEntity.name + " looks " + math.format(apparentHeight, { precision: 3}) + " tall to " + selectedEntity.name + "\n";

if (selectedEntity.currentView.weight && prevSelectedEntity.currentView.weight) {
const ratio = math.divide(selectedEntity.currentView.weight, prevSelectedEntity.currentView.weight)

if (ratio > 1) {
text += selectedEntity.name + " is " + math.format(ratio, {precision: 2}) + " times heavier than " + prevSelectedEntity.name + "\n";
} else {
text += selectedEntity.name + " is " + math.format(1/ratio, {precision: 2}) + " times lighter than " + prevSelectedEntity.name + "\n";
}
}
const capacity = selectedEntity.currentView.preyCapacity ?? selectedEntity.currentView.capacity ?? selectedEntity.currentView.volume

if (capacity && prevSelectedEntity.currentView.weight) {


正在加载...
取消
保存