- (id)init;
/**
- * Releases the resources acquired for the catalog.
- */
-- (void)dispose;
-
-/**
* If self.enabled is YES and the given event has one or more sounds
* corresponding to it in the catalog, plays one of those sounds, chosen at
* random.
@end
-/**
- * This is a helper function for AngbandSoundCatalog's sharedSounds and
- * clearSharedSounds. Implement a Singleton pattern.
- */
-static __strong AngbandSoundCatalog** get_shared_sounds(void)
-{
- static __strong AngbandSoundCatalog* catalog = nil;
-
- return &catalog;
-}
-
@implementation AngbandSoundCatalog
- (id)init {
return self;
}
-- (void)dispose {
- self->soundsByPath = nil;
- self->soundArraysByEvent = nil;
-}
-
- (void)playSound:(int)event {
if (! self.enabled) {
return;
*/
static void hook_quit(const char * str)
{
+ for (int i = ANGBAND_TERM_MAX - 1; i >= 0; --i) {
+ if (angband_term[i]) {
+ term_nuke(angband_term[i]);
+ }
+ }
+ [AngbandSoundCatalog clearSharedSounds];
+ [AngbandContext setDefaultFont:nil];
plog(str);
exit(0);
}
/* Handle pending events (most notably update) and flush input */
Term_flush();
- /* Prompt the user */
- int message_row = (Term->hgt - 23) / 5 + 23;
+ /*
+ * Prompt the user; assume the splash screen is 80 x 23 and position
+ * relative to that rather than center based on the full size of the
+ * window.
+ */
+ int message_row = 23;
Term_erase(0, message_row, 255);
put_str(
#ifdef JP
- "['ファイル' メニューから '新' または '開く' を選択します]",
- message_row, (Term->wid - 57) / 2
+ "['ファイル' メニューから '新規' または '開く' を選択します]",
+ message_row, (80 - 59) / 2
#else
"[Choose 'New' or 'Open' from the 'File' menu]",
- message_row, (Term->wid - 45) / 2
+ message_row, (80 - 45) / 2
#endif
);
Term_fresh();