Don't capitalize all tree nodes

This commit is contained in:
thepaperpilot 2023-04-23 16:55:45 -05:00
parent 4980074d26
commit 7b59fcfc38
2 changed files with 2 additions and 10 deletions

View file

@ -16,7 +16,7 @@ import player from "game/player";
import settings from "game/settings"; import settings from "game/settings";
import type { DecimalSource } from "util/bignum"; import type { DecimalSource } from "util/bignum";
import Decimal, { format, formatSmall, formatTime } from "util/bignum"; import Decimal, { format, formatSmall, formatTime } from "util/bignum";
import type { WithRequired } from "util/common"; import { WithRequired, camelToTitle } from "util/common";
import type { import type {
Computable, Computable,
GetComputableType, GetComputableType,
@ -177,11 +177,6 @@ export interface LayerTreeNodeOptions extends TreeNodeOptions {
layerID: string; layerID: string;
/** The color to display this tree node as */ /** The color to display this tree node as */
color: Computable<string>; // marking as required color: Computable<string>; // marking as required
/**
* The content to display in the tree node.
* Defaults to the layer's ID
*/
display?: Computable<CoercableComponent>;
/** Whether or not to append the layer to the tabs list. /** Whether or not to append the layer to the tabs list.
* If set to false, then the tree node will instead always remove all tabs to its right and then add the layer tab. * If set to false, then the tree node will instead always remove all tabs to its right and then add the layer tab.
* Defaults to true. * Defaults to true.
@ -214,12 +209,10 @@ export function createLayerTreeNode<T extends LayerTreeNodeOptions>(
): LayerTreeNode<T> { ): LayerTreeNode<T> {
return createTreeNode(feature => { return createTreeNode(feature => {
const options = optionsFunc.call(feature, feature); const options = optionsFunc.call(feature, feature);
processComputable(options as T, "display"); setDefault(options, "display", camelToTitle(options.layerID));
setDefault(options, "display", options.layerID);
processComputable(options as T, "append"); processComputable(options as T, "append");
return { return {
...options, ...options,
display: options.display,
onClick: unref((options as unknown as GenericLayerTreeNode).append) onClick: unref((options as unknown as GenericLayerTreeNode).append)
? function () { ? function () {
if (player.tabs.includes(options.layerID)) { if (player.tabs.includes(options.layerID)) {

View file

@ -113,7 +113,6 @@ export default defineComponent({
color: rgba(0, 0, 0, 0.5); color: rgba(0, 0, 0, 0.5);
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.25); text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.25);
box-shadow: -4px -4px 4px rgba(0, 0, 0, 0.25) inset, 0px 0px 20px var(--background); box-shadow: -4px -4px 4px rgba(0, 0, 0, 0.25) inset, 0px 0px 20px var(--background);
text-transform: capitalize;
display: flex; display: flex;
} }