X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;f=Source%2FMenu.cpp;h=d3c9b0d35c3d1dbb2b02c98e027c7e4dca84d507;hb=3de67c0db8c3c74f5fb487579936a07770d253a1;hp=541404903e5fd829891c4ccfb1ab51016b1b426a;hpb=253b1aa9cfce1e8b1fc12b74d96a7808f615d783;p=lugaru.git
diff --git a/Source/Menu.cpp b/Source/Menu.cpp
index 5414049..d3c9b0d 100644
--- a/Source/Menu.cpp
+++ b/Source/Menu.cpp
@@ -1,180 +1,220 @@
+/*
+Copyright (C) 2003, 2010 - Wolfire Games
+Copyright (C) 2010-2016 - Lugaru contributors (see AUTHORS file)
+
+This file is part of Lugaru.
+
+Lugaru is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+Lugaru is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with Lugaru. If not, see .
+*/
+
#include
#include
+#include
#include "gamegl.h"
#include "Menu.h"
-using namespace Menu;
+#include "Settings.h"
+#include "Input.h"
+#include "Campaign.h"
-extern float multiplier;
-
-struct MenuItem {
- enum MenuItemType{NONE,LABEL,BUTTON,IMAGE,IMAGEBUTTON,MAPMARKER,MAPLINE,MAPLABEL} type;
- int id;
- string text;
- Texture texture;
- int x,y,w,h;
- float r,g,b;
- float effectfade;
+// Should not be needed, Menu should call methods from other classes to launch maps and challenges and so on
+#include "Awards.h"
+#include "openal_wrapper.h"
- float linestartsize;
- float lineendsize;
+using namespace Game;
- void init(MenuItemType _type, int _id, const string& _text, Texture _texture,
- int _x, int _y, int _w, int _h, float _r, float _g, float _b,
- float _linestartsize=1, float _lineendsize=1){
- type=_type;
- id=_id;
- text=_text;
- texture=_texture;
- x=_x; y=_y; w=_w; h=_h;
- r=_r; g=_g; b=_b;
- effectfade=0;
- linestartsize=_linestartsize;
- lineendsize=_lineendsize;
- if(type==MenuItem::BUTTON){
- if(w==-1)
- w=text.length()*10;
- if(h==-1)
- h=20;
- }
- }
-};
+extern float multiplier;
+extern std::set> resolutions;
+extern int mainmenu;
+extern std::vector campaignlevels;
+extern float musicvolume[4];
+extern float oldmusicvolume[4];
+extern bool stillloading;
+extern bool visibleloading;
+extern int whichchoice;
+extern int leveltheme;
-vector