added modal reroll

This commit is contained in:
Rory Hinnen
2026-09-07 10:07:07 -05:00
parent 17f2b0a288
commit a4d1634df7
5 changed files with 153 additions and 18 deletions
+41 -17
View File
@@ -104,11 +104,19 @@ struct MainView: View {
.padding()
}
Spacer()
VStack{
VStack {
Text("Reroll")
Button("🎲", action: {
current.dice.roll(howMany: current.total)
})
Picker("", selection: $current.saveRerollMode) {
ForEach(RerollMode.allCases, id: \.self) { mode in
Text(mode.label).tag(mode)
}
}
.pickerStyle(.segmented)
.frame(width: 180)
Button("🎲") {
current.applyReroll()
}
.disabled(current.saveRerollMode == .none || current.saveHasRerolled)
.padding()
.font(.system(size: controlSize))
}
@@ -173,13 +181,21 @@ struct MainView: View {
Text("Modifier")
}
Spacer()
VStack{
VStack {
Text("Reroll")
Button("🎲", action: {
current.dice.roll(howMany: current.total)
})
.padding()
.font(.system(size: controlSize))
Picker("", selection: $current.woundRerollMode) {
ForEach(RerollMode.allCases, id: \.self) { mode in
Text(mode.label).tag(mode)
}
}
.pickerStyle(.segmented)
.frame(width: 180)
Button("🎲") {
current.applyReroll()
}
.disabled(current.woundRerollMode == .none || current.woundHasRerolled)
.padding()
.font(.system(size: controlSize))
}
Spacer()
}.padding()
@@ -223,13 +239,21 @@ struct MainView: View {
.font(.system(size: controlSize))
}
VStack{
VStack {
Text("Reroll")
Button("🎲", action: {
current.dice.roll(howMany: current.total)
})
.padding()
.font(.system(size: controlSize))
Picker("", selection: $current.hitRerollMode) {
ForEach(RerollMode.allCases, id: \.self) { mode in
Text(mode.label).tag(mode)
}
}
.pickerStyle(.segmented)
.frame(width: 180)
Button("🎲") {
current.applyReroll()
}
.disabled(current.hitRerollMode == .none || current.hitHasRerolled)
.padding()
.font(.system(size: controlSize))
}
}
}.padding()
@@ -304,7 +328,7 @@ struct MainView: View {
buttons(color: blue, label: "Pool", value: current.total)
}
.sheet(isPresented: $showFillView,
onDismiss: {current.dice.roll(howMany: current.total)}) {
onDismiss: { current.resetPool() }) {
VStack {
AddToPool()
Button("Accept", action: {showFillView.toggle()})