@@ -175,7 +175,7 @@ function ObjectMenu() {
175175 return < div key = { obj . tick } className = 'object-menu' >
176176 < Object first = { obj . data ?. first } />
177177 < div className = "space" > </ div >
178- < Other nearby = { obj . data ?. nearby } />
178+ < Other nearby = { obj . data ?. nearby } nearbyReferenceInfos = { obj . data ?. nearbyReferenceInfos } />
179179 </ div >
180180 }
181181}
@@ -188,7 +188,7 @@ function Scene({ scene }) {
188188 const children = Array ( scene . children . length )
189189 for ( let i = 0 ; i < scene . children . length ; i ++ ) {
190190 const ci = scene . children [ i ]
191- children [ i ] = < Link key = { i } index = { ci } name = { scene . referenceNames [ ci ] } />
191+ children [ i ] = < Link key = { i } index = { ci } obj = { scene } />
192192 }
193193
194194 return < >
@@ -240,12 +240,11 @@ function Object({ first }) {
240240const ti = parsedSchema . typeSchemaI
241241
242242function parentLink ( obj , parentI , i ) {
243- const rn = obj . referenceNames [ parentI ]
244243 if ( parentI < 0 ) {
245- return < span key = { i } > [< Link index = { parentI } name = { rn } /> ]</ span >
244+ return < span key = { i } > [< Link index = { parentI } obj = { obj } /> ]</ span >
246245 }
247246 else {
248- return < span key = { i } > < Link index = { parentI } name = { rn } /> </ span >
247+ return < span key = { i } > < Link index = { parentI } obj = { obj } /> </ span >
249248 }
250249}
251250
@@ -269,7 +268,7 @@ function Children({ obj }) {
269268 const children = Array ( obj . children . length )
270269 for ( let i = 0 ; i < obj . children . length ; i ++ ) {
271270 const ci = obj . children [ i ]
272- children [ i ] = < Link key = { i } index = { ci } name = { obj . referenceNames [ ci ] } />
271+ children [ i ] = < Link key = { i } index = { ci } obj = { obj } />
273272 }
274273
275274 return < details className = "component" >
@@ -282,7 +281,7 @@ function ReferencedBy({ obj }) {
282281 const arr = [ ]
283282 for ( let i = 0 ; i < obj . referencedBy . length ; i ++ ) {
284283 const ri = obj . referencedBy [ i ]
285- arr . push ( < Link key = { i } index = { ri } name = { obj . referenceNames [ ri ] } /> )
284+ arr . push ( < Link key = { i } index = { ri } obj = { obj } /> )
286285 }
287286 const empty = arr . length == 0
288287
@@ -396,16 +395,27 @@ ac(ti.CircleCollider2D, (c, o) => {
396395 </ Props >
397396} )
398397
399- function Link ( { index, name } ) {
400- const displayName = name != null ? name || '<No name>' : '<Unknown>'
398+ function Link ( { index, obj } ) {
399+ const referenceInfo = obj . referenceInfos [ index ] ?? [ ]
400+ const displayName = referenceInfo [ 0 ] != null ? referenceInfo [ 0 ] || '<No name>' : '<Unknown>'
401401
402402 if ( index != null ) {
403- function onClick ( ) { gotoOther ( index ) }
404- function reactIsDumb ( element ) {
405- // imagine saying that this is a security vulnerability
406- if ( element ) element . href = "javascript:void(0)"
403+ const url = new URL ( window . location . href )
404+ if ( referenceInfo [ 1 ] != null && referenceInfo [ 2 ] != null ) {
405+ url . searchParams . set ( 'posx' , referenceInfo [ 1 ] )
406+ url . searchParams . set ( 'posy' , referenceInfo [ 2 ] )
407407 }
408- return < a ref = { reactIsDumb } onClick = { onClick } > { displayName } </ a >
408+ else {
409+ url . searchParams . delete ( 'posx' )
410+ url . searchParams . delete ( 'posy' )
411+ }
412+ url . searchParams . set ( 'obji' , index )
413+
414+ function onClick ( ev ) {
415+ gotoOther ( index )
416+ ev . preventDefault ( )
417+ }
418+ return < a href = { url } onClick = { onClick } > { displayName } </ a >
409419 }
410420 else {
411421 return < span > { displayName } </ span >
@@ -416,15 +426,15 @@ ac(ti.ScarabPickup, (c, o) => {
416426 return < Props >
417427 < Prop >
418428 Container:
419- < Link index = { c . container } name = { o . referenceNames [ c . container ] } />
429+ < Link index = { c . container } obj = { o } />
420430 </ Prop >
421431 < Component comp = { c . _base } obj = { o } />
422432 </ Props >
423433} )
424434
425435ac ( ti . Transition , ( c , o ) => {
426436 return < Props >
427- < Prop > Destination:{ < Link index = { c . destI } name = { o . referenceNames [ c . destI ] } /> } </ Prop >
437+ < Prop > Destination:{ < Link index = { c . destI } obj = { o } /> } </ Prop >
428438 < Component comp = { c . _base } obj = { o } />
429439 </ Props >
430440} )
@@ -435,13 +445,13 @@ ac(ti.Unlocker, (c, o) => {
435445 const gc = Array ( c . group . length )
436446 for ( let i = 0 ; i < gc . length ; i ++ ) {
437447 const l = c . group [ i ]
438- gc [ i ] = < Link key = { i } index = { l } name = { o . referenceNames [ l ] } />
448+ gc [ i ] = < Link key = { i } index = { l } obj = { o } />
439449 }
440450
441451 return < Props >
442452 < Prop > KeyUse:{ keyUses [ c . keyUse ] ?? '<Unknown>' } </ Prop >
443- < Prop > Target:< Link index = { c . target } name = { o . referenceNames [ c . target ] } /> </ Prop >
444- < Prop > Target bis (?):< Link index = { c . targetBis } name = { o . referenceNames [ c . targetBis ] } /> </ Prop >
453+ < Prop > Target:< Link index = { c . target } obj = { o } /> </ Prop >
454+ < Prop > Target bis (?):< Link index = { c . targetBis } obj = { o } /> </ Prop >
445455 < Prop > Group:< Props > { gc } </ Props > </ Prop >
446456 < Component comp = { c . _base } obj = { o } />
447457 </ Props >
@@ -451,13 +461,13 @@ ac(ti.UnlockerTorch, (c, o) => {
451461 const gc = Array ( c . group . length )
452462 for ( let i = 0 ; i < gc . length ; i ++ ) {
453463 const l = c . group [ i ]
454- gc [ i ] = < Link key = { i } index = { l } name = { o . referenceNames [ l ] } />
464+ gc [ i ] = < Link key = { i } index = { l } obj = { o } />
455465 }
456466
457467 return < Props >
458- < Prop > Target:< Link index = { c . target } name = { o . referenceNames [ c . target ] } /> </ Prop >
459- < Prop > Target bis (?):< Link index = { c . targetBis } name = { o . referenceNames [ c . targetBis ] } /> </ Prop >
460- < Prop > Linked torch:< Link index = { c . linkedTorch } name = { o . referenceNames [ c . linkedTorch ] } /> </ Prop >
468+ < Prop > Target:< Link index = { c . target } obj = { o } /> </ Prop >
469+ < Prop > Target bis (?):< Link index = { c . targetBis } obj = { o } /> </ Prop >
470+ < Prop > Linked torch:< Link index = { c . linkedTorch } obj = { o } /> </ Prop >
461471 < Prop > Group:< Props > { gc } </ Props > </ Prop >
462472 < Component comp = { c . _base } obj = { o } />
463473 </ Props >
@@ -477,8 +487,8 @@ const objectiveNames = [
477487
478488ac ( ti . UnlockerTrigger , ( c , o ) => {
479489 return < Props >
480- < Prop > Target:< Link index = { c . target } name = { o . referenceNames [ c . target ] } /> </ Prop >
481- < Prop > Target bis (?):< Link index = { c . targetBis } name = { o . referenceNames [ c . targetBis ] } /> </ Prop >
490+ < Prop > Target:< Link index = { c . target } obj = { o } /> </ Prop >
491+ < Prop > Target bis (?):< Link index = { c . targetBis } obj = { o } /> </ Prop >
482492 < Prop > Prereqisute:{ objectiveNames [ c . objectiveCleared ] } </ Prop >
483493 < Component comp = { c . _base } obj = { o } />
484494 </ Props >
@@ -553,7 +563,7 @@ ac(ti.Buyable, (c, o) => {
553563 < Prop > For sale:{ bs ( c . isForSale ) } </ Prop >
554564 < Prop > Title:{ c . title } </ Prop >
555565 < Prop > Description:{ c . description } </ Prop >
556- < Prop > Owner:< Link index = { c . owner } name = { o . referenceNames [ c . owner ] } /> </ Prop >
566+ < Prop > Owner:< Link index = { c . owner } obj = { o } /> </ Prop >
557567 < Component comp = { c . _base } obj = { o } />
558568 </ Props >
559569} ) ;
@@ -597,7 +607,7 @@ ac(ti.Npc, (c, o) => {
597607
598608ac ( ti . Tunnel , ( c , o ) => {
599609 return < Props >
600- < Prop > Destination:< Link index = { c . destination } name = { o . referenceNames [ c . destination ] } /> </ Prop >
610+ < Prop > Destination:< Link index = { c . destination } obj = { o } /> </ Prop >
601611 < Component comp = { c . _base } obj = { o } />
602612 </ Props >
603613} )
@@ -692,15 +702,16 @@ function Prop({ children }) {
692702}
693703
694704
695- function Other ( { nearby } ) {
696- if ( nearby == null ) return
705+ function Other ( { nearby, nearbyReferenceInfos } ) {
706+ if ( nearby == null || nearbyReferenceInfos == null ) return
707+ const nearbyObj = { referenceInfos : nearbyReferenceInfos }
697708
698709 const nearbyC = [ ]
699710 for ( let i = 0 ; i < nearby . length ; i ++ ) {
700711 const it = nearby [ i ]
701712 nearbyC . push (
702713 < div key = { i } className = "hanging" >
703- < Link index = { it . index } name = { it . name } />
714+ < Link index = { it . index } obj = { nearbyObj } />
704715 < span > [away{ nbsp } { it . distance . toFixed ( 2 ) } ]</ span >
705716 </ div >
706717 )
0 commit comments