mirror of
https://github.com/TerryCavanagh/VVVVVV.git
synced 2024-12-23 01:59:43 +01:00
Change "else if"-chain in editormenuactionpress to case-switch
It makes it better so you don't have to deal with that dangling first "if" that doesn't have an 'else'.
This commit is contained in:
parent
78169cdc1c
commit
83ca75a831
1 changed files with 36 additions and 40 deletions
|
@ -3463,52 +3463,50 @@ void editormenuactionpress()
|
||||||
{
|
{
|
||||||
if (game.currentmenuname == "ed_desc")
|
if (game.currentmenuname == "ed_desc")
|
||||||
{
|
{
|
||||||
if (game.currentmenuoption == 0)
|
switch (game.currentmenuoption)
|
||||||
{
|
{
|
||||||
|
case 0:
|
||||||
ed.textentry=true;
|
ed.textentry=true;
|
||||||
ed.titlemod=true;
|
ed.titlemod=true;
|
||||||
key.enabletextentry();
|
key.enabletextentry();
|
||||||
key.keybuffer=EditorData::GetInstance().title;
|
key.keybuffer=EditorData::GetInstance().title;
|
||||||
}
|
break;
|
||||||
else if (game.currentmenuoption == 1)
|
case 1:
|
||||||
{
|
|
||||||
ed.textentry=true;
|
ed.textentry=true;
|
||||||
ed.creatormod=true;
|
ed.creatormod=true;
|
||||||
key.enabletextentry();
|
key.enabletextentry();
|
||||||
key.keybuffer=EditorData::GetInstance().creator;
|
key.keybuffer=EditorData::GetInstance().creator;
|
||||||
}
|
break;
|
||||||
else if (game.currentmenuoption == 2)
|
case 2:
|
||||||
{
|
|
||||||
ed.textentry=true;
|
ed.textentry=true;
|
||||||
ed.desc1mod=true;
|
ed.desc1mod=true;
|
||||||
key.enabletextentry();
|
key.enabletextentry();
|
||||||
key.keybuffer=ed.Desc1;
|
key.keybuffer=ed.Desc1;
|
||||||
}
|
break;
|
||||||
else if (game.currentmenuoption == 3)
|
case 3:
|
||||||
{
|
|
||||||
ed.textentry=true;
|
ed.textentry=true;
|
||||||
ed.websitemod=true;
|
ed.websitemod=true;
|
||||||
key.enabletextentry();
|
key.enabletextentry();
|
||||||
key.keybuffer=ed.website;
|
key.keybuffer=ed.website;
|
||||||
}
|
break;
|
||||||
else if (game.currentmenuoption == 4)
|
case 4:
|
||||||
{
|
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu("ed_settings");
|
game.createmenu("ed_settings");
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (game.currentmenuname == "ed_settings")
|
else if (game.currentmenuname == "ed_settings")
|
||||||
{
|
{
|
||||||
if (game.currentmenuoption == 0)
|
switch (game.currentmenuoption)
|
||||||
{
|
{
|
||||||
|
case 0:
|
||||||
//Change level description stuff
|
//Change level description stuff
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu("ed_desc");
|
game.createmenu("ed_desc");
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
}
|
break;
|
||||||
else if (game.currentmenuoption == 1)
|
case 1:
|
||||||
{
|
|
||||||
//Enter script editormode
|
//Enter script editormode
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
ed.scripteditmod=true;
|
ed.scripteditmod=true;
|
||||||
|
@ -3521,16 +3519,14 @@ void editormenuactionpress()
|
||||||
ed.scripthelppagedelay=0;
|
ed.scripthelppagedelay=0;
|
||||||
ed.sby=0;
|
ed.sby=0;
|
||||||
ed.sbx=0, ed.pagey=0;
|
ed.sbx=0, ed.pagey=0;
|
||||||
}
|
break;
|
||||||
else if (game.currentmenuoption == 2)
|
case 2:
|
||||||
{
|
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu("ed_music");
|
game.createmenu("ed_music");
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
if(ed.levmusic>0) music.play(ed.levmusic);
|
if(ed.levmusic>0) music.play(ed.levmusic);
|
||||||
}
|
break;
|
||||||
else if (game.currentmenuoption == 3)
|
case 3:
|
||||||
{
|
|
||||||
//Load level
|
//Load level
|
||||||
ed.settingsmod=false;
|
ed.settingsmod=false;
|
||||||
graphics.backgrounddrawn=false;
|
graphics.backgrounddrawn=false;
|
||||||
|
@ -3543,9 +3539,8 @@ void editormenuactionpress()
|
||||||
ed.keydelay=6;
|
ed.keydelay=6;
|
||||||
game.mapheld=true;
|
game.mapheld=true;
|
||||||
graphics.backgrounddrawn=false;
|
graphics.backgrounddrawn=false;
|
||||||
}
|
break;
|
||||||
else if (game.currentmenuoption == 4)
|
case 4:
|
||||||
{
|
|
||||||
//Save level
|
//Save level
|
||||||
ed.settingsmod=false;
|
ed.settingsmod=false;
|
||||||
graphics.backgrounddrawn=false;
|
graphics.backgrounddrawn=false;
|
||||||
|
@ -3558,18 +3553,19 @@ void editormenuactionpress()
|
||||||
ed.keydelay=6;
|
ed.keydelay=6;
|
||||||
game.mapheld=true;
|
game.mapheld=true;
|
||||||
graphics.backgrounddrawn=false;
|
graphics.backgrounddrawn=false;
|
||||||
}
|
break;
|
||||||
else if (game.currentmenuoption == 5)
|
case 5:
|
||||||
{
|
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu("ed_quit");
|
game.createmenu("ed_quit");
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (game.currentmenuname == "ed_music")
|
else if (game.currentmenuname == "ed_music")
|
||||||
{
|
{
|
||||||
if (game.currentmenuoption == 0)
|
switch (game.currentmenuoption)
|
||||||
{
|
{
|
||||||
|
case 0:
|
||||||
ed.levmusic++;
|
ed.levmusic++;
|
||||||
if(ed.levmusic==5) ed.levmusic=6;
|
if(ed.levmusic==5) ed.levmusic=6;
|
||||||
if(ed.levmusic==7) ed.levmusic=8;
|
if(ed.levmusic==7) ed.levmusic=8;
|
||||||
|
@ -3584,19 +3580,20 @@ void editormenuactionpress()
|
||||||
music.haltdasmusik();
|
music.haltdasmusik();
|
||||||
}
|
}
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
}
|
break;
|
||||||
else if (game.currentmenuoption == 1)
|
case 1:
|
||||||
{
|
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
music.fadeout();
|
music.fadeout();
|
||||||
game.createmenu("ed_settings");
|
game.createmenu("ed_settings");
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (game.currentmenuname == "ed_quit")
|
else if (game.currentmenuname == "ed_quit")
|
||||||
{
|
{
|
||||||
if (game.currentmenuoption == 0)
|
switch (game.currentmenuoption)
|
||||||
{
|
{
|
||||||
|
case 0:
|
||||||
//Saving and quit
|
//Saving and quit
|
||||||
ed.saveandquit=true;
|
ed.saveandquit=true;
|
||||||
|
|
||||||
|
@ -3611,20 +3608,19 @@ void editormenuactionpress()
|
||||||
ed.keydelay=6;
|
ed.keydelay=6;
|
||||||
game.mapheld=true;
|
game.mapheld=true;
|
||||||
graphics.backgrounddrawn=false;
|
graphics.backgrounddrawn=false;
|
||||||
}
|
break;
|
||||||
else if (game.currentmenuoption == 1)
|
case 1:
|
||||||
{
|
|
||||||
//Quit without saving
|
//Quit without saving
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
music.fadeout();
|
music.fadeout();
|
||||||
graphics.fademode = 2;
|
graphics.fademode = 2;
|
||||||
}
|
break;
|
||||||
else if (game.currentmenuoption == 2)
|
case 2:
|
||||||
{
|
|
||||||
//Go back to editor
|
//Go back to editor
|
||||||
music.playef(11);
|
music.playef(11);
|
||||||
game.createmenu("ed_settings");
|
game.createmenu("ed_settings");
|
||||||
map.nexttowercolour();
|
map.nexttowercolour();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue