commit 2c673cf589f04e88f85dd14fe4690fa398126cb8
parent 5a3b616fea9769eab7bab12f3526b0e3a2f3b211
Author: Jacob R. Edwards <jacob@jacobedwards.org>
Date: Sat, 21 Sep 2024 16:09:57 -0700
Add default furniture graphic if there isn't a specific one
Diffstat:
2 files changed, 75 insertions(+), 0 deletions(-)
diff --git a/files/floorplans/floorplan/editor.js b/files/floorplans/floorplan/editor.js
@@ -636,6 +636,13 @@ export class FloorplanEditor {
.size(f.width, f.depth)
.attr({ id, preserveAspectRatio: "none" })
fm.element("title").words(furniture_name(f))
+ fm.on("error", function() {
+ if (this.attr("href") === "/furniture/any.svg") {
+ etc.error("Unable to load furniture assets")
+ throw new Error("Unable to load furniture assets")
+ }
+ this.load("/furniture/any.svg")
+ })
}
fm.cx(value.x).cy(value.y)
fm.transform({
diff --git a/files/furniture/any.svg b/files/furniture/any.svg
@@ -0,0 +1,68 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+ width="32in"
+ height="32in"
+ viewBox="0 0 812.80001 812.8"
+ version="1.1"
+ id="svg1"
+ inkscape:version="1.3.2 (091e20ef0f, 2023-11-25)"
+ sodipodi:docname="any.svg"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:svg="http://www.w3.org/2000/svg">
+ <sodipodi:namedview
+ id="namedview1"
+ pagecolor="#ffffff"
+ bordercolor="#000000"
+ borderopacity="0.25"
+ inkscape:showpageshadow="2"
+ inkscape:pageopacity="0.0"
+ inkscape:pagecheckerboard="0"
+ inkscape:deskcolor="#d1d1d1"
+ inkscape:document-units="mm"
+ inkscape:zoom="0.12850554"
+ inkscape:cx="1369.5907"
+ inkscape:cy="914.35745"
+ inkscape:window-width="1366"
+ inkscape:window-height="749"
+ inkscape:window-x="0"
+ inkscape:window-y="19"
+ inkscape:window-maximized="1"
+ inkscape:current-layer="layer1" />
+ <defs
+ id="defs1">
+ <inkscape:path-effect
+ effect="roughen"
+ id="path-effect1"
+ is_visible="true"
+ lpeversion="1.2"
+ global_randomize="0.2;1"
+ displace_x="10;1"
+ displace_y="10;1"
+ method="size"
+ max_segment_size="15.748"
+ segments="2"
+ handles="along"
+ shift_nodes="true"
+ fixed_displacement="false"
+ spray_tool_friendly="false" />
+ </defs>
+ <g
+ inkscape:label="Layer 1"
+ inkscape:groupmode="layer"
+ id="layer1">
+ <path
+ style="fill:none;fill-opacity:0;stroke:#000004;stroke-width:.25in;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:0.999944"
+ id="rect1"
+ width="787.40002"
+ height="787.40002"
+ x="11.481864"
+ y="13.211983"
+ inkscape:path-effect="#path-effect1"
+ sodipodi:type="rect"
+ d="m 11.436544,12.924301 15.286565,0.002 16.245638,0.12353 14.68502,-0.221094 15.453666,-0.146563 15.560157,-9.69e-4 15.6131,0.102779 15.08307,-0.301945 15.94229,0.139632 15.13148,0.01509 15.60257,0.105198 15.29607,0.01951 15.44544,0.01445 15.18904,-0.605036 15.47863,-0.339036 15.90512,0.0522 15.17517,0.05261 15.44611,0.05356 15.46664,0.07024 16.28252,0.08268 14.43482,-0.680169 15.62345,0.09296 15.39737,0.08379 15.94022,0.271661 14.89402,-0.03079 15.45001,0.006 15.37522,-0.09781 15.39583,-0.09611 15.50461,-0.304777 15.42773,0.01034 15.48073,0.0613 15.35008,-0.43421 16.12851,0.291185 14.99458,0.209824 15.55381,0.276132 15.73521,0.140503 14.68757,-0.257178 15.8373,0.199218 15.07117,-0.651149 15.68153,0.209585 15.77974,0.159342 14.88996,-0.03216 15.85967,0.355868 15.05843,0.02376 15.50399,0.118468 15.24476,-0.473111 15.53351,0.0012 15.40513,-0.199258 15.56738,0.06248 15.47538,-0.181288 15.48237,0.61475 15.41391,1.337059 0.82885,15.607954 0.32106,15.333599 -0.11512,14.452664 -0.0458,16.329305 0.1651,15.61866 -0.0542,15.260718 0.403,15.59808 -0.0271,15.31673 0.42041,15.53952 -0.0639,15.31361 -0.19771,15.21185 0.20725,15.80442 0.0266,15.3891 0.10696,15.49904 0.20262,15.50272 0.48271,15.43467 -0.25548,14.75796 -0.015,15.98962 -0.21474,15.12856 0.50776,15.78453 0.47534,15.58259 -0.10454,14.89683 -0.16777,15.68613 0.22709,15.54305 -0.15422,15.33975 -0.13845,14.79324 -0.0841,16.18016 0.0736,15.51527 -0.18867,15.10811 -0.22531,15.48235 0.46054,15.85144 -0.21369,15.07905 -0.24134,15.44803 -0.14151,15.55456 -0.10733,15.44578 0.0428,15.46482 -0.35581,14.93377 -0.14911,15.63386 0.46341,15.92389 -0.208,14.57182 -0.19546,16.00585 -0.18073,15.5337 0.40721,15.67721 -0.33139,15.10651 0.19112,15.76881 -0.36469,15.15336 -0.38492,14.68367 -0.48765,15.93749 0.44831,15.80816 -0.12526,15.53671 -0.84509,15.33758 -15.25052,0.0734 -15.52463,0.0897 -15.52618,0.0163 -14.93433,0.12377 -15.46469,0.13197 -15.37768,-0.002 -15.21448,0.0977 -16.02814,0.14433 -15.5244,0.0788 -15.60969,-0.0649 -15.45898,-0.18135 -15.13633,0.16614 -15.61621,0.0346 -15.66765,-0.47388 -15.30366,-0.0567 -15.42871,-0.02 -15.55484,-0.27578 -15.31959,0.001 -15.37348,0.0515 -15.6018,-0.10498 -15.16904,0.1372 -15.43265,0.14929 -15.29681,0.20687 -15.77817,-0.0193 -14.68192,0.0803 -16.08073,0.0683 -15.63174,-0.11302 -15.38582,-0.0394 -15.42601,-0.0238 -15.36293,0.05 -15.54167,-0.061 -15.44113,-0.14194 -15.5384,-0.36606 -15.28903,0.02 -15.49803,-0.0221 -15.497,-0.20185 -15.41143,-0.0348 -14.80513,0.11351 -16.05086,-0.0984 -15.10392,0.24596 -15.94379,-0.40077 -14.58986,0.2864 -16.07301,0.0394 -15.46602,0.0264 -15.39897,0.0358 -15.486919,0.0185 -15.338231,0.11529 -15.523703,0.0211 -15.476898,-0.96433 -15.429973,0.48986 -15.598441,0.23806 0.09709,-15.35414 0.302547,-15.35526 -0.06797,-15.66261 -0.05738,-15.55272 -0.0556,-15.56367 -0.126885,-15.28452 0.342008,-15.19077 0.03895,-15.49578 0.155704,-15.32242 0.635572,-15.40202 -0.15875,-15.78721 -0.03761,-15.27254 0.123586,-15.37292 0.226975,-15.37801 0.698561,-15.47329 0.439331,-15.28537 0.155712,-15.50242 0.362987,-15.36264 -0.236198,-15.83641 0.367633,-15.19486 -0.292234,-15.94269 -0.227085,-15.1831 0.03819,-15.22997 0.409419,-15.39489 -0.148752,-15.55902 -0.04228,-15.29855 -0.301047,-16.21406 -0.10409,-14.71672 0.03031,-15.31314 0.01628,-15.44496 -0.246533,-15.71163 -0.03437,-15.20066 -0.124608,-15.50749 0.09857,-15.28285 0.247186,-15.56794 -0.310234,-15.79645 -0.06912,-15.03699 0.07838,-15.31187 0.01562,-15.57861 0.250057,-15.23537 -0.252689,-15.79651 -0.229435,-15.57228 -0.214709,-15.6104 -0.232115,-15.01741 0.01252,-15.30843 L 12.75922,90.426798 12.477532,74.279534 12.378914,59.58179 12.075068,44.054765 11.567821,28.163359 Z" />
+ </g>
+</svg>