Skip to content

Commit a8d0b13

Browse files
committed
BHAV to diagram: show node versions, enshorten type names to save space
1 parent 1f6870d commit a8d0b13

File tree

1 file changed

+16
-16
lines changed

1 file changed

+16
-16
lines changed

bhav-to-diagram.html

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -288,26 +288,26 @@
288288
}
289289

290290
const tutorialSimPeBhav = `
291-
0000 : 2001 : 00 : 0001 : FFFC : 00000000000000000000000000000000
291+
0000 : 2001 : 01 : 0001 : FFFC : 00000000000000000000000000000000
292292
[semi 0x2001] Open in SimPe a package file with the BHAV (you'd like to see as a diagram)
293293
294-
0001 : 2002 : 00 : 0002 : FFFC : 00000000000000000000000000000000
294+
0001 : 2002 : 01 : 0002 : FFFC : 00000000000000000000000000000000
295295
[semi 0x2002] Open the BHAV resource (from the Resource List,
296296
in the Plugin View)
297297
298298
0002 : 0002 : 00 : 0004 : 0003 : 00000000000000000000000000000000
299299
[prim 0x0002] Expression (Is the 'Special buttons' checkbox checked? (It's on the bottom right))
300300
301-
0003 : 2003 : 00 : 0004 : FFFC : 00000000000000000000000000000000
301+
0003 : 2003 : 01 : 0004 : FFFC : 00000000000000000000000000000000
302302
[semi 0x2003] Check the 'Special buttons' checkbox ()
303303
304-
0004 : 2004 : 00 : 0005 : FFFC : 00000000000000000000000000000000
304+
0004 : 2004 : 01 : 0005 : FFFC : 00000000000000000000000000000000
305305
[semi 0x2004] Click the 'Copy' button ()
306306
307-
0005 : 1004 : 00 : 0006 : FFFC : 00000000000000000000000000000000
307+
0005 : 1004 : 01 : 0006 : FFFC : 00000000000000000000000000000000
308308
[private 0x1004] Paste the copied BHAV in the tool (in the first textarea, on the left side)
309309
310-
0006 : 0118 : 00 : 0007 : FFFC : 00000000000000000000000000000000
310+
0006 : 0118 : 01 : 0007 : FFFC : 00000000000000000000000000000000
311311
[global 0x0118] Idle (1 second)
312312
313313
0007 : 0002 : 00 : 0006 : 0008 : 00000000000000000000000000000000
@@ -319,7 +319,7 @@
319319
0009 : 0002 : 00 : FFFD : 000A : 00000000000000000000000000000000
320320
[prim 0x0002] Expression (Does the diagram look correct?)
321321
322-
000A : 2008 : 00 : FFFE : FFFC : 00000000000000000000000000000000
322+
000A : 2008 : 01 : FFFE : FFFC : 00000000000000000000000000000000
323323
[semi 0x2008] Report a bug on GitHub or Discord (Attach the BHAV code you've pasted into the tool. Explain what's wrong with the diagram)
324324
325325
000B : 0002 : 00 : 000C : 000D : 00000000000000000000000000000000
@@ -328,19 +328,19 @@
328328
000C : 0002 : 00 : 0001 : 000D : 00000000000000000000000000000000
329329
[prim 0x0002] Expression (Does the error description in it imply that it's your fault and you think it might be true?)
330330
331-
000D : 2008 : 00 : FFFE : FFFC : 00000000000000000000000000000000
331+
000D : 2008 : 01 : FFFE : FFFC : 00000000000000000000000000000000
332332
[semi 0x2008] Report a bug on GitHub or Discord (Attach the BHAV code you've pasted into the tool)
333333
334334
000E : 0002 : 00 : FFFD : 000F : 00000000000000000000000000000000
335335
[prim 0x0002] Expression (Do you know what the colors of lines with arrows mean?)
336336
337-
000F : 1003 : 00 : 0010 : 0010 : 00000000000000000000000000000000
337+
000F : 1003 : 01 : 0010 : 0010 : 00000000000000000000000000000000
338338
[private 0x1003] See explanation (A <b>green</b> line shows what happens after a block returns <i>true</i>)
339339
340-
0010 : 1003 : 00 : 0011 : 0011 : 00000000000000000000000000000000
340+
0010 : 1003 : 01 : 0011 : 0011 : 00000000000000000000000000000000
341341
[private 0x1003] See explanation (A <b>red</b> line shows what happens after a block returns <i>false</i>)
342342
343-
0011 : 1003 : 00 : FFFD : FFFD : 00000000000000000000000000000000
343+
0011 : 1003 : 01 : FFFD : FFFD : 00000000000000000000000000000000
344344
[private 0x1003] See explanation (A <b>grey</b> line shows what happens after a block returns either <i>true</i> or <i>false</i>)`
345345

346346
function setTheme() {
@@ -365,10 +365,10 @@
365365
this.description = this.description ?? '';
366366
this.type = this.type ?? (
367367
this.instance < 0x0000 ? 'unknown'
368-
: this.instance < 0x0100 ? 'primitive'
368+
: this.instance < 0x0100 ? 'prim'
369369
: this.instance < 0x1000 ? 'global'
370370
: this.instance < 0x2000 ? 'private'
371-
: this.instance < 0x10000 ? 'semiglobal'
371+
: this.instance < 0x10000 ? 'semi'
372372
: 'unknown');
373373
this.outgoingTransitions = this.#prepareRawOutgoingTransitions();
374374
delete this.trueBlockId;
@@ -753,9 +753,9 @@
753753
return '';
754754

755755
let code = `graph ${flowDirection}\r\n`
756-
+ '\r\nclassDef primitive fill:#1885,stroke:#188;'
756+
+ '\r\nclassDef prim fill:#1885,stroke:#188;'
757757
+ '\r\nclassDef global fill:#3805,stroke:#380;'
758-
+ '\r\nclassDef semiglobal fill:#8705,stroke:#870;'
758+
+ '\r\nclassDef semi fill:#8705,stroke:#870;'
759759
+ '\r\nclassDef private fill:#b505,stroke:#b50;'
760760
+ '\r\nclassDef specialBlock font-size:1.4em;'
761761
+ '\r\nclassDef start fill:#36f5,stroke:#36f;'
@@ -844,7 +844,7 @@
844844

845845
let instanceEmoji = this.#instanceEmojiMap[block.instance] ?? '';
846846

847-
return `${indent}${block.id}("${toHex(block.id)} [${block.type} ${toHex(block.instance, 4)}]`
847+
return `${indent}${block.id}("${toHex(block.id)} [${block.type} ${toHex(block.instance, 4)} v.${block.version}]`
848848
+ `<br>${instanceEmoji} <b>${block.name}<\/b>`
849849
+ `<br>${block.description}")`
850850
+ `\r\n${indent}class ${block.id} ${block.type}`

0 commit comments

Comments
 (0)