From 6bfb07dba9805bd7789330809eaab9d94843fefe Mon Sep 17 00:00:00 2001 From: Offray Luna Date: Sun, 3 Dec 2023 17:40:36 -0500 Subject: [PATCH] Default UI. --- RoloLudo.package/DicePool.class/instance/printOn..st | 5 +++++ .../DicePool.class/instance/uiDiceFor..st | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 RoloLudo.package/DicePool.class/instance/printOn..st create mode 100644 RoloLudo.package/DicePool.class/instance/uiDiceFor..st diff --git a/RoloLudo.package/DicePool.class/instance/printOn..st b/RoloLudo.package/DicePool.class/instance/printOn..st new file mode 100644 index 0000000..ed0a77c --- /dev/null +++ b/RoloLudo.package/DicePool.class/instance/printOn..st @@ -0,0 +1,5 @@ +accessing +printOn: aStream + super initialize. + aStream + nextPutAll: self dice printString \ No newline at end of file diff --git a/RoloLudo.package/DicePool.class/instance/uiDiceFor..st b/RoloLudo.package/DicePool.class/instance/uiDiceFor..st new file mode 100644 index 0000000..23453f7 --- /dev/null +++ b/RoloLudo.package/DicePool.class/instance/uiDiceFor..st @@ -0,0 +1,12 @@ +accessing +uiDiceFor: aView + + | response currentRoll | + response := '' writeStream. + currentRoll := self roll. + response + nextPutAll: 'Rolls: ', currentRoll printString; cr; + nextPutAll: 'Sums: ', currentRoll sum asString. + ^ aView text + title: 'Dice'; + text: [ response contents ] \ No newline at end of file