diff --git a/macrovision.html b/macrovision.html index 2c8b012e..a0da19a3 100644 --- a/macrovision.html +++ b/macrovision.html @@ -64,6 +64,8 @@
+ diff --git a/macrovision.js b/macrovision.js index e62e18e1..8b870a45 100644 --- a/macrovision.js +++ b/macrovision.js @@ -189,6 +189,7 @@ function makeEntity(name, author, views) { author: author, scale: 1, views: views, + defaults: [], init: function () { Object.entries(this.views).forEach(([viewKey, view]) => { view.parent = this; @@ -311,6 +312,7 @@ function updateWorldOptions(entity, view) { heightInput.value = math.round(converted, 3); } + function configEntityOptions(entity, view) { const holder = document.querySelector("#options-entity"); @@ -366,6 +368,24 @@ function configEntityOptions(entity, view) { holder.appendChild(nameLabel); holder.appendChild(nameRow); + + const defaultHolder = document.querySelector("#options-entity-defaults"); + + defaultHolder.innerHTML = ""; + + entity.defaults.forEach(defaultInfo => { + const button = document.createElement("button"); + button.classList.add("options-button"); + + button.innerText = defaultInfo.name; + + button.addEventListener("click", e => { + entity.views[entity.defaultView].height = defaultInfo.height; + updateSizes(); + }); + + defaultHolder.appendChild(button); + }); } function updateEntityOptions(entity, view) { diff --git a/media/LICENSES.md b/media/LICENSES.md index 67620ed3..0970c227 100644 --- a/media/LICENSES.md +++ b/media/LICENSES.md @@ -161,11 +161,21 @@ https://www.furaffinity.net/view/22413650/ * peek.svg +## Shingo + +**https://www.furaffinity.net/user/feve** + +https://www.furaffinity.net/view/32499316/ + +* front.svg + # Objects **Self-created** * soda-can.svg +* sewing-pin.svg +* pin-head.svg # Vehicles diff --git a/media/characters/shingo/front.svg b/media/characters/shingo/front.svg new file mode 100644 index 00000000..b5de6db8 --- /dev/null +++ b/media/characters/shingo/front.svg @@ -0,0 +1,112 @@ + + + diff --git a/presets/characters.js b/presets/characters.js index 06c8f27c..efd1a210 100644 --- a/presets/characters.js +++ b/presets/characters.js @@ -735,6 +735,49 @@ function makeKurrikage() { return entity; } +function makeShingo() { + const views = { + front: { + attributes: { + height: { + name: "Height", + power: 1, + type: "length", + base: math.unit(6, "feet") + }, + weight: { + name: "Weight", + power: 3, + type: "mass", + base: math.unit(75, "kg") + } + }, + image: { + source: "./media/characters/shingo/front.svg" + }, + name: "Front" + } + }; + + const entity = makeEntity("Shingo", "Threes", views); + + entity.defaults.push({ + name: "Micro", + height: math.unit(4, "inches") + }); + + entity.defaults.push({ + name: "Normal", + height: math.unit(6, "feet") + }); + + entity.defaults.push({ + name: "Macro", + height: math.unit(108, "feet") + }); + return entity; +} + function makeMan() { const views = { body: { @@ -820,6 +863,10 @@ function makeCharacters() { name: "Kurrikage", constructor: makeKurrikage }); + results.push({ + name: "Shingo", + constructor: makeShingo + }); results.push({ name: "Normal man", constructor: makeMan