• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

A Nix-friendly SQLite-enhanced fork of Flitter, a speedrunning split timer for Unix-style terminals


Commit MetaInfo

Revisión6ff31367158c4b76a8910eda99c2b16b21ad8f00 (tree)
Tiempo2023-06-24 02:01:01
AutorCorbin <cds@corb...>
CommiterCorbin

Log Message

Remove world-record support.

For posterity: This is the ability to take somebody else's segments and
store them in a way that doesn't associate them with any particular
attempt. I don't like this because it's incompatible with the rest of
the data model, and also breaks an assumption about provenance; but
also, I think that it's unhealthy to compare oneself to the
world-record-holding runners constantly.

Cambiar Resumen

Diferencia incremental

--- a/src/display.ml
+++ b/src/display.ml
@@ -21,10 +21,7 @@ let preamble timer width =
2121 I.(title <-> category)
2222
2323 let splits_header timer width =
24- let labels =
25- if Option.is_some timer.wr then [ "Delta"; "Sgmt"; "Time"; "WR" ]
26- else [ "Delta"; "Sgmt"; "Time" ]
27- in
24+ let labels = [ "Delta"; "Sgmt"; "Time" ] in
2825
2926 let cell_padded =
3027 List.map
@@ -153,36 +150,8 @@ let split_row timer width i =
153150 in
154151 let time_image = plain_duration time in
155152
156- (* Compute the image of the WR comparison cell *)
157- let wr_image =
158- Option.map timer.wr ~f:(fun wr_run ->
159- let default_img = wr_duration wr_run.splits.(i).time in
160-
161- if i >= curr_split then default_img
162- else
163- (* Determine how much we're ahead or behind WR *)
164- match timer.state with
165- | Idle -> default_img
166- | Timing (splits, _, _)
167- | Paused (splits, _, _, _)
168- | Done (splits, _, _) -> (
169- match (splits.(i), wr_run.splits.(i).time) with
170- | Some curr_t, Some wr_t ->
171- let delta = curr_t - wr_t in
172- let delta_str = Duration.to_string_plus delta 2 in
173- let delta_color =
174- if delta < 0 then Colors.ahead_gain else Colors.behind_gain
175- in
176- I.string delta_color delta_str
177- | _ -> hyphen))
178- in
179-
180153 (* Combine the three time columns together with proper padding *)
181- let time_cells =
182- match wr_image with
183- | Some wr -> [ delta_image; sgmt_image; time_image; wr ]
184- | None -> [ delta_image; sgmt_image; time_image ]
185- in
154+ let time_cells = [ delta_image; sgmt_image; time_image ] in
186155 let time_cols_combined =
187156 List.map time_cells ~f:(left_pad time_col_width) |> I.hcat
188157 in
--- a/src/loadsave.ml
+++ b/src/loadsave.ml
@@ -26,7 +26,6 @@ type game = {
2626 split_names : string array;
2727 golds : gold array; [@sexp.omit_nil]
2828 personal_best : archived_run option; [@sexp.option]
29- world_record : archived_run option; [@sexp.option]
3029 history : archived_run list; [@sexp.omit_nil]
3130 }
3231 [@@deriving sexp]
@@ -50,7 +49,6 @@ let game_of_sexp sexp =
5049 in
5150
5251 check_run game.personal_best "Personal best";
53- check_run game.world_record "World record";
5452
5553 let history_runs_ok =
5654 List.fold game.history ~init:true ~f:(fun all_ok run ->
@@ -98,7 +96,6 @@ let load_route { title; category } = { title; category; Route.order = None }
9896 let load filepath =
9997 let game = Sexp.load_sexp_conv_exn filepath game_of_sexp in
10098 let pb = Option.map ~f:load_run game.personal_best in
101- let wr = Option.map ~f:load_run game.world_record in
10299 let golds = load_golds game in
103100 let history = List.map game.history ~f:load_run in
104101
@@ -111,7 +108,6 @@ let load filepath =
111108 history;
112109 comparison = pb;
113110 pb;
114- wr;
115111 state = Idle;
116112 splits_file = filepath;
117113 }
@@ -140,7 +136,6 @@ let save (timer : Timer_types.timer) =
140136 in
141137
142138 let pb = Option.map ~f:export_run timer.pb in
143- let wr = Option.map ~f:export_run timer.wr in
144139
145140 let history = List.map timer.history ~f:export_run in
146141
@@ -154,7 +149,6 @@ let save (timer : Timer_types.timer) =
154149 golds = Array.map timer.golds ~f:map_gold;
155150 history;
156151 personal_best = pb;
157- world_record = wr;
158152 }
159153 in
160154
--- a/src/timer_types.ml
+++ b/src/timer_types.ml
@@ -35,7 +35,6 @@ type timer = {
3535 history : archived_run list;
3636 comparison : archived_run option;
3737 pb : archived_run option;
38- wr : archived_run option;
3938 state : live_splits timer_state;
4039 splits_file : string;
4140 }
--- a/src/timer_types.mli
+++ b/src/timer_types.mli
@@ -27,7 +27,6 @@ type timer = {
2727 history : archived_run list;
2828 comparison : archived_run option;
2929 pb : archived_run option;
30- wr : archived_run option;
3130 state : live_splits timer_state;
3231 splits_file : string;
3332 }