From 879e01a32bdee44eb5fa8df7967e05723d7cc371 Mon Sep 17 00:00:00 2001
From: Bill Rossi <bassguitarbill@gmail.com>
Date: Sun, 23 Feb 2025 09:27:48 -0500
Subject: [PATCH] Save and cancel options

---
 options.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/options.c b/options.c
index db6a2dc..0cecc2a 100644
--- a/options.c
+++ b/options.c
@@ -56,7 +56,7 @@ void handle_select_deal_speed(Game *g, int index) {
 OptionsChoices kan_choices = {              { "Ten", "Twelve" },                                    2, 250, &handle_select_kan };
 OptionsChoices number_of_rounds_choices = { { "One", "Three", "Six", "Twelve" },                    4, 400, &handle_select_number_of_rounds };
 OptionsChoices card_backs_choices = {       { "Red", "Black" },                                     2, 550, &handle_select_card_backs };
-OptionsChoices deal_speed_choices = {       { "Very Slow", "Slow", "Medium", "Fast", "Very Fast" }, 5, 700, &handle_select_deal_speed };
+OptionsChoices deal_speed_choices = {       { "Very Fast", "Fast", "Medium", "Slow", "Very Slow" }, 5, 700, &handle_select_deal_speed };
 OptionsChoices *oc[4] = { &kan_choices, &number_of_rounds_choices, &card_backs_choices, &deal_speed_choices };
 
 void options_handle_input(Game *g) {
@@ -83,6 +83,15 @@ void options_handle_input(Game *g) {
       }
     }
   }
+
+  if (x > 400 && x < 400 + MeasureText("Save", 30) + 12 && y > 800 && y < 836) {
+    handle_options_save(g);
+    return;
+  }
+  if (x > 900 && x < 900 + MeasureText("Cancel", 30) + 12 && y > 800 && y < 836) {
+    handle_options_cancel(g);
+    return;
+  }
 }
 
 void DrawTextCentered(char *text, int center_x, int y, int point, Color color) {
@@ -109,4 +118,12 @@ void options_draw(Game *g) {
   draw_option_choices(&card_backs_choices, g->options->card_backs);
   DrawTextCentered("Deal Speed", 700, 625, 40, BLACK);
   draw_option_choices(&deal_speed_choices, g->options->deal_speed);
+
+  DrawRectangle(400, 800, MeasureText("Save", 30) + 12, 36, BLACK);
+  DrawRectangle(403, 803, MeasureText("Save", 30) + 6, 30, GREEN);
+  DrawText("Save", 406, 806, 30, BLACK);
+
+  DrawRectangle(900, 800, MeasureText("Cancel", 30) + 12, 36, BLACK);
+  DrawRectangle(903, 803, MeasureText("Cancel", 30) + 6, 30, RED);
+  DrawText("Cancel", 906, 806, 30, BLACK);
 }