@@ -2,36 +2,11 @@ use std::path::PathBuf;
2
2
#[ cfg( target_arch = "wasm32" ) ]
3
3
use std:: { cell:: RefCell , rc:: Rc } ;
4
4
5
- use egui:: Pos2 ;
6
5
use egui_notify:: Toasts ;
7
6
use serde:: { Deserialize , Serialize } ;
8
7
use tes3:: esp:: Plugin ;
9
8
10
- use crate :: {
11
- get_unique_id, CompareData , EAppState , EModalState , EScale , EditData , MapData , PluginMetadata ,
12
- } ;
13
-
14
- #[ derive( Debug , Clone , Copy ) ]
15
- pub struct ZoomData {
16
- pub drag_start : Pos2 ,
17
- pub drag_delta : Option < Pos2 > ,
18
- pub drag_offset : Pos2 ,
19
-
20
- pub zoom : f32 ,
21
- pub zoom_delta : Option < f32 > ,
22
- }
23
-
24
- impl Default for ZoomData {
25
- fn default ( ) -> Self {
26
- Self {
27
- drag_start : Default :: default ( ) ,
28
- drag_delta : Default :: default ( ) ,
29
- drag_offset : Default :: default ( ) ,
30
- zoom : 1.0 ,
31
- zoom_delta : Default :: default ( ) ,
32
- }
33
- }
34
- }
9
+ use crate :: { get_unique_id, CompareData , EAppState , EModalState , EScale , EditData , PluginMetadata } ;
35
10
36
11
/// We derive Deserialize/Serialize so we can persist app state on shutdown.
37
12
#[ derive( Deserialize , Serialize ) ]
@@ -53,8 +28,6 @@ pub struct TemplateApp {
53
28
pub edit_data : EditData ,
54
29
#[ serde( skip) ]
55
30
pub compare_data : CompareData ,
56
- #[ serde( skip) ]
57
- pub map_data : MapData ,
58
31
59
32
// runtime ui
60
33
#[ serde( skip) ]
@@ -66,9 +39,6 @@ pub struct TemplateApp {
66
39
#[ serde( skip) ]
67
40
pub modal_state : EModalState ,
68
41
69
- #[ serde( skip) ]
70
- pub zoom_data : ZoomData ,
71
-
72
42
// wasm
73
43
// https://github.com/ergrelet/resym/blob/e4d243eb9459211ade0c5bae16096712a0615b0b/resym/src/resym_app.rs
74
44
/// Field used by wasm32 targets to store file information
@@ -89,7 +59,6 @@ impl Default for TemplateApp {
89
59
last_directory : "/" . into ( ) ,
90
60
// runtime data
91
61
compare_data : CompareData :: default ( ) ,
92
- map_data : MapData :: default ( ) ,
93
62
edit_data : EditData :: default ( ) ,
94
63
// settings
95
64
overwrite : false ,
@@ -101,7 +70,6 @@ impl Default for TemplateApp {
101
70
app_state : EAppState :: default ( ) ,
102
71
modal_state : EModalState :: default ( ) ,
103
72
modal_open : false ,
104
- zoom_data : ZoomData :: default ( ) ,
105
73
106
74
#[ cfg( target_arch = "wasm32" ) ]
107
75
open_file_data : Rc :: new ( RefCell :: new ( None ) ) ,
@@ -196,9 +164,6 @@ impl TemplateApp {
196
164
pub ( crate ) fn open_modal_window ( & mut self , ui : & mut egui:: Ui , modal : EModalState ) {
197
165
// cleanup
198
166
self . compare_data = CompareData :: default ( ) ;
199
- let last_path = self . map_data . path . clone ( ) ;
200
- self . map_data = MapData :: default ( ) ;
201
- self . map_data . path = last_path;
202
167
203
168
// disable ui
204
169
ui. set_enabled ( false ) ;
@@ -213,20 +178,6 @@ impl TemplateApp {
213
178
self . modal_open = false ;
214
179
self . modal_state = EModalState :: None ;
215
180
}
216
-
217
- /// Settings popup menu
218
- pub ( crate ) fn options_ui ( & mut self , ui : & mut egui:: Ui ) {
219
- if ui. button ( "Refresh" ) . clicked ( ) {
220
- self . map_data . refresh_requested = true ;
221
- }
222
-
223
- ui. separator ( ) ;
224
- ui. label ( "Overlays" ) ;
225
- ui. checkbox ( & mut self . map_data . overlay_conflicts , "Show conflicts" ) ;
226
- ui. checkbox ( & mut self . map_data . overlay_region , "Show regions" ) ;
227
- ui. checkbox ( & mut self . map_data . overlay_travel , "Show travel" ) ;
228
- ui. checkbox ( & mut self . map_data . tooltip_names , "Show tooltips" ) ;
229
- }
230
181
}
231
182
232
183
impl eframe:: App for TemplateApp {
@@ -244,15 +195,13 @@ impl eframe::App for TemplateApp {
244
195
match self . modal_state {
245
196
EModalState :: None => panic ! ( "ArgumentException" ) ,
246
197
EModalState :: ModalCompareInit => self . update_modal_compare ( ctx) ,
247
- EModalState :: MapInit => self . update_modal_map ( ctx) ,
248
198
EModalState :: Settings => self . update_settings ( ctx) ,
249
199
}
250
200
} else {
251
201
// other main ui views
252
202
match self . app_state {
253
203
EAppState :: Main => self . update_edit_view ( ctx) ,
254
204
EAppState :: Compare => self . update_compare_view ( ctx, frame) ,
255
- EAppState :: Map => self . update_map_view ( ctx) ,
256
205
}
257
206
}
258
207
0 commit comments