Previous 199869 Revisions Next

r34346 Sunday 11th January, 2015 at 14:24:46 UTC by Fabio Priuli
ui: added "[Internal]" string to slot options that are not user-configurable
and fixed some internal options displayed as "scrollable". [Fabio Priuli]
[src/emu/ui]miscmenu.c

trunk/src/emu/ui/miscmenu.c
r242857r242858
120120   else
121121   {
122122      astring temp;
123      current = machine().options().main_value(temp,slot->device().tag()+1);
123      current = machine().options().main_value(temp, slot->device().tag() + 1);
124124   }
125125
126126   return slot->option(current);
r242857r242858
154154-------------------------------------------------*/
155155int ui_menu_slot_devices::slot_get_length(device_slot_interface *slot)
156156{
157   const device_slot_option *current = slot_get_current_option(slot);
158
159157   int val = 0;
160158   for (const device_slot_option *option = slot->first_option(); option != NULL; option = option->next())
161      if (option == current || option->selectable())
159      if (option->selectable())
162160         val++;
163161
164162   return val;
r242857r242858
203201-------------------------------------------------*/
204202const char *ui_menu_slot_devices::slot_get_option(device_slot_interface *slot, int index)
205203{
206   const device_slot_option *current = slot_get_current_option(slot);
207
208   if (index >= 0 )
204   if (index >= 0)
209205   {
210206      int val = 0;
211207      for (const device_slot_option *option = slot->first_option(); option != NULL; option = option->next())
r242857r242858
213209         if (val == index)
214210            return option->name();
215211
216         if (option == current || option->selectable())
212         if (option->selectable())
217213            val++;
218214      }
219215   }
r242857r242858
251247   {
252248      /* record the menu item */
253249      const device_slot_option *option = slot_get_current_option(slot);
250      astring opt_name;
251      if (option == NULL)
252         opt_name.cpy("------");
253      else
254      {
255         opt_name.cpy(option->name());
256         if (slot->fixed() || slot_get_length(slot) == 0)
257            opt_name.cat(" [internal]");
258      }
254259
255      item_append(slot->device().tag()+1, option == NULL ? "------" : option->name(), (slot->fixed() || slot_get_length(slot) == 0) ? 0 : (MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW), (void *)slot);
260      item_append(slot->device().tag() + 1, opt_name, (slot->fixed() || slot_get_length(slot) == 0) ? 0 : (MENU_FLAG_LEFT_ARROW | MENU_FLAG_RIGHT_ARROW), (void *)slot);
256261   }
257262   item_append(MENU_SEPARATOR_ITEM, NULL, 0, NULL);
258263   item_append("Reset",  NULL, 0, (void *)1);


Previous 199869 Revisions Next


© 1997-2024 The MAME Team