Hud api
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
// bworld:curio_modifiers component change the wearer's attributes, like curios' attribute modifiers, and ones with
|
||||
// bworld:curio_unhurt_effect give them an effect once they've gone a while without being hurt
|
||||
import type { AttributeModifier, Container, ItemStack, Player, ServerContext, TagApi } from "cubi/server";
|
||||
import { title } from "./shared.ts";
|
||||
|
||||
// where the left column of slots goes, from the inventory screen's left edge. the panel around them ends just left of it
|
||||
const COLUMNS_X = -45;
|
||||
@@ -169,11 +170,6 @@ function describe({ attribute, amount, operation }: WornModifier): string {
|
||||
return `${sign}${value} ${name}`;
|
||||
}
|
||||
|
||||
// "bworld:regeneration" is "Regeneration", like minecraft's effect names
|
||||
function title(id: string): string {
|
||||
return id.split(":").at(-1)!.split("_").map((word) => word[0].toUpperCase() + word.slice(1)).join(" ");
|
||||
}
|
||||
|
||||
function roman(level: number): string {
|
||||
return ["I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X"][level - 1] ?? `${level}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user