if(!Mainmenuitems[7]) {
ifstream test(ConvertFileName((":Data:Textures:"+accountactive->getCurrentCampaign()+":World.png").c_str()));
if(test.good()) {
- LoadTexture((":Data:Textures:"+accountactive->getCurrentCampaign()+":World.png").c_str(),&Mainmenuitems[7],0,0);
+ LoadTextureData((":Data:Textures:"+accountactive->getCurrentCampaign()+":World.png").c_str(),&Mainmenuitems[7],0,0);
} else {
- LoadTexture(":Data:Textures:World.png",&Mainmenuitems[7],0,0);
+ LoadTextureData(":Data:Textures:World.png",&Mainmenuitems[7],0,0);
}
}
ifstream ipstream(ConvertFileName((":Data:Campaigns:"+accountactive->getCurrentCampaign()+".txt").c_str()));
}
}
-void Game::DrawMenu()
-{
+void Game::DrawMenu() {
int i,j;
static float lastcheck;
for(i=0;i<nummenuitems;i++) {
if((mousecoordh/screenwidth*640)>startx[i]&&(mousecoordh/screenwidth*640)<endx[i]&&480-(mousecoordv/screenheight*480)>starty[i]&&480-(mousecoordv/screenheight*480)<endy[i]) {
- if(mainmenu!=5) selected=i;
+ if((mainmenu!=5) && (mainmenu!=1) && (mainmenu!=2)) selected=i; // username in menu 5 and game title in menu 1&2 can't be selected
else if( (i>0) && (i!=NB_CAMPAIGN_MENU_ITEM) ) selected=i;
}
}
- for(i=0;i<nummenuitems;i++){
+ for(i=0;i<nummenuitems;i++) {
if(selected==i) {
selectedlong[i]+=multiplier*5;
if(selectedlong[i]>1) selectedlong[i]=1;
//float linestartx,lineendx,linestarty,lineendy,offsetx,offsety;
linestart.x=(startx[j]+endx[j])/2;
linestart.y=(starty[j]+endy[j])/2;
- if(j>=NB_CAMPAIGN_MENU_ITEM+(accountactive?accountactive->getCampaignChoicesMade():0)){
- linestart.x=(startx[6+(accountactive?accountactive->getCampaignChoicesMade():0)]+endx[6+(accountactive?accountactive->getCampaignChoicesMade():0)])/2;
- linestart.y=(starty[6+(accountactive?accountactive->getCampaignChoicesMade():0)]+endy[6+(accountactive?accountactive->getCampaignChoicesMade():0)])/2;
- }
+ //~ if(j>=NB_CAMPAIGN_MENU_ITEM-1+(accountactive?accountactive->getCampaignChoicesMade():0)){
+ //~ linestart.x=(startx[NB_CAMPAIGN_MENU_ITEM-1+(accountactive?accountactive->getCampaignChoicesMade():0)]+endx[NB_CAMPAIGN_MENU_ITEM-1+(accountactive?accountactive->getCampaignChoicesMade():0)])/2;
+ //~ linestart.y=(starty[NB_CAMPAIGN_MENU_ITEM-1+(accountactive?accountactive->getCampaignChoicesMade():0)]+endy[NB_CAMPAIGN_MENU_ITEM-1+(accountactive?accountactive->getCampaignChoicesMade():0)])/2;
+ //~ } // what was this if for?
lineend.x=(startx[j+1]+endx[j+1])/2;
lineend.y=(starty[j+1]+endy[j+1])/2;
offset=lineend-linestart;