diff --git a/changelog.md b/changelog.md index 8f01bc3..0e7e3ad 100644 --- a/changelog.md +++ b/changelog.md @@ -1,6 +1,6 @@ # The Modding Tree changelog: -- Added a text-input component. +- Added 2 new input components, text-input and slider. - The red layer highlight will not appear before a layer is unlocked. # v2.π.1 - 4/7/21 diff --git a/docs/custom-tab-layouts.md b/docs/custom-tab-layouts.md index 539e2fb..cb19537 100644 --- a/docs/custom-tab-layouts.md +++ b/docs/custom-tab-layouts.md @@ -61,7 +61,10 @@ These are the existing components, but you can create more in [components.js](/j - text-input: A text input box. The argument is the name of the variable in player[layer] that the input is for, player[layer][argument] (Works with strings, numbers, and Decimals!) - +- slider: Lets the user input a value with a slider. The argument a 3-element array: [name, min, max]. + The name is the name of the variable in player[layer] that the input that the input is for, and min and max are the limits of the slider. + (Does not work for Decimal values) + The rest of the components are sub-components. They can be used just like other components, but are typically part of another component. diff --git a/js/Demo/demoLayers.js b/js/Demo/demoLayers.js index 91a4bff..36a2140 100644 --- a/js/Demo/demoLayers.js +++ b/js/Demo/demoLayers.js @@ -14,6 +14,7 @@ addLayer("c", { buyables: {}, // You don't actually have to initialize this one beep: false, thingy: "pointy", + otherThingy: 10, }}, color: "#4BDC13", requires: new Decimal(10), // Can be a function that takes requirement increases into account @@ -341,7 +342,9 @@ addLayer("c", { unlocked() {return (hasUpgrade("c", 13))}, content:[ ["raw-html", function() {return "