X-Git-Url: https://git.jsancho.org/?a=blobdiff_plain;ds=sidebyside;f=Source%2FMenu.cpp;h=f3d9e0bf70a3a55ee5d657d67c6550cfb0c8b972;hb=20e924d;hp=20038734b8a15bda65231022f535935f74ba60f2;hpb=12421cc17c6176a16ec18901e02d760ccd0b28ad;p=lugaru.git
diff --git a/Source/Menu.cpp b/Source/Menu.cpp
index 2003873..f3d9e0b 100644
--- a/Source/Menu.cpp
+++ b/Source/Menu.cpp
@@ -1,3 +1,23 @@
+/*
+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 "gamegl.h"
@@ -8,34 +28,39 @@ using namespace Menu;
extern float multiplier;
struct MenuItem {
- enum MenuItemType{NONE,LABEL,BUTTON,IMAGE,IMAGEBUTTON,MAPMARKER,MAPLINE,MAPLABEL} type;
+ enum MenuItemType {NONE, LABEL, BUTTON, IMAGE, IMAGEBUTTON, MAPMARKER, MAPLINE, MAPLABEL} type;
int id;
string text;
- int texture;
- int x,y,w,h;
- float r,g,b;
+ Texture texture;
+ int x, y, w, h;
+ float r, g, b;
float effectfade;
float linestartsize;
float lineendsize;
- void init(MenuItemType _type, int _id, const string& _text, int _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;
+ 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;
}
}
};
@@ -45,136 +70,149 @@ vector