Previous 199869 Revisions Next

r45108 Sunday 21st February, 2016 at 18:55:38 UTC by Dankan1890
ui: more localization and code fix. (nw)
[src/emu/ui]custui.cpp dirmenu.cpp dirmenu.h ui.cpp videoopt.cpp viewgfx.cpp

trunk/src/emu/ui/custui.cpp
r253619r253620
1616#include "ui/utils.h"
1717#include <algorithm>
1818
19const char *ui_menu_custom_ui::hide_status[] = { "Show All", "Hide Filters", "Hide Info/Image", "Hide Both" };
19const char *ui_menu_custom_ui::hide_status[] = {
20   __("Show All"),
21   __("Hide Filters"),
22   __("Hide Info/Image"),
23   __("Hide Both") };
2024
2125//-------------------------------------------------
2226//  ctor
r253619r253620
9498               int total = ARRAY_LENGTH(hide_status);
9599               std::vector<std::string> s_sel(total);
96100               for (int index = 0; index < total; ++index)
97                  s_sel[index] = hide_status[index];
101                  s_sel[index] = _(hide_status[index]);
98102
99103               ui_menu::stack_push(global_alloc_clear<ui_menu_selector>(machine(), container, s_sel, ui_globals::panels_status));
100104            }
r253619r253620
140144   }
141145
142146   arrow_flags = get_arrow_flags(0, (int)HIDE_BOTH, ui_globals::panels_status);
143   item_append(_("Show side panels"), hide_status[ui_globals::panels_status], arrow_flags, (void *)(FPTR)HIDE_MENU);
147   item_append(_("Show side panels"), _(hide_status[ui_globals::panels_status]), arrow_flags, (void *)(FPTR)HIDE_MENU);
144148
145149   item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
146150   customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
trunk/src/emu/ui/dirmenu.cpp
r253619r253620
1616#include "ui/utils.h"
1717#include "ui/optsmenu.h"
1818
19static enum
20{
21   ADDING = 1,
22   CHANGE
23};
24
1925struct folders_entry
2026{
2127   const char *name;
2228   const char *option;
29   const int   action;
2330};
2431
25static const folders_entry s_folders_entry[] =
32static const folders_entry s_folders[] =
2633{
27   { "ROMs",                OPTION_MEDIAPATH },
28   { "UI",                  OPTION_UI_PATH },
29   { "Samples",             OPTION_SAMPLEPATH },
30   { "DATs",                OPTION_HISTORY_PATH },
31   { "INIs",                OPTION_INIPATH },
32   { "Extra INIs",          OPTION_EXTRAINI_PATH },
33   { "Icons",               OPTION_ICONS_PATH },
34   { "Cheats",              OPTION_CHEATPATH },
35   { "Snapshots",           OPTION_SNAPSHOT_DIRECTORY },
36   { "Cabinets",            OPTION_CABINETS_PATH },
37   { "Flyers",              OPTION_FLYERS_PATH },
38   { "Titles",              OPTION_TITLES_PATH },
39   { "Ends",                OPTION_ENDS_PATH },
40   { "PCBs",                OPTION_PCBS_PATH },
41   { "Marquees",            OPTION_MARQUEES_PATH },
42   { "Controls Panels",     OPTION_CPANELS_PATH },
43   { "Crosshairs",          OPTION_CROSSHAIRPATH },
44   { "Artworks",            OPTION_ARTPATH },
45   { "Bosses",              OPTION_BOSSES_PATH },
46   { "Artworks Preview",    OPTION_ARTPREV_PATH },
47   { "Select",              OPTION_SELECT_PATH },
48   { "GameOver",            OPTION_GAMEOVER_PATH },
49   { "HowTo",               OPTION_HOWTO_PATH },
50   { "Logos",               OPTION_LOGOS_PATH },
51   { "Scores",              OPTION_SCORES_PATH },
52   { "Versus",              OPTION_VERSUS_PATH },
53   { nullptr }
34   { __("ROMs"),                OPTION_MEDIAPATH,         ADDING },
35   { __("UI"),                  OPTION_UI_PATH,         CHANGE },
36   { __("Language"),            OPTION_LANGUAGEPATH,      CHANGE },
37   { __("Samples"),             OPTION_SAMPLEPATH,         ADDING },
38   { __("DATs"),                OPTION_HISTORY_PATH,      CHANGE },
39   { __("INIs"),                OPTION_INIPATH,         ADDING },
40   { __("Extra INIs"),          OPTION_EXTRAINI_PATH,      CHANGE },
41   { __("Icons"),               OPTION_ICONS_PATH,         ADDING },
42   { __("Cheats"),              OPTION_CHEATPATH,         ADDING },
43   { __("Snapshots"),           OPTION_SNAPSHOT_DIRECTORY,   ADDING },
44   { __("Cabinets"),            OPTION_CABINETS_PATH,      ADDING },
45   { __("Flyers"),              OPTION_FLYERS_PATH,      ADDING },
46   { __("Titles"),              OPTION_TITLES_PATH,      ADDING },
47   { __("Ends"),                OPTION_ENDS_PATH,         ADDING },
48   { __("PCBs"),                OPTION_PCBS_PATH,         ADDING },
49   { __("Marquees"),            OPTION_MARQUEES_PATH,      ADDING },
50   { __("Controls Panels"),     OPTION_CPANELS_PATH,      ADDING },
51   { __("Crosshairs"),          OPTION_CROSSHAIRPATH,      ADDING },
52   { __("Artworks"),            OPTION_ARTPATH,         ADDING },
53   { __("Bosses"),              OPTION_BOSSES_PATH,      ADDING },
54   { __("Artworks Preview"),    OPTION_ARTPREV_PATH,      ADDING },
55   { __("Select"),              OPTION_SELECT_PATH,      ADDING },
56   { __("GameOver"),            OPTION_GAMEOVER_PATH,      ADDING },
57   { __("HowTo"),               OPTION_HOWTO_PATH,         ADDING },
58   { __("Logos"),               OPTION_LOGOS_PATH,         ADDING },
59   { __("Scores"),              OPTION_SCORES_PATH,      ADDING },
60   { __("Versus"),              OPTION_VERSUS_PATH,      ADDING },
5461};
5562
63
5664/**************************************************
57    MENU ADD FOLDER
65    MENU DIRECTORY
5866**************************************************/
5967//-------------------------------------------------
6068//  ctor / dtor
6169//-------------------------------------------------
6270
63ui_menu_add_change_folder::ui_menu_add_change_folder(running_machine &machine, render_container *container, int ref, bool _change) : ui_menu(machine, container)
71ui_menu_directory::ui_menu_directory(running_machine &machine, render_container *container) : ui_menu(machine, container)
6472{
65   m_ref = ref - 1;
66   m_change = _change;
73}
74
75ui_menu_directory::~ui_menu_directory()
76{
77   save_ui_options(machine());
78   ui_globals::reset = true;
79}
80
81//-------------------------------------------------
82//  handle
83//-------------------------------------------------
84
85void ui_menu_directory::handle()
86{
87   // process the menu
88   const ui_menu_event *m_event = process(0);
89
90   if (m_event != nullptr && m_event->itemref != nullptr && m_event->iptkey == IPT_UI_SELECT)
91      ui_menu::stack_push(global_alloc_clear<ui_menu_display_actual>(machine(), container, selected));
92}
93
94//-------------------------------------------------
95//  populate
96//-------------------------------------------------
97
98void ui_menu_directory::populate()
99{
100
101   for (auto & elem : s_folders)
102      item_append(_(elem.name), nullptr, 0, (void *)(FPTR)elem.action);
103
104   item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
105   customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
106}
107
108//-------------------------------------------------
109//  perform our special rendering
110//-------------------------------------------------
111
112void ui_menu_directory::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
113{
114   float width;
115   ui_manager &mui = machine().ui();
116
117   // get the size of the text
118   mui.draw_text_full(container, _("Folders Setup"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
119      DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
120   width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
121   float maxwidth = MAX(width, origx2 - origx1);
122
123   // compute our bounds
124   float x1 = 0.5f - 0.5f * maxwidth;
125   float x2 = x1 + maxwidth;
126   float y1 = origy1 - top;
127   float y2 = origy1 - UI_BOX_TB_BORDER;
128
129   // draw a box
130   mui.draw_outlined_box(container, x1, y1, x2, y2, UI_GREEN_COLOR);
131
132   // take off the borders
133   x1 += UI_BOX_LR_BORDER;
134   x2 -= UI_BOX_LR_BORDER;
135   y1 += UI_BOX_TB_BORDER;
136
137   // draw the text within it
138   mui.draw_text_full(container, _("Folders Setup"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
139      DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
140}
141
142/**************************************************
143    MENU DISPLAY PATH
144**************************************************/
145//-------------------------------------------------
146//  ctor / dtor
147//-------------------------------------------------
148
149ui_menu_display_actual::ui_menu_display_actual(running_machine &machine, render_container *container, int ref)
150   : ui_menu(machine, container), m_ref(ref)
151{
152}
153
154ui_menu_display_actual::~ui_menu_display_actual()
155{
156}
157
158//-------------------------------------------------
159//  handle
160//-------------------------------------------------
161
162void ui_menu_display_actual::handle()
163{
164   // process the menu
165   const ui_menu_event *m_event = process(0);
166   if (m_event != nullptr && m_event->itemref != nullptr && m_event->iptkey == IPT_UI_SELECT)
167      switch ((FPTR)m_event->itemref)
168      {
169         case REMOVE:
170            ui_menu::stack_push(global_alloc_clear<ui_menu_remove_folder>(machine(), container, m_ref));
171            break;
172
173         case ADD_CHANGE:
174            ui_menu::stack_push(global_alloc_clear<ui_menu_add_change_folder>(machine(), container, m_ref));
175            break;
176      }
177}
178
179//-------------------------------------------------
180//  populate
181//-------------------------------------------------
182
183void ui_menu_display_actual::populate()
184{
185   m_tempbuf.assign(_("Current ")).append(_(s_folders[m_ref].name)).append(_(" Folders"));
186   if (machine().ui().options().exists(s_folders[m_ref].option)) {
187      m_searchpath.assign(machine().ui().options().value(s_folders[m_ref].option));
188   }
189   else {
190      m_searchpath.assign(machine().options().value(s_folders[m_ref].option));
191   }
192   path_iterator path(m_searchpath.c_str());
193   std::string curpath;
194   m_folders.clear();
195   while (path.next(curpath, nullptr))
196      m_folders.push_back(curpath);
197
198   item_append((s_folders[m_ref].action == CHANGE) ? _("Change Folder") : _("Add Folder"), nullptr, 0, (void *)ADD_CHANGE);
199
200   if (m_folders.size() > 1)
201      item_append(_("Remove Folder"), nullptr, 0, (void *)REMOVE);
202
203   item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
204   customtop = (m_folders.size() + 1) * machine().ui().get_line_height() + 6.0f * UI_BOX_TB_BORDER;
205}
206
207//-------------------------------------------------
208//  perform our special rendering
209//-------------------------------------------------
210
211void ui_menu_display_actual::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
212{
213   float width, maxwidth = origx2 - origx1;
214   ui_manager &mui = machine().ui();
215   float lineh = mui.get_line_height();
216
217   for (auto & elem : m_folders)
218   {
219      mui.draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
220      width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
221      maxwidth = MAX(maxwidth, width);
222   }
223
224   // get the size of the text
225   mui.draw_text_full(container, m_tempbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
226   width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
227   maxwidth = MAX(width, maxwidth);
228
229   // compute our bounds
230   float x1 = 0.5f - 0.5f * maxwidth;
231   float x2 = x1 + maxwidth;
232   float y1 = origy1 - top;
233   float y2 = y1 + lineh + 2.0f * UI_BOX_TB_BORDER;
234
235   // draw a box
236   mui.draw_outlined_box(container, x1, y1, x2, y2, UI_GREEN_COLOR);
237
238   // take off the borders
239   x1 += UI_BOX_LR_BORDER;
240   x2 -= UI_BOX_LR_BORDER;
241   y1 += UI_BOX_TB_BORDER;
242
243   // draw the text within it
244   mui.draw_text_full(container, m_tempbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
245      DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
246
247   // compute our bounds
248   x1 = 0.5f - 0.5f * maxwidth;
249   x2 = x1 + maxwidth;
250   y1 = y2 + 2.0f * UI_BOX_TB_BORDER;
251   y2 = origy1 - UI_BOX_TB_BORDER;
252
253   // draw a box
254   mui.draw_outlined_box(container, x1, y1, x2, y2, UI_BACKGROUND_COLOR);
255
256   // take off the borders
257   x1 += UI_BOX_LR_BORDER;
258   x2 -= UI_BOX_LR_BORDER;
259   y1 += UI_BOX_TB_BORDER;
260
261   // draw the text within it
262   for (auto & elem : m_folders)
263   {
264      mui.draw_text_full(container, elem.c_str(), x1, y1, x2 - x1, JUSTIFY_LEFT, WRAP_TRUNCATE,
265         DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
266      y1 += lineh;
267   }
268
269}
270
271/**************************************************
272MENU ADD FOLDER
273**************************************************/
274//-------------------------------------------------
275//  ctor / dtor
276//-------------------------------------------------
277
278ui_menu_add_change_folder::ui_menu_add_change_folder(running_machine &machine, render_container *container, int ref) : ui_menu(machine, container)
279{
280   m_ref = ref;
281   m_change = (s_folders[ref].action == CHANGE);
67282   m_search[0] = '\0';
68283
69284   // configure the starting path
r253619r253620
71286   osd_get_full_path(&dst, ".");
72287   m_current_path = dst;
73288   osd_free(dst);
289
290   std::string searchpath;
291   if (machine.ui().options().exists(s_folders[m_ref].option))
292   {
293      searchpath = machine.ui().options().value(s_folders[m_ref].option);
294   }
295   else
296   {
297      searchpath = machine.options().value(s_folders[m_ref].option);
298   }
299
300   path_iterator path(searchpath.c_str());
301   std::string curpath;
302   while (path.next(curpath, nullptr))
303      m_folders.push_back(curpath);
304
74305}
75306
76307ui_menu_add_change_folder::~ui_menu_add_change_folder()
r253619r253620
144375            std::string error_string;
145376            if (m_change)
146377            {
147               if (machine().ui().options().exists(s_folders_entry[m_ref].option))
378               if (machine().ui().options().exists(s_folders[m_ref].option))
148379               {
149                  machine().ui().options().set_value(s_folders_entry[m_ref].option, m_current_path.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
380                  machine().ui().options().set_value(s_folders[m_ref].option, m_current_path.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
150381               }
151               else {
152                  if (strcmp(machine().options().value(s_folders_entry[m_ref].option), m_current_path.c_str()) != 0)
382               else
383               {
384                  if (strcmp(machine().options().value(s_folders[m_ref].option), m_current_path.c_str()) != 0)
153385                  {
154                     machine().options().set_value(s_folders_entry[m_ref].option, m_current_path.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
155                     machine().options().mark_changed(s_folders_entry[m_ref].option);
386                     machine().options().set_value(s_folders[m_ref].option, m_current_path.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
387                     machine().options().mark_changed(s_folders[m_ref].option);
156388                  }
157389               }
158390               machine().datfile().reset_run();
159391            }
160392            else
161393            {
394               m_folders.push_back(m_current_path);
162395               std::string tmppath;
163               if (machine().ui().options().exists(s_folders_entry[m_ref].option)) {
164                  tmppath.assign(machine().ui().options().value(s_folders_entry[m_ref].option)).append(";").append(m_current_path.c_str());
396               for (int x = 0; x < m_folders.size(); ++x)
397               {
398                  tmppath.append(m_folders[x]);
399                  if (x != m_folders.size() - 1)
400                     tmppath.append(";");
165401               }
166               else {
167                  tmppath.assign(machine().options().value(s_folders_entry[m_ref].option)).append(";").append(m_current_path.c_str());
168               }
169               
170               if (machine().ui().options().exists(s_folders_entry[m_ref].option))
402
403               if (machine().ui().options().exists(s_folders[m_ref].option))
171404               {
172                  machine().ui().options().set_value(s_folders_entry[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
405                  machine().ui().options().set_value(s_folders[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
173406               }
174               else {
175                  if (strcmp(machine().options().value(s_folders_entry[m_ref].option), tmppath.c_str()) != 0)
407               else
408               {
409                  if (strcmp(machine().options().value(s_folders[m_ref].option), tmppath.c_str()) != 0)
176410                  {
177                     machine().options().set_value(s_folders_entry[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
178                     machine().options().mark_changed(s_folders_entry[m_ref].option);
411                     machine().options().set_value(s_folders[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
412                     machine().options().mark_changed(s_folders[m_ref].option);
179413                  }
180414               }
181415            }
r253619r253620
279513   ui_manager &mui = machine().ui();
280514   std::string tempbuf[2];
281515   tempbuf[0] = (m_change) ? _("Change)") : _("Add");
282   tempbuf[0].append(" ").append(s_folders_entry[m_ref].name).append(_(" Folder - Search: ")).append(m_search).append("_");
516   tempbuf[0].append(" ").append(_(s_folders[m_ref].name)).append(_(" Folder - Search: ")).append(m_search).append("_");
283517   tempbuf[1] = m_current_path;
284518
285519   // get the size of the text
286   for (auto & elem: tempbuf)
520   for (auto & elem : tempbuf)
287521   {
288522      mui.draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER,
289                                    DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
523         DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
290524      width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
291525      maxwidth = MAX(width, maxwidth);
292526   }
r253619r253620
342576}
343577
344578/**************************************************
345    MENU DIRECTORY
579    MENU REMOVE FOLDER
346580**************************************************/
347581//-------------------------------------------------
348582//  ctor / dtor
349583//-------------------------------------------------
350584
351ui_menu_directory::ui_menu_directory(running_machine &machine, render_container *container) : ui_menu(machine, container)
585ui_menu_remove_folder::ui_menu_remove_folder(running_machine &machine, render_container *container, int ref) : ui_menu(machine, container)
352586{
353}
354
355ui_menu_directory::~ui_menu_directory()
356{
357   save_ui_options(machine());
358   ui_globals::reset = true;
359}
360
361//-------------------------------------------------
362//  handle
363//-------------------------------------------------
364
365void ui_menu_directory::handle()
366{
367   // process the menu
368   const ui_menu_event *m_event = process(0);
369
370   if (m_event != nullptr && m_event->itemref != nullptr && m_event->iptkey == IPT_UI_SELECT)
371   {
372      int ref = (FPTR)m_event->itemref;
373      bool change = (ref == HISTORY_FOLDERS || ref == EXTRAINI_FOLDERS || ref == UI_FOLDERS);
374      ui_menu::stack_push(global_alloc_clear<ui_menu_display_actual>(machine(), container, ref, change));
375   }
376}
377
378//-------------------------------------------------
379//  populate
380//-------------------------------------------------
381
382void ui_menu_directory::populate()
383{
384   item_append("Roms", nullptr, 0, (void *)(FPTR)ROM_FOLDERS);
385   item_append("UI", nullptr, 0, (void *)(FPTR)UI_FOLDERS);
386   item_append("Samples", nullptr, 0, (void *)(FPTR)SAMPLE_FOLDERS);
387   item_append("INIs", nullptr, 0, (void *)(FPTR)INI_FOLDERS);
388   item_append("Artwork", nullptr, 0, (void *)(FPTR)ARTWORK_FOLDERS);
389   item_append("DATs (History, Mameinfo, etc...)", nullptr, 0, (void *)(FPTR)HISTORY_FOLDERS);
390   item_append("Extra INI (Category, etc...)", nullptr, 0, (void *)(FPTR)EXTRAINI_FOLDERS);
391   item_append("Icons", nullptr, 0, (void *)(FPTR)ICON_FOLDERS);
392   item_append("Cheats", nullptr, 0, (void *)(FPTR)CHEAT_FOLDERS);
393   item_append("Snapshots", nullptr, 0, (void *)(FPTR)SNAPSHOT_FOLDERS);
394   item_append("Cabinets", nullptr, 0, (void *)(FPTR)CABINET_FOLDERS);
395   item_append("Flyers", nullptr, 0, (void *)(FPTR)FLYER_FOLDERS);
396   item_append("Titles", nullptr, 0, (void *)(FPTR)TITLE_FOLDERS);
397   item_append("Ends", nullptr, 0, (void *)(FPTR)ENDS_FOLDERS);
398   item_append("PCBs", nullptr, 0, (void *)(FPTR)PCB_FOLDERS);
399   item_append("Marquees", nullptr, 0, (void *)(FPTR)MARQUEES_FOLDERS);
400   item_append("Control Panels", nullptr, 0, (void *)(FPTR)CPANEL_FOLDERS);
401   item_append("Bosses", nullptr, 0, (void *)(FPTR)BOSSES_FOLDERS);
402   item_append("Versus", nullptr, 0, (void *)(FPTR)VERSUS_FOLDERS);
403   item_append("Game Over", nullptr, 0, (void *)(FPTR)GAMEOVER_FOLDERS);
404   item_append("How To", nullptr, 0, (void *)(FPTR)HOWTO_FOLDERS);
405   item_append("Select", nullptr, 0, (void *)(FPTR)SELECT_FOLDERS);
406   item_append("Artwork Preview", nullptr, 0, (void *)(FPTR)ARTPREV_FOLDERS);
407   item_append("Scores", nullptr, 0, (void *)(FPTR)SCORES_FOLDERS);
408   item_append("Logos", nullptr, 0, (void *)(FPTR)LOGO_FOLDERS);
409   item_append("Crosshairs", nullptr, 0, (void *)(FPTR)CROSSHAIR_FOLDERS);
410
411   item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
412   customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
413}
414
415//-------------------------------------------------
416//  perform our special rendering
417//-------------------------------------------------
418
419void ui_menu_directory::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
420{
421   float width;
422   ui_manager &mui = machine().ui();
423
424   // get the size of the text
425   mui.draw_text_full(container, _("Folders Setup"), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE,
426      DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
427   width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
428   float maxwidth = MAX(width, origx2 - origx1);
429
430   // compute our bounds
431   float x1 = 0.5f - 0.5f * maxwidth;
432   float x2 = x1 + maxwidth;
433   float y1 = origy1 - top;
434   float y2 = origy1 - UI_BOX_TB_BORDER;
435
436   // draw a box
437   mui.draw_outlined_box(container, x1, y1, x2, y2, UI_GREEN_COLOR);
438
439   // take off the borders
440   x1 += UI_BOX_LR_BORDER;
441   x2 -= UI_BOX_LR_BORDER;
442   y1 += UI_BOX_TB_BORDER;
443
444   // draw the text within it
445   mui.draw_text_full(container, _("Folders Setup"), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
446      DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
447}
448
449/**************************************************
450    MENU DISPLAY PATH
451**************************************************/
452//-------------------------------------------------
453//  ctor / dtor
454//-------------------------------------------------
455
456ui_menu_display_actual::ui_menu_display_actual(running_machine &machine, render_container *container, int ref, bool _change) : ui_menu(machine, container)
457{
458587   m_ref = ref;
459   m_change = _change;
460}
588   if (machine.ui().options().exists(s_folders[m_ref].option))
589      m_searchpath.assign(machine.ui().options().value(s_folders[m_ref].option));
590   else
591      m_searchpath.assign(machine.options().value(s_folders[m_ref].option));
461592
462ui_menu_display_actual::~ui_menu_display_actual()
463{
464}
465
466//-------------------------------------------------
467//  handle
468//-------------------------------------------------
469
470void ui_menu_display_actual::handle()
471{
472   // process the menu
473   const ui_menu_event *m_event = process(0);
474   if (m_event != nullptr && m_event->itemref != nullptr && m_event->iptkey == IPT_UI_SELECT)
475      switch ((FPTR)m_event->itemref)
476      {
477         case REMOVE_FOLDER:
478            ui_menu::stack_push(global_alloc_clear<ui_menu_remove_folder>(machine(), container, m_ref));
479            break;
480
481         case ADD_FOLDER:
482         case CHANGE_FOLDER:
483            ui_menu::stack_push(global_alloc_clear<ui_menu_add_change_folder>(machine(), container, m_ref, m_change));
484            break;
485      }
486}
487
488//-------------------------------------------------
489//  populate
490//-------------------------------------------------
491
492void ui_menu_display_actual::populate()
493{
494   m_tempbuf.assign(_("Current ")).append(s_folders_entry[m_ref - 1].name).append(_(" Folders"));
495   if (machine().ui().options().exists(s_folders_entry[m_ref - 1].option)) {
496      m_searchpath.assign(machine().ui().options().value(s_folders_entry[m_ref - 1].option));
497   }
498   else {
499      m_searchpath.assign(machine().options().value(s_folders_entry[m_ref - 1].option));
500   }
501593   path_iterator path(m_searchpath.c_str());
502594   std::string curpath;
503   m_folders.clear();
504595   while (path.next(curpath, nullptr))
505596      m_folders.push_back(curpath);
506
507   if (m_change)
508      item_append(_("Change Folder"), nullptr, 0, (void *)CHANGE_FOLDER);
509   else
510      item_append(_("Add Folder"), nullptr, 0, (void *)ADD_FOLDER);
511
512   if (m_folders.size() > 1)
513      item_append(_("Remove Folder"), nullptr, 0, (void *)REMOVE_FOLDER);
514
515   item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
516   customtop = (m_folders.size() + 1) * machine().ui().get_line_height() + 6.0f * UI_BOX_TB_BORDER;
517597}
518598
519//-------------------------------------------------
520//  perform our special rendering
521//-------------------------------------------------
522
523void ui_menu_display_actual::custom_render(void *selectedref, float top, float bottom, float origx1, float origy1, float origx2, float origy2)
524{
525   float width, maxwidth = origx2 - origx1;
526   ui_manager &mui = machine().ui();
527   float lineh = mui.get_line_height();
528
529   for (auto & elem : m_folders)
530   {
531      mui.draw_text_full(container, elem.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_LEFT, WRAP_TRUNCATE, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
532      width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
533      maxwidth = MAX(maxwidth, width);
534   }
535
536   // get the size of the text
537   mui.draw_text_full(container, m_tempbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_TRUNCATE, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
538   width += (2.0f * UI_BOX_LR_BORDER) + 0.01f;
539   maxwidth = MAX(width, maxwidth);
540
541   // compute our bounds
542   float x1 = 0.5f - 0.5f * maxwidth;
543   float x2 = x1 + maxwidth;
544   float y1 = origy1 - top;
545   float y2 = y1 + lineh + 2.0f * UI_BOX_TB_BORDER;
546
547   // draw a box
548   mui.draw_outlined_box(container, x1, y1, x2, y2, UI_GREEN_COLOR);
549
550   // take off the borders
551   x1 += UI_BOX_LR_BORDER;
552   x2 -= UI_BOX_LR_BORDER;
553   y1 += UI_BOX_TB_BORDER;
554
555   // draw the text within it
556   mui.draw_text_full(container, m_tempbuf.c_str(), x1, y1, x2 - x1, JUSTIFY_CENTER, WRAP_TRUNCATE,
557      DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
558
559   // compute our bounds
560   x1 = 0.5f - 0.5f * maxwidth;
561   x2 = x1 + maxwidth;
562   y1 = y2 + 2.0f * UI_BOX_TB_BORDER;
563   y2 = origy1 - UI_BOX_TB_BORDER;
564
565   // draw a box
566   mui.draw_outlined_box(container, x1, y1, x2, y2, UI_BACKGROUND_COLOR);
567
568   // take off the borders
569   x1 += UI_BOX_LR_BORDER;
570   x2 -= UI_BOX_LR_BORDER;
571   y1 += UI_BOX_TB_BORDER;
572
573   // draw the text within it
574   for (auto & elem : m_folders)
575   {
576      mui.draw_text_full(container, elem.c_str(), x1, y1, x2 - x1, JUSTIFY_LEFT, WRAP_TRUNCATE,
577         DRAW_NORMAL, UI_TEXT_COLOR, UI_TEXT_BG_COLOR, nullptr, nullptr);
578      y1 += lineh;
579   }
580
581}
582
583/**************************************************
584    MENU REMOVE FOLDER
585**************************************************/
586//-------------------------------------------------
587//  ctor / dtor
588//-------------------------------------------------
589
590ui_menu_remove_folder::ui_menu_remove_folder(running_machine &machine, render_container *container, int ref) : ui_menu(machine, container)
591{
592   m_ref = ref - 1;
593   if (machine.ui().options().exists(s_folders_entry[m_ref].option)) {
594      m_searchpath.assign(machine.ui().options().value(s_folders_entry[m_ref].option));
595   }
596   else {
597      m_searchpath.assign(machine.options().value(s_folders_entry[m_ref].option));
598   }
599
600}
601
602599ui_menu_remove_folder::~ui_menu_remove_folder()
603600{
604601}
r253619r253620
613610   const ui_menu_event *m_event = process(0);
614611   if (m_event != nullptr && m_event->itemref != nullptr && m_event->iptkey == IPT_UI_SELECT)
615612   {
616      int index = (FPTR)m_event->itemref - 1;
617      std::string tmppath;
618      for (size_t i = 0; i < item.size() - 2; i++)
619         if (i != index)
620            tmppath.append(item[i].text).append(";");
613      std::string tmppath, error_string;
614      for (int x = 0; x < m_folders.size(); ++x)
615      {
616         if (x != selected)
617            tmppath.append(m_folders[x]);
618         if (x < m_folders.size() - 1)
619            tmppath.append(";");
620      }
621621
622      tmppath.substr(0, tmppath.size() - 1);
623      std::string error_string;
624      if (machine().ui().options().exists(s_folders_entry[m_ref].option))
622      if (machine().ui().options().exists(s_folders[m_ref].option))
625623      {
626         machine().ui().options().set_value(s_folders_entry[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
624         machine().ui().options().set_value(s_folders[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE, error_string);
627625      }
628      else {
629         if (strcmp(machine().options().value(s_folders_entry[m_ref].option),tmppath.c_str())!=0)
626      else
627      {
628         if (strcmp(machine().options().value(s_folders[m_ref].option),tmppath.c_str())!=0)
630629         {
631            machine().options().set_value(s_folders_entry[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE, error_string);           
632            machine().options().mark_changed(s_folders_entry[m_ref].option);
630            machine().options().set_value(s_folders[m_ref].option, tmppath.c_str(), OPTION_PRIORITY_CMDLINE, error_string);           
631            machine().options().mark_changed(s_folders[m_ref].option);
633632         }
634633      }
635634
r253619r253620
644643
645644void ui_menu_remove_folder::populate()
646645{
647   path_iterator path(m_searchpath.c_str());
648   std::string curpath;
649646   int folders_count = 0;
647   for (auto & elem : m_folders)
648      item_append(elem.c_str(), nullptr, 0, (void *)(FPTR)++folders_count);
650649
651   while (path.next(curpath, nullptr))
652      item_append(curpath.c_str(), nullptr, 0, (void *)(FPTR)++folders_count);
653
654650   item_append(MENU_SEPARATOR_ITEM, nullptr, 0, nullptr);
655651
656652   customtop = machine().ui().get_line_height() + 3.0f * UI_BOX_TB_BORDER;
r253619r253620
664660{
665661   float width;
666662   ui_manager &mui = machine().ui();
667   std::string tempbuf = std::string(_("Remove ")).append(s_folders_entry[m_ref].name).append(_(" Folder"));
663   std::string tempbuf = std::string(_("Remove ")).append(_(s_folders[m_ref].name)).append(_(" Folder"));
668664
669665   // get the size of the text
670666   mui.draw_text_full(container, tempbuf.c_str(), 0.0f, 0.0f, 1.0f, JUSTIFY_CENTER, WRAP_NEVER, DRAW_NONE, ARGB_WHITE, ARGB_BLACK, &width, nullptr);
trunk/src/emu/ui/dirmenu.h
r253619r253620
2525   virtual void populate() override;
2626   virtual void handle() override;
2727   virtual void custom_render(void *selectedref, float top, float bottom, float x, float y, float x2, float y2) override;
28
29private:
30   enum
31   {
32      ROM_FOLDERS = 1,
33      UI_FOLDERS,
34      SAMPLE_FOLDERS,
35      HISTORY_FOLDERS,
36      INI_FOLDERS,
37      EXTRAINI_FOLDERS,
38      ICON_FOLDERS,
39      CHEAT_FOLDERS,
40      SNAPSHOT_FOLDERS,
41      CABINET_FOLDERS,
42      FLYER_FOLDERS,
43      TITLE_FOLDERS,
44      ENDS_FOLDERS,
45      PCB_FOLDERS,
46      MARQUEES_FOLDERS,
47      CPANEL_FOLDERS,
48      CROSSHAIR_FOLDERS,
49      ARTWORK_FOLDERS,
50      BOSSES_FOLDERS,
51      ARTPREV_FOLDERS,
52      SELECT_FOLDERS,
53      GAMEOVER_FOLDERS,
54      HOWTO_FOLDERS,
55      LOGO_FOLDERS,
56      SCORES_FOLDERS,
57      VERSUS_FOLDERS
58   };
5928};
6029
6130//-------------------------------------------------
r253619r253620
6534class ui_menu_display_actual : public ui_menu
6635{
6736public:
68   ui_menu_display_actual(running_machine &machine, render_container *container, int selectedref, bool _change);
37   ui_menu_display_actual(running_machine &machine, render_container *container, int selectedref);
6938   virtual ~ui_menu_display_actual();
7039   virtual void populate() override;
7140   virtual void handle() override;
r253619r253620
7544   std::string              m_tempbuf, m_searchpath;
7645   std::vector<std::string> m_folders;
7746   int                      m_ref;
78   bool                     m_change;
7947
8048   enum
8149   {
82      ADD_FOLDER = 1,
83      REMOVE_FOLDER,
84      CHANGE_FOLDER
50      ADD_CHANGE = 1,
51      REMOVE,
8552   };
8653};
8754
r253619r253620
10168private:
10269   std::string  m_searchpath;
10370   int          m_ref;
71   std::vector<std::string> m_folders;
10472};
10573
10674//-------------------------------------------------
r253619r253620
11078class ui_menu_add_change_folder : public ui_menu
11179{
11280public:
113   ui_menu_add_change_folder(running_machine &machine, render_container *container, int ref, bool change);
81   ui_menu_add_change_folder(running_machine &machine, render_container *container, int ref);
11482   virtual ~ui_menu_add_change_folder();
11583   virtual void populate() override;
11684   virtual void handle() override;
r253619r253620
12391   std::string  m_current_path;
12492   char         m_search[40];
12593   bool         m_change;
94   std::vector<std::string> m_folders;
12695};
12796
12897#endif /* __UI_DIRMENU_H__ */
trunk/src/emu/ui/ui.cpp
r253619r253620
412412            if (show_mandatory_fileman && machine().image().mandatory_scan(messagebox_text).length() > 0)
413413            {
414414               std::string warning;
415               warning.assign("This driver requires images to be loaded in the following device(s): ").append(messagebox_text.substr(0, messagebox_text.length() - 2));
415               warning.assign(_("This driver requires images to be loaded in the following device(s): ")).append(messagebox_text.substr(0, messagebox_text.length() - 2));
416416               ui_menu_file_manager::force_file_manager(machine(), &machine().render().ui_container(), warning.c_str());
417417            }
418418            break;
r253619r253620
10591059
10601060std::string &ui_manager::disclaimer_string(std::string &str)
10611061{
1062   str.assign("Usage of emulators in conjunction with ROMs you don't own is forbidden by copyright law.\n\n");
1063   strcatprintf(str, "IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n\n", machine().system().description);
1064   str.append("Otherwise, type OK or move the joystick left then right to continue");
1062   str.assign(_("Usage of emulators in conjunction with ROMs you don't own is forbidden by copyright law.\n\n"));
1063   strcatprintf(str, _("IF YOU ARE NOT LEGALLY ENTITLED TO PLAY \"%s\" ON THIS EMULATOR, PRESS ESC.\n\n"), machine().system().description);
1064   str.append(_("Otherwise, type OK or move the joystick left then right to continue"));
10651065   return str;
10661066}
10671067
r253619r253620
10961096   // add a warning if any ROMs were loaded with warnings
10971097   if (machine().rom_load().warnings() > 0)
10981098   {
1099      str.append("One or more ROMs/CHDs for this machine are incorrect. The machine may not run correctly.\n");
1099      str.append(_("One or more ROMs/CHDs for this machine are incorrect. The machine may not run correctly.\n"));
11001100      if (machine().system().flags & WARNING_FLAGS)
11011101         str.append("\n");
11021102   }
r253619r253620
11091109   // if we have at least one warning flag, print the general header
11101110   if ((machine().system().flags & WARNING_FLAGS) || machine().rom_load().knownbad() > 0)
11111111   {
1112      str.append("There are known problems with this machine\n\n");
1112      str.append(_("There are known problems with this machine\n\n"));
11131113
11141114      // add a warning if any ROMs are flagged BAD_DUMP/NO_DUMP
11151115      if (machine().rom_load().knownbad() > 0) {
1116         str.append("One or more ROMs/CHDs for this machine have not been correctly dumped.\n");
1116         str.append(_("One or more ROMs/CHDs for this machine have not been correctly dumped.\n"));
11171117      }
11181118      // add one line per warning flag
11191119      if (machine().system().flags & MACHINE_IMPERFECT_KEYBOARD)
1120         str.append("The keyboard emulation may not be 100% accurate.\n");
1120         str.append(_("The keyboard emulation may not be 100% accurate.\n"));
11211121      if (machine().system().flags & MACHINE_IMPERFECT_COLORS)
1122         str.append("The colors aren't 100% accurate.\n");
1122         str.append(_("The colors aren't 100% accurate.\n"));
11231123      if (machine().system().flags & MACHINE_WRONG_COLORS)
1124         str.append("The colors are completely wrong.\n");
1124         str.append(_("The colors are completely wrong.\n"));
11251125      if (machine().system().flags & MACHINE_IMPERFECT_GRAPHICS)
1126         str.append("The video emulation isn't 100% accurate.\n");
1126         str.append(_("The video emulation isn't 100% accurate.\n"));
11271127      if (machine().system().flags & MACHINE_IMPERFECT_SOUND)
1128         str.append("The sound emulation isn't 100% accurate.\n");
1128         str.append(_("The sound emulation isn't 100% accurate.\n"));
11291129      if (machine().system().flags & MACHINE_NO_SOUND) {
1130         str.append("The machine lacks sound.\n");
1130         str.append(_("The machine lacks sound.\n"));
11311131      }
11321132      if (machine().system().flags & MACHINE_NO_COCKTAIL)
1133         str.append("Screen flipping in cocktail mode is not supported.\n");
1133         str.append(_("Screen flipping in cocktail mode is not supported.\n"));
11341134
11351135      // check if external artwork is present before displaying this warning?
11361136      if (machine().system().flags & MACHINE_REQUIRES_ARTWORK) {
1137         str.append("The machine requires external artwork files\n");
1137         str.append(_("The machine requires external artwork files\n"));
11381138      }
11391139
11401140      if (machine().system().flags & MACHINE_IS_INCOMPLETE )
11411141      {
1142         str.append("This machine was never completed. It may exhibit strange behavior or missing elements that are not bugs in the emulation.\n");
1142         str.append(_("This machine was never completed. It may exhibit strange behavior or missing elements that are not bugs in the emulation.\n"));
11431143      }
11441144
11451145      if (machine().system().flags & MACHINE_NO_SOUND_HW )
11461146      {
1147         str.append("This machine has no sound hardware, MAME will produce no sounds, this is expected behaviour.\n");
1147         str.append(_("This machine has no sound hardware, MAME will produce no sounds, this is expected behaviour.\n"));
11481148      }
11491149
11501150      // if there's a NOT WORKING, UNEMULATED PROTECTION or GAME MECHANICAL warning, make it stronger
r253619r253620
11521152      {
11531153         // add the strings for these warnings
11541154         if (machine().system().flags & MACHINE_UNEMULATED_PROTECTION) {
1155            str.append("The machine has protection which isn't fully emulated.\n");
1155            str.append(_("The machine has protection which isn't fully emulated.\n"));
11561156         }
11571157         if (machine().system().flags & MACHINE_NOT_WORKING) {
1158            str.append("\nTHIS MACHINE DOESN'T WORK. The emulation for this machine is not yet complete. "
1159                  "There is nothing you can do to fix this problem except wait for the developers to improve the emulation.\n");
1158            str.append(_("\nTHIS MACHINE DOESN'T WORK. The emulation for this machine is not yet complete. "
1159                  "There is nothing you can do to fix this problem except wait for the developers to improve the emulation.\n"));
11601160         }
11611161         if (machine().system().flags & MACHINE_MECHANICAL) {
1162            str.append("\nCertain elements of this machine cannot be emulated as it requires actual physical interaction or consists of mechanical devices. "
1163                  "It is not possible to fully play this machine.\n");
1162            str.append(_("\nCertain elements of this machine cannot be emulated as it requires actual physical interaction or consists of mechanical devices. "
1163                  "It is not possible to fully play this machine.\n"));
11641164         }
11651165
11661166         // find the parent of this driver
r253619r253620
11781178               {
11791179                  // this one works, add a header and display the name of the clone
11801180                  if (!foundworking) {
1181                     str.append("\n\nThere are working clones of this machine: ");
1181                     str.append(_("\n\nThere are working clones of this machine: "));
11821182                  }
11831183                  else
11841184                     str.append(", ");
r253619r253620
11921192   }
11931193
11941194   // add the 'press OK' string
1195   str.append("\n\nType OK or move the joystick left then right to continue");
1195   str.append(_("\n\nType OK or move the joystick left then right to continue"));
11961196   return str;
11971197}
11981198
r253619r253620
12511251
12521252      // append the Sound: string
12531253      if (!found_sound)
1254         str.append("\nSound:\n");
1254         str.append(_("\nSound:\n"));
12551255      found_sound = true;
12561256
12571257      // count how many identical sound chips we have
r253619r253620
12791279   }
12801280
12811281   // display screen information
1282   str.append("\nVideo:\n");
1282   str.append(_("\nVideo:\n"));
12831283   screen_device_iterator scriter(machine().root_device());
12841284   int scrcount = scriter.count();
12851285   if (scrcount == 0)
1286      str.append("None\n");
1286      str.append(_("None\n"));
12871287   else
12881288   {
12891289      for (screen_device *screen = scriter.first(); screen != nullptr; screen = scriter.next())
r253619r253620
12951295         }
12961296
12971297         if (screen->screen_type() == SCREEN_TYPE_VECTOR)
1298            str.append("Vector\n");
1298            str.append(_("Vector\n"));
12991299         else
13001300         {
13011301            const rectangle &visarea = screen->visible_area();
r253619r253620
15871587         if (machine.ui_active())
15881588         {
15891589            machine.ui().popup_time(2, "%s\n%s\n%s\n%s\n%s\n%s\n",
1590               "Keyboard Emulation Status",
1590               _("Keyboard Emulation Status"),
15911591               "-------------------------",
1592               "Mode: PARTIAL Emulation",
1593               "UI:   Enabled",
1592               _("Mode: PARTIAL Emulation"),
1593               _("UI:   Enabled"),
15941594               "-------------------------",
1595               "**Use ScrLock to toggle**");
1595               _("**Use ScrLock to toggle**"));
15961596         }
15971597         else
15981598         {
15991599            machine.ui().popup_time(2, "%s\n%s\n%s\n%s\n%s\n%s\n",
1600               "Keyboard Emulation Status",
1600               _("Keyboard Emulation Status"),
16011601               "-------------------------",
1602               "Mode: FULL Emulation",
1603               "UI:   Disabled",
1602               _("Mode: FULL Emulation"),
1603               _("UI:   Disabled"),
16041604               "-------------------------",
1605               "**Use ScrLock to toggle**");
1605               _("**Use ScrLock to toggle**"));
16061606         }
16071607      }
16081608   }
r253619r253620
17461746   {
17471747      if (!machine.options().cheat())
17481748      {
1749         machine.popmessage("Autofire can't be enabled");
1749         machine.popmessage(_("Autofire can't be enabled"));
17501750      }
17511751      else
17521752      {
17531753         bool autofire_toggle = machine.ioport().get_autofire_toggle();
17541754         machine.ioport().set_autofire_toggle(!autofire_toggle);
1755         machine.popmessage("Autofire %s", autofire_toggle ? "Enabled" : "Disabled");
1755         machine.popmessage("Autofire %s", autofire_toggle ? _("Enabled") : _("Disabled"));
17561756      }
17571757   }
17581758
r253619r253620
17851785
17861786   // okay, we're waiting for a key to select a slot; display a message
17871787   if (state == LOADSAVE_SAVE)
1788      machine.ui().draw_message_window(container, "Select position to save to");
1788      machine.ui().draw_message_window(container, _("Select position to save to"));
17891789   else
1790      machine.ui().draw_message_window(container, "Select position to load from");
1790      machine.ui().draw_message_window(container, _("Select position to load from"));
17911791
17921792   // if load/save state sequence is still being pressed, do not read the filename yet
17931793   if (machine.ui().m_load_save_hold) {
r253619r253620
18111811   {
18121812      // display a popup indicating things were cancelled
18131813      if (state == LOADSAVE_SAVE)
1814         machine.popmessage("Save cancelled");
1814         machine.popmessage(_("Save cancelled"));
18151815      else
1816         machine.popmessage("Load cancelled");
1816         machine.popmessage(_("Load cancelled"));
18171817
18181818      // reset the state
18191819      machine.resume();
r253619r253620
18561856   // display a popup indicating that the save will proceed
18571857   if (state == LOADSAVE_SAVE)
18581858   {
1859      machine.popmessage("Save to position %s", filename);
1859      machine.popmessage(_("Save to position %s"), filename);
18601860      machine.schedule_save(filename);
18611861   }
18621862   else
18631863   {
1864      machine.popmessage("Load from position %s", filename);
1864      machine.popmessage(_("Load from position %s"), filename);
18651865      machine.schedule_load(filename);
18661866   }
18671867
r253619r253620
19011901   std::string ui_cancel_text = machine.input().seq_name(machine.ioport().type_seq(IPT_UI_CANCEL, 0, SEQ_TYPE_STANDARD));
19021902
19031903   // assemble the quit message
1904   std::string quit_message = strformat("Are you sure you want to quit?\n\n"
1904   std::string quit_message = strformat(_("Are you sure you want to quit?\n\n"
19051905      "Press ''%s'' to quit,\n"
1906      "Press ''%s'' to return to emulation.",
1906      "Press ''%s'' to return to emulation."),
19071907      ui_select_text.c_str(),
19081908      ui_cancel_text.c_str());
19091909
r253619r253620
19771977   int item;
19781978
19791979   // add overall volume
1980   *tailptr = slider_alloc(machine, "Master Volume", -32, 0, 0, 1, slider_volume, nullptr);
1980   *tailptr = slider_alloc(machine, _("Master Volume"), -32, 0, 0, 1, slider_volume, nullptr);
19811981   tailptr = &(*tailptr)->next;
19821982
19831983   // add per-channel volume
r253619r253620
19881988      INT32 defval = 1000;
19891989
19901990      str.assign(info.stream->input_name(info.inputnum));
1991      str.append(" Volume");
1991      str.append(_(" Volume"));
19921992      *tailptr = slider_alloc(machine, str.c_str(), 0, defval, maxval, 20, slider_mixervol, (void *)(FPTR)item);
19931993      tailptr = &(*tailptr)->next;
19941994   }
r253619r253620
20912091      if (screen->screen_type() == SCREEN_TYPE_VECTOR)
20922092      {
20932093         // add vector control
2094         *tailptr = slider_alloc(machine, "Vector Flicker", 0, 0, 1000, 10, slider_flicker, nullptr);
2094         *tailptr = slider_alloc(machine, _("Vector Flicker"), 0, 0, 1000, 10, slider_flicker, nullptr);
20952095         tailptr = &(*tailptr)->next;
2096         *tailptr = slider_alloc(machine, "Beam Width Minimum", 1, 100, 1000, 1, slider_beam_width_min, nullptr);
2096         *tailptr = slider_alloc(machine, _("Beam Width Minimum"), 1, 100, 1000, 1, slider_beam_width_min, nullptr);
20972097         tailptr = &(*tailptr)->next;
2098         *tailptr = slider_alloc(machine, "Beam Width Maximum", 1, 100, 1000, 1, slider_beam_width_max, nullptr);
2098         *tailptr = slider_alloc(machine, _("Beam Width Maximum"), 1, 100, 1000, 1, slider_beam_width_max, nullptr);
20992099         tailptr = &(*tailptr)->next;
2100         *tailptr = slider_alloc(machine, "Beam Intensity Weight", -1000, 0, 1000, 10, slider_beam_intensity_weight, nullptr);
2100         *tailptr = slider_alloc(machine, _("Beam Intensity Weight"), -1000, 0, 1000, 10, slider_beam_intensity_weight, nullptr);
21012101         tailptr = &(*tailptr)->next;
21022102         break;
21032103      }
r253619r253620
25372537   static char descbuf[256];
25382538
25392539   if (scrcount > 1)
2540      sprintf(descbuf, "Screen '%s'", screen.tag());
2540      sprintf(descbuf, _("Screen '%s'"), screen.tag());
25412541   else
2542      strcpy(descbuf, "Screen");
2542      strcpy(descbuf, _("Screen"));
25432543
25442544   return descbuf;
25452545}
r253619r253620
25572557   if (newval != SLIDER_NOCHANGE)
25582558      field->set_crosshair_scale(float(newval) * 0.001);
25592559   if (str != nullptr)
2560      strprintf(*str,"%s %s %1.3f", "Crosshair Scale", (field->crosshair_axis() == CROSSHAIR_AXIS_X) ? "X" : "Y", float(newval) * 0.001f);
2560      strprintf(*str,"%s %s %1.3f", _("Crosshair Scale"), (field->crosshair_axis() == CROSSHAIR_AXIS_X) ? "X" : "Y", float(newval) * 0.001f);
25612561   return floor(field->crosshair_scale() * 1000.0f + 0.5f);
25622562}
25632563#endif
r253619r253620
25762576   if (newval != SLIDER_NOCHANGE)
25772577      field->set_crosshair_offset(float(newval) * 0.001f);
25782578   if (str != nullptr)
2579      strprintf(*str,"%s %s %1.3f", "Crosshair Offset", (field->crosshair_axis() == CROSSHAIR_AXIS_X) ? "X" : "Y", float(newval) * 0.001f);
2579      strprintf(*str,"%s %s %1.3f", _("Crosshair Offset"), (field->crosshair_axis() == CROSSHAIR_AXIS_X) ? "X" : "Y", float(newval) * 0.001f);
25802580   return field->crosshair_offset();
25812581}
25822582#endif
trunk/src/emu/ui/videoopt.cpp
r253619r253620
5252         break;
5353
5454      /* add a menu item */
55      sprintf(buffer, "Screen #%d", targetnum);
55      sprintf(buffer, _("Screen #%d"), targetnum);
5656      item_append(buffer, nullptr, 0, target);
5757   }
5858}
r253619r253620
200200      case ROT180:    subtext = "180" UTF8_DEGREES;       break;
201201      case ROT270:    subtext = "CCW 90" UTF8_DEGREES;    break;
202202   }
203   item_append("Rotate", subtext, MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_ROTATE);
203   item_append(_("Rotate"), subtext, MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_ROTATE);
204204
205205   /* backdrop item */
206206   enabled = target->backdrops_enabled();
207   item_append("Backdrops", enabled ? "Enabled" : "Disabled", enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_BACKDROPS);
207   item_append(_("Backdrops"), enabled ? _("Enabled") : _("Disabled"), enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_BACKDROPS);
208208
209209   /* overlay item */
210210   enabled = target->overlays_enabled();
211   item_append("Overlays", enabled ? "Enabled" : "Disabled", enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_OVERLAYS);
211   item_append(_("Overlays"), enabled ? _("Enabled") : _("Disabled"), enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_OVERLAYS);
212212
213213   /* bezel item */
214214   enabled = target->bezels_enabled();
215   item_append("Bezels", enabled ? "Enabled" : "Disabled", enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_BEZELS);
215   item_append(_("Bezels"), enabled ? _("Enabled") : _("Disabled"), enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_BEZELS);
216216
217217   /* cpanel item */
218218   enabled = target->cpanels_enabled();
219   item_append("CPanels", enabled ? "Enabled" : "Disabled", enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_CPANELS);
219   item_append(_("CPanels"), enabled ? _("Enabled") : _("Disabled"), enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_CPANELS);
220220
221221   /* marquee item */
222222   enabled = target->marquees_enabled();
223   item_append("Marquees", enabled ? "Enabled" : "Disabled", enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_MARQUEES);
223   item_append(_("Marquees"), enabled ? _("Enabled") : _("Disabled"), enabled ? MENU_FLAG_LEFT_ARROW : MENU_FLAG_RIGHT_ARROW, (void *)VIDEO_ITEM_MARQUEES);
224224
225225   /* cropping */
226226   enabled = target->zoom_to_screen();
227   item_append("View", enabled ? "Cropped" : "Full", enabled ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW, (void *)VIDEO_ITEM_ZOOM);
227   item_append(_("View"), enabled ? _("Cropped") : _("Full"), enabled ? MENU_FLAG_RIGHT_ARROW : MENU_FLAG_LEFT_ARROW, (void *)VIDEO_ITEM_ZOOM);
228228}
229229
230230ui_menu_video_options::~ui_menu_video_options()
trunk/src/emu/ui/viewgfx.cpp
r253619r253620
388388   cellboxbounds.y0 += 3.0f * chheight;
389389
390390   // figure out the title and expand the outer box to fit
391   const char *suffix = palette->indirect_entries() == 0 ? "" : state.palette.which ? " COLORS" : " PENS";
391   const char *suffix = palette->indirect_entries() == 0 ? "" : state.palette.which ? _(" COLORS") : _(" PENS");
392392   sprintf(title, "'%s'%s", palette->tag(), suffix);
393393   titlewidth = ui_font->string_width(chheight, machine.render().ui_aspect(), title);
394394   x0 = 0.0f;


Previous 199869 Revisions Next


© 1997-2024 The MAME Team