From dbf9afbc6816a1b8ac72bddceed09ae5ba9ec105 Mon Sep 17 00:00:00 2001
From: aprzn <novaberman@pm.me>
Date: Fri, 27 Jan 2023 01:36:31 -0500
Subject: [PATCH] barely anything

---
 src/gd.rs | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/gd.rs b/src/gd.rs
index 5cea5de..93415cb 100644
--- a/src/gd.rs
+++ b/src/gd.rs
@@ -3,17 +3,13 @@ use std::fs::File;
 use std::io::Read;
 use base64::engine::{general_purpose::URL_SAFE, Engine};
 use flate2::read::GzDecoder;
-use quick_xml::Reader;
+use quick_xml::{Reader, events::Event};
 
 struct User {
     name: String,
     id: Option<u64>,
 }
 
-struct InnerLevel; // TODO: write this
-
-type Difficulty = u8;
-
 enum Song {
     Official{id: i32 /*k8*/},
     Newgrounds{id: i32 /*k45*/},
@@ -24,6 +20,11 @@ struct Level {
     song: Song,
 }
 
+struct OuterLevel {
+    name: String, // k2
+    inner: String, // k4
+}
+
 pub fn gd_path() -> PathBuf {
     let mut path_buf = home::home_dir().unwrap();
     #[cfg(unix)]
@@ -36,7 +37,7 @@ pub fn gd_path() -> PathBuf {
     path_buf
 }
 
-fn load_levels() -> Vec<Level> {
+fn load_levels() -> Vec<OuterLevel> {
     let raw_save_data = {
         let mut save_file = File::open(gd_path().join("CCLocalLevels.dat")).expect("No save file found!");
         let mut sd = Vec::new();
@@ -53,9 +54,13 @@ fn load_levels() -> Vec<Level> {
         }
         plist
     };
-    let reader = Reader::from_str(plist.as_ref());
+    let mut reader = Reader::from_str(plist.as_ref());
     let mut out = vec![];
     loop {
+        let token = reader.read_event().unwrap();
+        match token {
+            
+        }
         break out;
     }
 }