Andrey Lesnikov avatar Andrey Lesnikov committed 7fde2d2

ui_sdl: select_mode -> main_mode.

Comments (0)

Files changed (1)

 static Mcrd selected_tile;
 
 typedef enum{
-  MODE_SELECT,
+  MODE_MAIN,
   MODE_SHOW_EVENT,
   MODE_EMPTY
 } Mode_id;
   draw_bg(white);
   draw_map();
   draw_fog();
-  if(ui_mode == MODE_SELECT && selected_unit){
+  if(ui_mode == MODE_MAIN && selected_unit){
     draw_reachable_tiles();
     draw_img(img_selected_tile, map2scr(selected_unit->m));
     {
   draw_img(img_selected_tile, map2scr(selected_tile));
   if(ui_mode == MODE_SHOW_EVENT)
     draw_event(*current_event);
-  if(ui_mode == MODE_SELECT
+  if(ui_mode == MODE_MAIN
   && unit_at(selected_tile)
   && unit_at(selected_tile)->is_visible) {
     Scrd pos = map2scr(selected_tile);
     draw_unit_info(unit_at(selected_tile), pos);
   }
 #if 0 /* TODO */
-  if(ui_mode == MODE_SELECT && selected_unit){
+  if(ui_mode == MODE_MAIN && selected_unit){
     Scrd a = map2scr(selected_unit->m);
     Scrd b = map2scr(selected_tile);
     Rect r = get_rect_xxx(a, b);
   if(b){
     b->f();
   }else if(screen_id == SCREEN_SCENARIO
-  && ui_mode == MODE_SELECT){
+  && ui_mode == MODE_MAIN){
     tile_action(scr2map(s));
   }
 }
 }
 
 static void
-select_keys (SDL_KeyboardEvent e){
+main_keys (SDL_KeyboardEvent e){
   switch(e.keysym.sym) {
     case SDLK_ESCAPE:
     case SDLK_q:
 }
 
 static void
-scenario_select_sdl_events (SDL_Event e){
+scenario_main_sdl_events (SDL_Event e){
   switch(e.type){
     case SDL_KEYUP:
-      select_keys(e.key);
+      main_keys(e.key);
       break;
     case SDL_MOUSEMOTION:
       mousemove(e.motion);
   switch(e.type){
     case SDL_KEYUP:
     case SDL_MOUSEBUTTONDOWN:
-      ui_mode = MODE_SELECT;
+      ui_mode = MODE_MAIN;
       is_dirty = true;
       break;
   }
     if(screen_id == SCREEN_MENU)
       menu_sdl_events(e);
     else if(screen_id == SCREEN_SCENARIO){
-      if(ui_mode == MODE_SELECT)
-        scenario_select_sdl_events(e);
+      if(ui_mode == MODE_MAIN)
+        scenario_main_sdl_events(e);
       else if(ui_mode == MODE_EMPTY)
         scenario_empty_sdl_events(e);
     }
 }
 
 static void
-screen_scenario_select_events (void){
+screen_scenario_main_events (void){
   current_event = get_next_event();
   ui_mode = MODE_SHOW_EVENT;
   eindex = 0;
 }
 
 static void
-do_screen_scenario_select (void){
+do_screen_scenario_main (void){
   if(!is_local)
     do_network();
   if(unshown_events_left())
-    screen_scenario_select_events();
+    screen_scenario_main_events();
   /*scroll_map(mouse_pos);*/
   correct_map_offset();
   if(labels.count > 0)
   eindex++;
   if(eindex >= final_eindex){
     apply_event(*current_event);
-    ui_mode = MODE_SELECT;
+    ui_mode = MODE_MAIN;
     is_dirty = true;
   }else{
     draw_scenario_screen();
 static void
 do_screen_scenario (void){
   switch(ui_mode){
-    case MODE_SELECT:
-      do_screen_scenario_select();
+    case MODE_MAIN:
+      do_screen_scenario_main();
       break;
     case MODE_SHOW_EVENT:
       do_screen_scenario_show_event();
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.