2010-11-24 05:43:16 +00:00
|
|
|
#include "draw.h"
|
|
|
|
#include "key.h"
|
|
|
|
#include "sound.h"
|
|
|
|
|
|
|
|
#include "CrosshairView.h"
|
|
|
|
|
|
|
|
@implementation CrosshairView
|
|
|
|
{
|
2011-02-14 14:08:18 +00:00
|
|
|
CrosshairCvar *crosshair;
|
2010-11-24 05:43:16 +00:00
|
|
|
}
|
|
|
|
|
2011-02-14 14:08:18 +00:00
|
|
|
-(id)initWithBounds:(Rect)aRect :(CrosshairCvar*)_crosshair
|
2010-11-24 05:43:16 +00:00
|
|
|
{
|
|
|
|
self = [self initWithBounds:aRect];
|
|
|
|
crosshair = _crosshair;
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
-(void) next
|
|
|
|
{
|
|
|
|
[crosshair next];
|
|
|
|
S_LocalSound ("misc/menu2.wav");
|
|
|
|
}
|
|
|
|
|
|
|
|
-(void) draw
|
|
|
|
{
|
|
|
|
Draw_Fill (xabs, yabs, xlen, ylen, 0);
|
|
|
|
Draw_Crosshair ([crosshair crosshair], xabs + xlen / 2, yabs + ylen / 2);
|
|
|
|
}
|
|
|
|
|
2011-03-25 07:46:32 +00:00
|
|
|
- (int) keyEvent:(int)key unicode:(int)unicode down:(int)down
|
2010-11-24 05:43:16 +00:00
|
|
|
{
|
|
|
|
switch (key) {
|
|
|
|
case QFK_RETURN:
|
2021-11-08 02:20:04 +00:00
|
|
|
//case QFM_BUTTON1:
|
2010-11-24 05:43:16 +00:00
|
|
|
[self next];
|
|
|
|
return 1;
|
|
|
|
default:
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@end
|