Oracles importation improved.
This commit is contained in:
parent
7c8c897d60
commit
67be117367
@ -4,4 +4,4 @@ asTiddler
|
|||||||
title: self name;
|
title: self name;
|
||||||
tags: 'Starforged';
|
tags: 'Starforged';
|
||||||
text: self introText, String cr, String cr, self optionsWikiTextTable;
|
text: self introText, String cr, String cr, self optionsWikiTextTable;
|
||||||
created: DateAndTime now asString.
|
created: Tiddler nowLocal.
|
@ -0,0 +1,4 @@
|
|||||||
|
accessing
|
||||||
|
optionColumnNames
|
||||||
|
self options ifEmpty: [ ^ nil ].
|
||||||
|
^ self options associations first value keys reversed
|
@ -8,5 +8,5 @@ optionsFromDictionary: aDictionary
|
|||||||
ifFalse: [
|
ifFalse: [
|
||||||
prevKey := (aDictionary at: i - 1) at: 'Chance'.
|
prevKey := (aDictionary at: i - 1) at: 'Chance'.
|
||||||
key := prevKey asInteger + 1 to: (opt at: 'Chance') asInteger ].
|
key := prevKey asInteger + 1 to: (opt at: 'Chance') asInteger ].
|
||||||
value := (opt at: 'Description') capitalized.
|
value := (opt copy removeKey: 'Chance'; yourself).
|
||||||
self options at: key put: value ]
|
self options at: key put: value ]
|
@ -0,0 +1,20 @@
|
|||||||
|
accessing
|
||||||
|
optionsWikiTextRow: value
|
||||||
|
| output |
|
||||||
|
value class = String ifTrue: [ ^ value , '|' ].
|
||||||
|
output := '' writeStream.
|
||||||
|
output
|
||||||
|
nextPutAll: (value at: 'Description'), ' |'.
|
||||||
|
value keys size > 1 ifTrue: [ | remaining cell |
|
||||||
|
remaining := value copy removeKey: 'Description'; yourself.
|
||||||
|
cell := remaining values.
|
||||||
|
cell class = Array ifTrue: [
|
||||||
|
cell first doWithIndex: [:each :i |
|
||||||
|
output nextPutAll: '[[', each asString,']] '.
|
||||||
|
(i % 2 = 1) ifTrue: [output nextPutAll: '; ' ]
|
||||||
|
]
|
||||||
|
].
|
||||||
|
output nextPutAll: '|'.
|
||||||
|
].
|
||||||
|
^ output contents
|
||||||
|
|
@ -2,10 +2,11 @@ accessing
|
|||||||
optionsWikiTextTable
|
optionsWikiTextTable
|
||||||
| output |
|
| output |
|
||||||
output := '' writeStream.
|
output := '' writeStream.
|
||||||
|
output nextPutAll: String crlf.
|
||||||
self options keysAndValuesDo: [:k :v | | keyString |
|
self options keysAndValuesDo: [:k :v | | keyString |
|
||||||
keyString := ((k size = 1) ifTrue: [ k first asString ] ifFalse: [ k first asString, ' - ', k last asString ]).
|
keyString := ((k size = 1) ifTrue: [ k first asString ] ifFalse: [ k first asString, ' - ', k last asString ]).
|
||||||
output
|
output
|
||||||
nextPutAll: '| ',keyString , ' |';
|
nextPutAll: '| ',keyString , ' |';
|
||||||
nextPutAll: v, ' |'; cr
|
nextPutAll: (self optionsWikiTextRow: v); cr
|
||||||
].
|
].
|
||||||
^ output contents
|
^ output contents
|
Loading…
Reference in New Issue
Block a user