(Scenario Editor is unaffected by this commit.) - Menubar converted to a .xib file - Don't include the Info.plist in "Copy Files" stage - Several more dialogs converted; as before, the source resources have had their resource name changed to the new filename - One more converted STR# has been included There were several functions in the PC Editor code that also existed in the BoE game code. I've moved these into the pc.editors.cpp file, so that there's only one copy of each. - display_alchemy() functions changed signatures - moved keyToChar() function into a common file (winutil) - Several constants and globals moved to pc.editors.cpp Supporting changes to dialog framework: - New formatting option to set the frame style; this because the PC editor uses a different frame style in some contexts - Added global default dialog background setting --> This was necessary to correctly set the default text colour --> Will also be needed for the scenario editor, which uses a different default background Other changes: - Add option to load_scenario to skip loading the strings - Fix for crash in soundtool in the event of initialization before playing the first sound
39 lines
1.1 KiB
Plaintext
39 lines
1.1 KiB
Plaintext
//
|
|
// pc.appleevents.mm
|
|
// BoE
|
|
//
|
|
// Created by Celtic Minstrel on 14-04-16.
|
|
//
|
|
//
|
|
|
|
#include <Cocoa/Cocoa.h>
|
|
|
|
extern bool verify_restore_quit(bool mode);
|
|
extern bool All_Done;
|
|
|
|
typedef NSAppleEventDescriptor AEDescr;
|
|
|
|
@interface AppleEventHandler : NSObject
|
|
-(void)handleOpenDoc:(AEDescr*)theAppleEvent withReply: (AEDescr*)reply;
|
|
-(void)handleQuit:(AEDescr*)theAppleEvent withReply: (AEDescr*)reply;
|
|
@end
|
|
|
|
void set_up_apple_events() {
|
|
AppleEventHandler* aeHandler = [[AppleEventHandler alloc] init];
|
|
NSAppleEventManager* AEmgr = [NSAppleEventManager sharedAppleEventManager];
|
|
[AEmgr setEventHandler: aeHandler andSelector: @selector(handleOpenDoc:withReply:)
|
|
forEventClass: kCoreEventClass andEventID: kAEOpenDocuments];
|
|
[AEmgr setEventHandler: aeHandler andSelector: @selector(handleQuit:withReply:)
|
|
forEventClass: kCoreEventClass andEventID: kAEQuitApplication];
|
|
}
|
|
|
|
@implementation AppleEventHandler
|
|
-(void)handleOpenDoc:(AEDescr*)theAppleEvent withReply: (AEDescr*)reply {
|
|
// TODO: Handle this
|
|
}
|
|
-(void)handleQuit:(AEDescr*)theAppleEvent withReply: (AEDescr*)reply {
|
|
All_Done = verify_restore_quit(0);
|
|
}
|
|
@end
|
|
|