extern World *currentWorld;
extern Player *player;
-
extern void mainLoop(void);
+ void waitForDialog(void){
+ do{
+ mainLoop();
+ }while(ui::dialogBoxExists);
+ }
+
int compTestQuest(NPC *speaker){
- ui::dialogBox(speaker->name,"Ooo, that's a nice quest you got there. Lemme finish that for you ;).");
+ ui::dialogBox(speaker->name,NULL,"Ooo, that's a nice quest you got there. Lemme finish that for you ;).");
player->qh.finish("Test",player);
return 0;
}
case 'y':
case 'p':
case 'j':y-=fontSize/4;break;
+ case 'Q':y-=fontSize/5;break;
default:break;
}
+
glBegin(GL_QUADS);
glColor3ub(255,255,255);
glTexCoord2f(0,1);glVertex2f(x,y);
glColor3ub(0,0,0);
x=player->loc.x-SCREEN_WIDTH/2+HLINE*8;
y=(offset.y+SCREEN_HEIGHT/2)-HLINE*8;
+
glRectf(x,y,x+SCREEN_WIDTH-HLINE*16,y-SCREEN_HEIGHT/4);
- char *rtext;
+
rtext=typeOut(dialogBoxText);
+
setFontSize(16);
putString(x+HLINE,y-fontSize-HLINE,rtext);
+
+ for(i=0;i<dialogOptCount;i++){
+ if(mouse.x > dialogOptLoc[i][0] &&
+ mouse.x < dialogOptLoc[i][2] &&
+ mouse.y > dialogOptLoc[i][1] &&
+ mouse.y < dialogOptLoc[i][1] + 16 ){ // fontSize
+ setFontColor(255,255,0);
+ }else setFontColor(255,255,255);
+ dialogOptLoc[i][0]=x+HLINE;
+ dialogOptLoc[i][1]=y-SCREEN_HEIGHT/4+(fontSize+HLINE)*(i+1);
+ dialogOptLoc[i][2]=
+
+ putString(x+HLINE,y-SCREEN_HEIGHT/4+(fontSize+HLINE)*(i+1),dialogOptText[i]);
+ }
+ setFontColor(255,255,255);
}
+
setFontSize(14);
putText(((SCREEN_WIDTH/2)+offset.x)-125,(offset.y+SCREEN_HEIGHT/2)-fontSize,"Health: %u/%u",player->health>0?(unsigned)player->health:0,
+
(unsigned)player->maxHealth);
if(player->alive){
glColor3ub(255,0,0);
((SCREEN_WIDTH/2+offset.x)-125)+((player->health/player->maxHealth)*100),
(offset.y+SCREEN_HEIGHT/2)-32+12);
}
+
+ /*
+ * Lists all of the quests the player has
+ */
+ putText(((SCREEN_WIDTH/2)+offset.x)-125,(offset.y+SCREEN_HEIGHT/2)-fontSize*4, "Current Quests:",NULL);
+
+ for(auto &c : player->qh.current){
+ putText(((SCREEN_WIDTH/2)+offset.x)-125,(offset.y+SCREEN_HEIGHT/2)-fontSize*5, "%s",c->title);
+ }
+
}
void handleEvents(void){
+ unsigned char i;
static bool left=false,right=false;
static vec2 premouse={0,0};
SDL_Event e;