-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu.cpp
More file actions
115 lines (87 loc) · 2.07 KB
/
Copy pathmenu.cpp
File metadata and controls
115 lines (87 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
#include "menu.h"
#include "ui_menu.h"
#include <gui_edit_jugador.h>
#include <menu_abm.h>
#include <juego_1.h>
#include <juego_2.h>
#include <mainwindow.h>
#include <QDebug>
#include <QDesktopWidget>
#include <QRect>
#include <QPoint>
menu::menu(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::menu)
{
ui->setupUi(this);
/** Centrar **/
QRect geo_ori= this->geometry();
int ancho= geo_ori.width();
int alto= geo_ori.height();
QDesktopWidget *deskw= QApplication::desktop();
QRect rectas= deskw->screenGeometry();
int px = (rectas.width()/2) - (ancho/2);
int py = (rectas.height()/2) - ( alto/2);
this->move( QPoint(px, py ) );
}
menu::menu(QWidget *parent, QString log):QMainWindow(parent), ui(new Ui::menu){
ui->setupUi(this);
ui->l_nom_usu->setText( log );
/** Centrar **/
QRect geo_ori= this->geometry();
int ancho= geo_ori.width();
int alto= geo_ori.height();
QDesktopWidget *deskw= QApplication::desktop();
QRect rectas= deskw->screenGeometry();
int px = (rectas.width()/2) - (ancho/2);
int py = (rectas.height()/2) - ( alto/2);
this->move( QPoint(px, py ) );
}
menu::~menu()
{
delete ui;
}
void menu::jugar_capitales(){
this->close();
juego_1 *ju1= new juego_1( ui->l_nom_usu->text()); ju1->show();
}
void menu::jugar_paisajes(){
this->close();
MainWindow *window= new MainWindow( ui->l_nom_usu->text());
window->loadImage();
window->show();
}
void menu::abm(){
menu_abm *ma= new menu_abm;
ma->show();
}
/*
void menu::on_btn_juego3_clicked()
{
MainWindow window;
window.loadImage(QStringLiteral(":/mapamundi.jpg"));
window.show();
}
*/
void menu::jugar_banderas()
{
this->close();
juego_2 *jue2= new juego_2(ui->l_nom_usu->text()); jue2->show();
}
void menu::on_btn_juego2_clicked()
{
this->jugar_capitales();
}
void menu::on_btn_banderas_2_clicked()
{
this->jugar_banderas();
}
void menu::on_btn_juego3_clicked()
{
this->jugar_paisajes();
}
void menu::on_btn_editar_jug_clicked()
{
gui_edit_jugador *ge= new gui_edit_jugador(ui->l_nom_usu->text());
ge->show();
}