mirror of
https://github.com/Acamaeda/The-Modding-Tree.git
synced 2025-05-03 23:11:02 +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:
|
# The Modding Tree changelog:
|
||||||
|
|
||||||
|
### v2.5.9.1 - 5/18/21
|
||||||
|
- Made text inputs never give NaNs.
|
||||||
|
|
||||||
### v2.5.9 - 5/18/21
|
### v2.5.9 - 5/18/21
|
||||||
- Fixed issue when using text inputs for Numbers.
|
- Fixed issue when using text inputs for Numbers.
|
||||||
- Added particle color feature.
|
- Added particle color feature.
|
||||||
|
|
|
@ -11,7 +11,7 @@ let modInfo = {
|
||||||
|
|
||||||
// Set your version in num and name
|
// Set your version in num and name
|
||||||
let VERSION = {
|
let VERSION = {
|
||||||
num: "2.5.9",
|
num: "2.5.9.1",
|
||||||
name: "Dreams Really Do Come True",
|
name: "Dreams Really Do Come True",
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ var scrolled = false;
|
||||||
|
|
||||||
// Don't change this
|
// Don't change this
|
||||||
const TMT_VERSION = {
|
const TMT_VERSION = {
|
||||||
tmtNum: "2.5.9",
|
tmtNum: "2.5.9.1",
|
||||||
tmtName: "Dreams Really Do Come True"
|
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
|
// Converts a string value to whatever it's supposed to be
|
||||||
function toValue(value, oldValue) {
|
function toValue(value, oldValue) {
|
||||||
if (oldValue instanceof Decimal)
|
if (oldValue instanceof Decimal) {
|
||||||
return new Decimal (value)
|
value = new Decimal (value)
|
||||||
|
if (value.eq(decimalNaN)) return decimalZero
|
||||||
|
return value
|
||||||
|
}
|
||||||
if (!isNaN(oldValue))
|
if (!isNaN(oldValue))
|
||||||
return parseFloat(value)
|
return parseFloat(value) || 0
|
||||||
return value
|
return value
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue