mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2024-11-21 16:13:55 +00:00
Made text inputs never give NaNs
This commit is contained in:
parent
bb0926c17d
commit
23cbfc7a9e
4 changed files with 11 additions and 5 deletions
|
@ -1,5 +1,8 @@
|
|||
# The Modding Tree changelog:
|
||||
|
||||
### v2.5.9.1 - 5/18/21
|
||||
- Made text inputs never give NaNs.
|
||||
|
||||
### v2.5.9 - 5/18/21
|
||||
- Fixed issue when using text inputs for Numbers.
|
||||
- Added particle color feature.
|
||||
|
|
|
@ -11,7 +11,7 @@ let modInfo = {
|
|||
|
||||
// Set your version in num and name
|
||||
let VERSION = {
|
||||
num: "2.5.9",
|
||||
num: "2.5.9.1",
|
||||
name: "Dreams Really Do Come True",
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ var scrolled = false;
|
|||
|
||||
// Don't change this
|
||||
const TMT_VERSION = {
|
||||
tmtNum: "2.5.9",
|
||||
tmtNum: "2.5.9.1",
|
||||
tmtName: "Dreams Really Do Come True"
|
||||
}
|
||||
|
||||
|
|
|
@ -334,10 +334,13 @@ document.title = modInfo.name
|
|||
|
||||
// Converts a string value to whatever it's supposed to be
|
||||
function toValue(value, oldValue) {
|
||||
if (oldValue instanceof Decimal)
|
||||
return new Decimal (value)
|
||||
if (oldValue instanceof Decimal) {
|
||||
value = new Decimal (value)
|
||||
if (value.eq(decimalNaN)) return decimalZero
|
||||
return value
|
||||
}
|
||||
if (!isNaN(oldValue))
|
||||
return parseFloat(value)
|
||||
return parseFloat(value) || 0
|
||||
return value
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue