Skip to content

Commit

Permalink
Merge pull request #383 from yoshisuga/fix-tvos
Browse files Browse the repository at this point in the history
  • Loading branch information
ToddLa authored Mar 27, 2022
2 parents b4a490d + a54d7c7 commit e814663
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions xcode/MAME4iOS/ChooseGameController.m
Original file line number Diff line number Diff line change
Expand Up @@ -2177,6 +2177,7 @@ - (NSArray*)menuActionsForItemAtIndexPath:(NSIndexPath *)indexPath {
]];

// Paste image
#if !TARGET_OS_TV
if (!game.gameIsFake && UIPasteboard.generalPasteboard.hasImages) {
actions = [actions arrayByAddingObjectsFromArray:@[
[UIAlertAction actionWithTitle:@"Paste Image" symbol:@"photo" style:UIAlertActionStyleDefault handler:^(id action) {
Expand All @@ -2193,6 +2194,7 @@ - (NSArray*)menuActionsForItemAtIndexPath:(NSIndexPath *)indexPath {
}]
]];
}
#endif

CommandLineArgsHelper *cmdLineArgsHelper = [[CommandLineArgsHelper alloc] initWithGameInfo:game];
NSString *cmdLineActionTitle = [cmdLineArgsHelper commandLineArgs] != nil ? @"Edit Arguments..." : @"Add Arguments...";
Expand Down
10 changes: 10 additions & 0 deletions xcode/MAME4iOS/CommandLineArgsHelper.swift
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
// Copyright © 2022 MAME4iOS Team. All rights reserved.
//

import Darwin

extension NSDictionary {
var gameInfoCommandLineArgsTitle: String {
"\(gameName)-\(gameDriver)"
Expand Down Expand Up @@ -58,7 +60,11 @@ class CommandLineArgsViewController: UIViewController {
textView.layer.borderWidth = 1.0
textView.layer.borderColor = UIColor.label.cgColor
textView.layer.cornerRadius = 12.0
#if os(tvOS)
textView.font = UIFont(name: "Courier-Bold", size: 18)
#else
textView.font = UIFont(name: "Courier-Bold", size: UIFont.systemFontSize)
#endif
textView.textColor = .label
textView.textContainerInset = UIEdgeInsets(top: 16, left: 8, bottom: 16, right: 8)
textView.autocorrectionType = .no
Expand Down Expand Up @@ -92,7 +98,11 @@ class CommandLineArgsViewController: UIViewController {
}

private func setupViews() {
#if os(tvOS)
view.backgroundColor = .black
#else
view.backgroundColor = .systemBackground
#endif
view.addSubview(helpLabel)
helpLabel.topAnchor.constraint(equalTo: view.safeAreaLayoutGuide.topAnchor, constant: 20).isActive = true
helpLabel.leadingAnchor.constraint(equalTo: view.safeAreaLayoutGuide.leadingAnchor, constant: 16).isActive = true
Expand Down
2 changes: 2 additions & 0 deletions xcode/MAME4iOS/MAME4iOS.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
926C770A21F271A700103EDE /* ListOptionController.m in Sources */ = {isa = PBXBuildFile; fileRef = CE90575B166A89D000653872 /* ListOptionController.m */; };
926C771D21F5034100103EDE /* TVInputOptionsController.m in Sources */ = {isa = PBXBuildFile; fileRef = 926C771C21F5034100103EDE /* TVInputOptionsController.m */; };
928F7B2D27D5F18E00377C40 /* CommandLineArgsHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 928F7B2C27D5F18E00377C40 /* CommandLineArgsHelper.swift */; };
928F7B2E27F0223100377C40 /* CommandLineArgsHelper.swift in Sources */ = {isa = PBXBuildFile; fileRef = 928F7B2C27D5F18E00377C40 /* CommandLineArgsHelper.swift */; };
92A5332321EB57F00089FBB9 /* Options.m in Sources */ = {isa = PBXBuildFile; fileRef = 92A5332121EB57F00089FBB9 /* Options.m */; };
92A5332421EB57F00089FBB9 /* Options.m in Sources */ = {isa = PBXBuildFile; fileRef = 92A5332121EB57F00089FBB9 /* Options.m */; };
92A5332521EBC7F40089FBB9 /* KeyboardView.m in Sources */ = {isa = PBXBuildFile; fileRef = CE8D87DC1653121200685BC4 /* KeyboardView.m */; };
Expand Down Expand Up @@ -1263,6 +1264,7 @@
92A533C121EBDBAD0089FBB9 /* GCDWebServerURLEncodedFormRequest.m in Sources */,
92ECB91921EAD57900D1E3D0 /* UIView+Toast.m in Sources */,
EF19F22D235D1BDF00C8EE7F /* ChooseGameController.m in Sources */,
928F7B2E27F0223100377C40 /* CommandLineArgsHelper.swift in Sources */,
EF8EAA89244F7F5D00DA02BB /* SteamController.m in Sources */,
92A533A621EBDBAD0089FBB9 /* GCDWebServerResponse.m in Sources */,
92A533D921EE601D0089FBB9 /* WebServer.m in Sources */,
Expand Down

0 comments on commit e814663

Please sign in to comment.