This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class TerrainStitcher extends EditorWindow { | |
| public var terrain1: Terrain = null; | |
| public var terrain2: Terrain = null; | |
| public var options: String[] = ["X", "Z"]; | |
| public var index: int = 0; | |
| @MenuItem ("Tools/Terrain stitcher") | |
| static function ShowWindow () { | |
| EditorWindow.GetWindow (TerrainStitcher); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <Preferences/PSTableCell.h> | |
| #import <Preferences/PSSpecifier.h> | |
| @interface CSPVersionCell : PSTableCell | |
| @end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * @Author: Dana Buehre <creaturesurvive> | |
| * @Date: 11-09-2017 1:22:14 | |
| * @Email: dbuehre@me.com | |
| * @Filename: CSPValueCell.h | |
| * @Last modified by: creaturesurvive | |
| * @Last modified time: 16-09-2017 10:45:22 | |
| * @Copyright: Copyright © 2014-2017 CreatureSurvive | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @interface CSPListController : PSListController | |
| @end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| %hook UIImage | |
| // you should not include the file extention or scale in the file name for this to work | |
| // I have not tested this, but it should work for any image being loaded from the bundle | |
| // baseNameOfLaunchscreenImage@2x.png -> baseNameOfLaunchscreenImage | |
| + (UIImage *)imageNamed: (NSString *)name { | |
| if ([name containsString:@"baseNameOfLaunchscreenImage"]) { | |
| return [UIImage imageWithContentsOfFile:@"/User/Documents/CustomLaunchImage.png"]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (void)applicationDidFinishLaunching: (UIApplication *)application { | |
| %orig; | |
| NSLog(@"registering for noctis notifications"); | |
| NSNotificationCenter *center = [NSNotificationCenter defaultCenter]; | |
| // with SEL callbacks | |
| [center addObserver:self selector:@selector(__didRecieveNoctisNotification:) name:@"com.laughingquoll.noctis.enablenotification" object:nil]; | |
| [center addObserver:self selector:@selector(__didRecieveNoctisNotification:) name:@"com.laughingquoll.noctis.disablenotification" object:nil]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #define kDefaultFontSize 24.0 | |
| myTextView.text = @"Some long string that will be in the UITextView"; | |
| myTextView.font = [UIFont systemFontOfSize:kDefaultFontSize]; | |
| //setup text resizing check here | |
| if (myTextView.contentSize.height > myTextView.frame.size.height) { | |
| int fontIncrement = 1; | |
| while (myTextView.contentSize.height > myTextView.frame.size.height) { | |
| myTextView.font = [UIFont systemFontOfSize:kDefaultFontSize-fontIncrement]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| / usage: | |
| / UIView * myView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 375, 375)]; | |
| / UIView * myContainer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 60, 60)]; | |
| / CGFloat scale = [self scaleForSize:myView.bounds.size fitToSize:myContainer.bounds.size]; | |
| / myView.transform = CGAffineTransformScale(CGAffineTransformIdentity, scale, scale); | |
| / [myContainer addSubview:myView]; | |
| */ | |
| - (CGFloat)scaleForSize:(CGSize)source fitToSize:(CGSize)destination { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| * usage: | |
| * [self objectForKeypath:@"someKey.3.someNestedKey.2" inJSON:myJSONObject]; | |
| */ | |
| - (id)objectForKeypath:(NSString *)keypath inJSON:(NSData *)json { | |
| if (!keypath || !json) {return nil;} | |
| __block NSInteger depth = 0; | |
| NSArray *keys = [keypath componentsSeparatedByString:@"."]; | |
| id result = [NSJSONSerialization JSONObjectWithData:json options:kNilOptions error:nil]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // NSString+URLsFromString.h | |
| // | |
| @interface NSString (URLsFromString) | |
| + (NSArray <NSURL*> *)URLsFromString:(NSString *)string; | |
| - (NSArray <NSURL*> *)URLs; | |
| @end |