removed switch from the dact system

This commit is contained in:
Allen Webster 2016-05-29 17:02:03 -04:00
parent cd6614b215
commit 5138d565d8
4 changed files with 19 additions and 21 deletions

15
4ed.cpp
View File

@ -4360,23 +4360,12 @@ App_Step_Sig(app_step){
}break; }break;
#endif #endif
#if 0
case DACT_SWITCH: case DACT_SWITCH:
{ {
if (!file && string.str){
file = working_set_lookup_file(working_set, string);
if (!file){
file = working_set_contains(system, working_set, string);
}
}
if (file){
View *view = panel->view;
view_set_file(view, file, models);
view_show_file(view);
view->map = get_map(models, file->settings.base_map_id);
}
}break; }break;
#endif
#if 0 #if 0
case DACT_KILL: case DACT_KILL:

View File

@ -1,6 +1,5 @@
enum Action_Type{ enum Action_Type{
DACT_SET_LINE, DACT_SET_LINE,
DACT_SWITCH,
DACT_TRY_KILL, DACT_TRY_KILL,
DACT_CLOSE, DACT_CLOSE,
}; };
@ -121,6 +120,5 @@ delayed_action_repush(Delay *delay, Delayed_Action *act){
} }
#define delayed_set_line(delay, ...) delayed_action_(delay, DACT_SET_LINE, ##__VA_ARGS__) #define delayed_set_line(delay, ...) delayed_action_(delay, DACT_SET_LINE, ##__VA_ARGS__)
#define delayed_switch(delay, ...) delayed_action_(delay, DACT_SWITCH, ##__VA_ARGS__)
#define delayed_try_kill(delay, ...) delayed_action_(delay, DACT_TRY_KILL, ##__VA_ARGS__) #define delayed_try_kill(delay, ...) delayed_action_(delay, DACT_TRY_KILL, ##__VA_ARGS__)
#define delayed_close(delay, ...) delayed_action_(delay, DACT_CLOSE, ##__VA_ARGS__) #define delayed_close(delay, ...) delayed_action_(delay, DACT_CLOSE, ##__VA_ARGS__)

View File

@ -3172,7 +3172,6 @@ kill_file(System_Functions *system, Models *models,
internal void internal void
interactive_view_complete(System_Functions *system, View *view, String dest, i32 user_action){ interactive_view_complete(System_Functions *system, View *view, String dest, i32 user_action){
Models *models = view->persistent.models; Models *models = view->persistent.models;
Panel *panel = view->panel;
Editing_File *old_file = view->file_data.file; Editing_File *old_file = view->file_data.file;
switch (view->action){ switch (view->action){
@ -3193,8 +3192,20 @@ interactive_view_complete(System_Functions *system, View *view, String dest, i32
}break; }break;
case IAct_Switch: case IAct_Switch:
delayed_switch(&models->delay1, dest, panel); {
touch_file(&models->working_set, old_file); touch_file(&models->working_set, old_file);
Editing_File *file = 0;
String string = dest;
file = working_set_lookup_file(&models->working_set, string);
if (!file){
file = working_set_contains(system, &models->working_set, string);
}
if (file){
view_set_file(view, file, models);
}
}
break; break;
case IAct_Kill: case IAct_Kill:

View File

@ -155,8 +155,8 @@ char *daction_enum[] = {
"SAVE_AS", "SAVE_AS",
"SAVE", "SAVE",
"NEW", "NEW",
#endif
"SWITCH", "SWITCH",
#endif
"TRY_KILL", "TRY_KILL",
#if 0 #if 0
"KILL", "KILL",