project_files/HedgewarsMobile/Classes/HelpPageLobbyViewController.m
author Wuzzy <Wuzzy2@mail.ru>
Mon, 08 Apr 2019 17:59:38 +0200
changeset 14776 97a36fb44123
parent 12877 00215a7ec5f5
permissions -rw-r--r--
WxW: Hide crate radar when no active hog
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
11120
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     1
/*
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     2
 * Hedgewars-iOS, a Hedgewars port for iOS devices
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     3
 * Copyright (c) 2009-2012 Vittorio Giovara <vittorio.giovara@gmail.com>
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     4
 *
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     5
 * This program is free software; you can redistribute it and/or modify
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     6
 * it under the terms of the GNU General Public License as published by
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     7
 * the Free Software Foundation; version 2 of the License
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     8
 *
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
     9
 * This program is distributed in the hope that it will be useful,
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    12
 * GNU General Public License for more details.
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    13
 *
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    14
 * You should have received a copy of the GNU General Public License
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    15
 * along with this program; if not, write to the Free Software
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    16
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    17
 */
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    18
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    19
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    20
#import "HelpPageLobbyViewController.h"
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    21
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    22
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    23
@implementation HelpPageLobbyViewController
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    24
@synthesize scrollView;
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    25
12877
00215a7ec5f5 - BIG CHANGE: Convert iOS project to use ARC
antonc27 <antonc27@mail.ru>
parents: 11122
diff changeset
    26
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
11120
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    27
    return rotationManager(interfaceOrientation);
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    28
}
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    29
12877
00215a7ec5f5 - BIG CHANGE: Convert iOS project to use ARC
antonc27 <antonc27@mail.ru>
parents: 11122
diff changeset
    30
- (void)didReceiveMemoryWarning {
11120
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    31
    [super didReceiveMemoryWarning];
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    32
    self.scrollView = nil;
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    33
}
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    34
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    35
// on iPhone the XIBs contain UIScrollView
12877
00215a7ec5f5 - BIG CHANGE: Convert iOS project to use ARC
antonc27 <antonc27@mail.ru>
parents: 11122
diff changeset
    36
- (void)viewDidLoad {
11120
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    37
    if (IS_IPAD() == NO){
11121
182a42b79610 - HelpPageLobbyViewController updated: various UI fixes, autorotation fixes, help bubbles for iPad grouped
antonc27 <antonc27@mail.ru>
parents: 11120
diff changeset
    38
        scrollView.contentSize = CGSizeMake(self.view.frame.size.width, 650);
11120
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    39
        scrollView.maximumZoomScale = 4.0;
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    40
        scrollView.minimumZoomScale = 0.75;
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    41
        scrollView.clipsToBounds = YES;
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    42
        scrollView.delegate = self;
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    43
    }
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    44
    [super viewDidLoad];
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    45
}
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    46
12877
00215a7ec5f5 - BIG CHANGE: Convert iOS project to use ARC
antonc27 <antonc27@mail.ru>
parents: 11122
diff changeset
    47
- (IBAction)dismiss {
11122
2b4e89e5203b - Fix for show/hide helpPage animations
antonc27 <antonc27@mail.ru>
parents: 11121
diff changeset
    48
    [UIView animateWithDuration:0.5 animations:^{
2b4e89e5203b - Fix for show/hide helpPage animations
antonc27 <antonc27@mail.ru>
parents: 11121
diff changeset
    49
        self.view.alpha = 0;
2b4e89e5203b - Fix for show/hide helpPage animations
antonc27 <antonc27@mail.ru>
parents: 11121
diff changeset
    50
    } completion:^(BOOL finished){
2b4e89e5203b - Fix for show/hide helpPage animations
antonc27 <antonc27@mail.ru>
parents: 11121
diff changeset
    51
        [self.view performSelector:@selector(removeFromSuperview) withObject:nil afterDelay:0];
2b4e89e5203b - Fix for show/hide helpPage animations
antonc27 <antonc27@mail.ru>
parents: 11121
diff changeset
    52
    }];
11120
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    53
}
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    54
83c0d96f86ea - HelpPageLobbyViewController returned to project (back from 2012!), also help bubble images added
antonc27 <antonc27@mail.ru>
parents:
diff changeset
    55
@end