GenericMenuView.m 2.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112
  1. /*
  2. =======================================================================================
  3. Copyright (C) 2009-2011 id Software LLC, a ZeniMax Media company. All Right Reserved.
  4. This file is part of the DOOM Classic iOS v2.1 GPL Source Code.
  5. =======================================================================================
  6. */
  7. #import "GenericMenuView.h"
  8. #import "doomAppDelegate.h"
  9. #include "doomiphone.h"
  10. @implementation GenericMenuView
  11. - (void) initialize{
  12. if( scrollView != nil ) {
  13. [scrollView setContentSize:CGSizeMake(
  14. scrollView.bounds.size.width,
  15. CGRectGetMaxY(lastItem.frame)
  16. )];
  17. }
  18. episodeSelection = -1;
  19. [ nextButton setEnabled: NO ];
  20. [ nextLabel setEnabled: NO ];
  21. }
  22. - (void)awakeFromNib {
  23. [self initialize];
  24. }
  25. - (id) initWithCoder:(NSCoder *)aCoder{
  26. if(self = [super initWithCoder:aCoder] ) {
  27. [self initialize];
  28. }
  29. return self;
  30. }
  31. - (id) initWithFrame:(CGRect)rect{
  32. if(self = [super initWithFrame:rect] ) {
  33. [self initialize];
  34. }
  35. return self;
  36. }
  37. - (IBAction) BackToMain {
  38. [gAppDelegate MainMenu];
  39. Sound_StartLocalSound( "iphone/controller_down_01_SILENCE.wav" );
  40. }
  41. - (IBAction) NextToMissions {
  42. [gAppDelegate SelectEpisode: episodeSelection ];
  43. Sound_StartLocalSound( "iphone/controller_down_01_SILENCE.wav" );
  44. }
  45. - (IBAction) SelectEpisode1 {
  46. [ nextButton setEnabled: YES ];
  47. [ nextLabel setEnabled: YES ];
  48. episodeSelection = 0;
  49. [ epi1Button setEnabled: NO ];
  50. [ epi2Button setEnabled: YES ];
  51. [ epi3Button setEnabled: YES ];
  52. [ epi4Button setEnabled: YES ];
  53. }
  54. - (IBAction) SelectEpisode2 {
  55. [ nextButton setEnabled: YES ];
  56. [ nextLabel setEnabled: YES ];
  57. episodeSelection = 1;
  58. [ epi1Button setEnabled: YES ];
  59. [ epi2Button setEnabled: NO ];
  60. [ epi3Button setEnabled: YES ];
  61. [ epi4Button setEnabled: YES ];
  62. }
  63. - (IBAction) SelectEpisode3 {
  64. [ nextButton setEnabled: YES ];
  65. [ nextLabel setEnabled: YES ];
  66. episodeSelection = 2;
  67. [ epi1Button setEnabled: YES ];
  68. [ epi2Button setEnabled: YES ];
  69. [ epi3Button setEnabled: NO ];
  70. [ epi4Button setEnabled: YES ];
  71. }
  72. - (IBAction) SelectEpisode4 {
  73. [ nextButton setEnabled: YES ];
  74. [ nextLabel setEnabled: YES ];
  75. episodeSelection = 3;
  76. [ epi1Button setEnabled: YES ];
  77. [ epi2Button setEnabled: YES ];
  78. [ epi3Button setEnabled: YES ];
  79. [ epi4Button setEnabled: NO ];
  80. }
  81. @end