Previous 199869 Revisions Next

r45210 Wednesday 24th February, 2016 at 22:28:16 UTC by Dankan1890
selsoft: fixed search for software list. (nw)
[src/emu]inpttype.h
[src/emu/ui]custui.cpp dirmenu.cpp selsoft.cpp

trunk/src/emu/inpttype.h
r253721r253722
758758   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_TAPE_STOP,        "UI (First) Tape Stop",   input_seq(KEYCODE_F2, KEYCODE_LSHIFT) )
759759   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_DATS,             "UI External DAT View",   input_seq(KEYCODE_LALT, KEYCODE_D) )
760760   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_FAVORITES,        "UI Add/Remove favorites",input_seq(KEYCODE_LALT, KEYCODE_F) )
761   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_UP_FILTER,        NULL,                     input_seq() )
762   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_DOWN_FILTER,      NULL,                     input_seq() )
763   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_LEFT_PANEL,       NULL,                     input_seq() )
764   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_RIGHT_PANEL,      "UI Right switch image/info",         input_seq(KEYCODE_RIGHT, KEYCODE_LCONTROL) )
765   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_UP_PANEL,         NULL,                     input_seq() )
766   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_DOWN_PANEL,       NULL,                     input_seq() )
761   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_UP_FILTER,        nullptr,                  input_seq() )
762   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_DOWN_FILTER,      nullptr,                  input_seq() )
763   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_LEFT_PANEL,       nullptr,                  input_seq() )
764   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_RIGHT_PANEL,      "UI Right switch image/info",input_seq(KEYCODE_RIGHT, KEYCODE_LCONTROL) )
765   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_UP_PANEL,         nullptr,                  input_seq() )
766   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_DOWN_PANEL,       nullptr,                  input_seq() )
767767   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_EXPORT,           "UI Export list to xml",  input_seq(KEYCODE_LALT, KEYCODE_E) )
768768   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_AUDIT_FAST,       "UI Audit Unavailable",   input_seq(KEYCODE_F1, input_seq::not_code, KEYCODE_LSHIFT) )
769769   INPUT_PORT_DIGITAL_TYPE( 0, UI,      UI_AUDIT_ALL,        "UI Audit All",           input_seq(KEYCODE_F1, KEYCODE_LSHIFT) )
trunk/src/emu/ui/custui.cpp
r253721r253722
120120
121121               ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, s_sel, m_currlang));
122122            }
123            break;
123124         }
124125      }
125126   }
trunk/src/emu/ui/dirmenu.cpp
r253721r253722
2828
2929static const folders_entry s_folders[] =
3030{
31   { __("ROMs"),                OPTION_MEDIAPATH,          ADDING },
32   { __("UI"),                  OPTION_UI_PATH,            CHANGE },
33   { __("Language"),            OPTION_LANGUAGEPATH,       CHANGE },
34   { __("Samples"),             OPTION_SAMPLEPATH,         ADDING },
35   { __("DATs"),                OPTION_HISTORY_PATH,       CHANGE },
36   { __("INIs"),                OPTION_INIPATH,            ADDING },
37   { __("Extra INIs"),          OPTION_EXTRAINI_PATH,      CHANGE },
38   { __("Icons"),               OPTION_ICONS_PATH,         ADDING },
39   { __("Cheats"),              OPTION_CHEATPATH,          ADDING },
40   { __("Snapshots"),           OPTION_SNAPSHOT_DIRECTORY, ADDING },
41   { __("Cabinets"),            OPTION_CABINETS_PATH,      ADDING },
42   { __("Flyers"),              OPTION_FLYERS_PATH,        ADDING },
43   { __("Titles"),              OPTION_TITLES_PATH,        ADDING },
44   { __("Ends"),                OPTION_ENDS_PATH,          ADDING },
45   { __("PCBs"),                OPTION_PCBS_PATH,          ADDING },
46   { __("Marquees"),            OPTION_MARQUEES_PATH,      ADDING },
47   { __("Controls Panels"),     OPTION_CPANELS_PATH,       ADDING },
48   { __("Crosshairs"),          OPTION_CROSSHAIRPATH,      ADDING },
49   { __("Artworks"),            OPTION_ARTPATH,            ADDING },
50   { __("Bosses"),              OPTION_BOSSES_PATH,        ADDING },
51   { __("Artworks Preview"),    OPTION_ARTPREV_PATH,       ADDING },
52   { __("Select"),              OPTION_SELECT_PATH,        ADDING },
53   { __("GameOver"),            OPTION_GAMEOVER_PATH,      ADDING },
54   { __("HowTo"),               OPTION_HOWTO_PATH,         ADDING },
55   { __("Logos"),               OPTION_LOGOS_PATH,         ADDING },
56   { __("Scores"),              OPTION_SCORES_PATH,        ADDING },
57   { __("Versus"),              OPTION_VERSUS_PATH,        ADDING },
31   { __("ROMs"),                OPTION_MEDIAPATH,         ADDING },
32   { __("UI"),                  OPTION_UI_PATH,         CHANGE },
33   { __("Language"),            OPTION_LANGUAGEPATH,      CHANGE },
34   { __("Samples"),             OPTION_SAMPLEPATH,         ADDING },
35   { __("DATs"),                OPTION_HISTORY_PATH,      CHANGE },
36   { __("INIs"),                OPTION_INIPATH,         ADDING },
37   { __("Extra INIs"),          OPTION_EXTRAINI_PATH,      CHANGE },
38   { __("Icons"),               OPTION_ICONS_PATH,         ADDING },
39   { __("Cheats"),              OPTION_CHEATPATH,         ADDING },
40   { __("Snapshots"),           OPTION_SNAPSHOT_DIRECTORY,   ADDING },
41   { __("Cabinets"),            OPTION_CABINETS_PATH,      ADDING },
42   { __("Flyers"),              OPTION_FLYERS_PATH,      ADDING },
43   { __("Titles"),              OPTION_TITLES_PATH,      ADDING },
44   { __("Ends"),                OPTION_ENDS_PATH,         ADDING },
45   { __("PCBs"),                OPTION_PCBS_PATH,         ADDING },
46   { __("Marquees"),            OPTION_MARQUEES_PATH,      ADDING },
47   { __("Controls Panels"),     OPTION_CPANELS_PATH,      ADDING },
48   { __("Crosshairs"),          OPTION_CROSSHAIRPATH,      ADDING },
49   { __("Artworks"),            OPTION_ARTPATH,         ADDING },
50   { __("Bosses"),              OPTION_BOSSES_PATH,      ADDING },
51   { __("Artworks Preview"),    OPTION_ARTPREV_PATH,      ADDING },
52   { __("Select"),              OPTION_SELECT_PATH,      ADDING },
53   { __("GameOver"),            OPTION_GAMEOVER_PATH,      ADDING },
54   { __("HowTo"),               OPTION_HOWTO_PATH,         ADDING },
55   { __("Logos"),               OPTION_LOGOS_PATH,         ADDING },
56   { __("Scores"),              OPTION_SCORES_PATH,      ADDING },
57   { __("Versus"),              OPTION_VERSUS_PATH,      ADDING },
5858};
5959
6060
r253721r253722
9494
9595void ui_menu_directory::populate()
9696{
97
9798   for (auto & elem : s_folders)
9899      item_append(_(elem.name), nullptr, 0, (void *)(FPTR)elem.action);
99100
r253721r253722
142143//  ctor / dtor
143144//-------------------------------------------------
144145
145ui_menu_display_actual::ui_menu_display_actual(running_machine &machine, render_container *container, int ref)
146ui_menu_display_actual::ui_menu_display_actual(running_machine &machine, render_container *container, int ref)
146147   : ui_menu(machine, container), m_ref(ref)
147148{
148149}
r253721r253722
179180void ui_menu_display_actual::populate()
180181{
181182   m_tempbuf.assign(_("Current ")).append(_(s_folders[m_ref].name)).append(_(" Folders"));
182   if (machine().ui().options().exists(s_folders[m_ref].option)) {
183   if (machine().ui().options().exists(s_folders[m_ref].option))
183184      m_searchpath.assign(machine().ui().options().value(s_folders[m_ref].option));
184   }
185   else {
185   else
186186      m_searchpath.assign(machine().options().value(s_folders[m_ref].option));
187   }
187
188188   path_iterator path(m_searchpath.c_str());
189189   std::string curpath;
190190   m_folders.clear();
r253721r253722
237237   y1 += UI_BOX_TB_BORDER;
238238
239239   // draw the text within it
240   mui.draw_text_full(container, m_tempbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
240   mui.draw_text_full(container, m_tempbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
241241      DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
242242
243243   // compute our bounds
r253721r253722
285285
286286   std::string searchpath;
287287   if (machine.ui().options().exists(s_folders[m_ref].option))
288   {
289288      searchpath = machine.ui().options().value(s_folders[m_ref].option);
290   }
291289   else
292   {
293290      searchpath = machine.options().value(s_folders[m_ref].option);
294   }
295291
296292   path_iterator path(searchpath.c_str());
297293   std::string curpath;
298294   while (path.next(curpath, nullptr))
299295      m_folders.push_back(curpath);
300
301296}
302297
303298ui_menu_add_change_folder::~ui_menu_add_change_folder()
r253721r253722
372367            if (m_change)
373368            {
374369               if (machine().ui().options().exists(s_folders[m_ref].option))
375               {
376370                  machine().ui().options().set_value(s_folders[m_ref].option, m_current_path.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
377               }
378               else
371               else if (strcmp(machine().options().value(s_folders[m_ref].option), m_current_path.c_str()) != 0)
379372               {
380                  if (strcmp(machine().options().value(s_folders[m_ref].option), m_current_path.c_str()) != 0)
381                  {
382                     machine().options().set_value(s_folders[m_ref].option, m_current_path.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
383                     machine().options().mark_changed(s_folders[m_ref].option);
384                  }
373                  machine().options().set_value(s_folders[m_ref].option, m_current_path.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
374                  machine().options().mark_changed(s_folders[m_ref].option);
385375               }
386376               machine().datfile().reset_run();
387377            }
r253721r253722
397387               }
398388
399389               if (machine().ui().options().exists(s_folders[m_ref].option))
400               {
401390                  machine().ui().options().set_value(s_folders[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
402               }
403               else
391               else if (strcmp(machine().options().value(s_folders[m_ref].option), tmppath.c_str()) != 0)
404392               {
405                  if (strcmp(machine().options().value(s_folders[m_ref].option), tmppath.c_str()) != 0)
406                  {
407                     machine().options().set_value(s_folders[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
408                     machine().options().mark_changed(s_folders[m_ref].option);
409                  }
393                  machine().options().set_value(s_folders[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
394                  machine().options().mark_changed(s_folders[m_ref].option);
410395               }
411396            }
412397
r253721r253722
476461void ui_menu_add_change_folder::populate()
477462{
478463   // open a path
479   const char *volume_name;
464   const char *volume_name = nullptr;
480465   file_enumerator path(m_current_path.c_str());
481466   const osd_directory_entry *dirent;
482467   int folders_count = 0;
483468
484469   // add the drives
485   for (int i = 0; (volume_name = osd_get_volume_name(i)) != nullptr; i++)
470   for (int i = 0; (volume_name = osd_get_volume_name(i)) != nullptr; ++i)
486471      item_append(volume_name, "[DRIVE]", 0, (void *)(FPTR)++folders_count);
487472
488473   // add the directories
r253721r253722
581566ui_menu_remove_folder::ui_menu_remove_folder(running_machine &machine, render_container *container, int ref) : ui_menu(machine, container)
582567{
583568   m_ref = ref;
584   if (machine.ui().options().exists(s_folders[m_ref].option))
569   if (machine.ui().options().exists(s_folders[m_ref].option))
585570      m_searchpath.assign(machine.ui().options().value(s_folders[m_ref].option));
586   else
571   else
587572      m_searchpath.assign(machine.options().value(s_folders[m_ref].option));
588573
589574   path_iterator path(m_searchpath.c_str());
r253721r253722
616601      }
617602
618603      if (machine().ui().options().exists(s_folders[m_ref].option))
619      {
620604         machine().ui().options().set_value(s_folders[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
621      }
622      else
605      else if (strcmp(machine().options().value(s_folders[m_ref].option),tmppath.c_str())!=0)
623606      {
624         if (strcmp(machine().options().value(s_folders[m_ref].option),tmppath.c_str())!=0)
625         {
626            machine().options().set_value(s_folders[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
627            machine().options().mark_changed(s_folders[m_ref].option);
628         }
607         machine().options().set_value(s_folders[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE, error_string);           
608         machine().options().mark_changed(s_folders[m_ref].option);
629609      }
630610
631611      ui_menu::menu_stack->parent->reset(UI_MENU_RESET_REMEMBER_REF);
r253721r253722
644624      item_append(elem.c_str(), nullptr, 0, (void *)(FPTR)++folders_count);
645625
646626   item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
647
648627   customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
649628}
650629
r253721r253722
678657   y1 += UI_BOX_TB_BORDER;
679658
680659   // draw the text within it
681   mui.draw_text_full(container, tempbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, DRAW_NORMAL,
660   mui.draw_text_full(container, tempbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_NEVER, DRAW_NORMAL,
682661      UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
683662}
trunk/src/emu/ui/selsoft.cpp
r253721r253722
318318   if (check_filter)
319319   {
320320      m_search[0] = '\0';
321
322321      switch (l_sw_hover)
323322      {
324323         case UI_SW_REGION:
r253721r253722
11841183   std::vector<int> penalty(count, 9999);
11851184   int index = 0;
11861185
1187   for (; m_displaylist[index]; ++index)
1186   for (; index < m_displaylist.size(); ++index)
11881187   {
11891188      // pick the best match between driver name and description
11901189      int curpenalty = fuzzy_substring(str, m_displaylist[index]->longname);


Previous 199869 Revisions Next


© 1997-2024 The MAME Team