mirror of
https://github.com/libretro/RetroArch
synced 2025-02-24 00:39:54 +00:00
(iOS) Get rid of apple_get_core_display_name
This commit is contained in:
parent
8cd0e5130b
commit
1754acb500
@ -52,7 +52,6 @@ extern void apple_stop_iteration();
|
||||
// utility.m
|
||||
extern void apple_display_alert(const char *message, const char *title);
|
||||
extern NSString *apple_get_core_id(const core_info_t *core);
|
||||
extern NSString *apple_get_core_display_name(NSString *core_id);
|
||||
|
||||
@interface RANumberFormatter : NSNumberFormatter
|
||||
#ifdef IOS
|
||||
|
@ -51,12 +51,6 @@ NSString *apple_get_core_id(const core_info_t *core)
|
||||
return BOXSTRING(core_info_get_id(core, buf, sizeof(buf)));
|
||||
}
|
||||
|
||||
NSString *apple_get_core_display_name(NSString *core_id)
|
||||
{
|
||||
const core_info_t *core = (const core_info_t*)core_info_list_get_by_id(core_id.UTF8String);
|
||||
return core ? BOXSTRING(core->display_name) : core_id;
|
||||
}
|
||||
|
||||
// Number formatter class for setting strings
|
||||
@implementation RANumberFormatter
|
||||
- (id)initWithSetting:(const rarch_setting_t*)setting
|
||||
|
@ -531,7 +531,16 @@ static void RunActionSheet(const char* title, const struct string_list* items, U
|
||||
[self.sections addObject:[NSArray arrayWithObjects:BOXSTRING("Content"),
|
||||
[RAMenuItemBasic itemWithDescription:BOXSTRING("Choose Core")
|
||||
action:^{ [weakSelf chooseCoreWithPath:nil]; }
|
||||
detail:^{ return weakSelf.core ? apple_get_core_display_name(weakSelf.core) : BOXSTRING("Auto Detect"); }],
|
||||
detail:^{
|
||||
const core_info_t *core = (const core_info_t*)core_info_list_get_by_id(weakSelf.core.UTF8String);
|
||||
|
||||
if (weakSelf.core)
|
||||
{
|
||||
return core ? BOXSTRING(core->display_name) : BOXSTRING(weakSelf.core.UTF8String);
|
||||
}
|
||||
else
|
||||
return BOXSTRING("Auto Detect");
|
||||
}],
|
||||
[RAMenuItemBasic itemWithDescription:BOXSTRING("Load Content") action:^{ [weakSelf loadGame]; }],
|
||||
[RAMenuItemBasic itemWithDescription:BOXSTRING("Load Content (History)") action:^{ [weakSelf loadHistory]; }],
|
||||
nil]];
|
||||
@ -738,7 +747,8 @@ static void RunActionSheet(const char* title, const struct string_list* items, U
|
||||
_isCustom = core_info_has_custom_config(core.UTF8String);
|
||||
if (_isCustom)
|
||||
{
|
||||
self.title = apple_get_core_display_name(core);
|
||||
const core_info_t *tmp = (const core_info_t*)core_info_list_get_by_id(core.UTF8String);
|
||||
self.title = tmp ? BOXSTRING(tmp->display_name) : BOXSTRING(core.UTF8String);
|
||||
|
||||
_pathToSave = BOXSTRING(core_info_get_custom_config(core.UTF8String, buffer, sizeof(buffer)));
|
||||
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemTrash target:self action:@selector(deleteCustom)];
|
||||
@ -1025,12 +1035,13 @@ static bool copy_config(const char *src_path, const char *dst_path)
|
||||
- (UITableViewCell*)cellForTableView:(UITableView*)tableView
|
||||
{
|
||||
UITableViewCell *result;
|
||||
const core_info_t *core = (const core_info_t*)core_info_list_get_by_id(self.core.UTF8String);
|
||||
static NSString* const cell_id = @"RAMenuItemCoreList";
|
||||
|
||||
if (!(result = [tableView dequeueReusableCellWithIdentifier:cell_id]))
|
||||
result = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cell_id];
|
||||
|
||||
result.textLabel.text = apple_get_core_display_name(self.core);
|
||||
result.textLabel.text = core ? BOXSTRING(core->display_name) : BOXSTRING(self.core.UTF8String);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user