-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathHelp.cpp
More file actions
143 lines (129 loc) · 6.14 KB
/
Copy pathHelp.cpp
File metadata and controls
143 lines (129 loc) · 6.14 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
#include "Help.h"
#include "ui_Help.h"
#include "filepath.h"
#include "bishop.h"
#include "drummer.h"
#include "heroine.h"
#include "scarecrow.h"
#include "spy.h"
#include "winter.h"
#include "spring.h"
#include "turncoat.h"
#include "whiteseals.h"
#include "whiterakhsh.h"
#include "ShirinAghl.h"
#include <QMainWindow>
Help::Help(QWidget *parent)
: QDialog(parent)
, ui(new Ui::Help)
{
ui->setupUi(this);
cardsImageRef["Bishop"] = "border-image:url(" + QString(BISHOP_IMAGE) + ")"; // Bishop image
cardsImageRef["Drummer"] = "border-image:url(" + QString(DRUMMER_IMAGE) + ")"; // Drummer image
cardsImageRef["Heroine"] = "border-image:url(" + QString(HEROINE_IMAGE) + ")"; // heroine image
cardsImageRef["Scarecrow"] = "border-image:url(" + QString(SCARECROW_IMAGE) + ")"; // Scarecrow image
cardsImageRef["Spring"] = "border-image:url(" + QString(SPRING_IMAGE) + ")"; // Spring image
cardsImageRef["Winter"] = "border-image:url(" + QString(WINTER_IMAGE) + ")"; // winter image
cardsImageRef["Spy"] = "border-image:url(" + QString(SPY_IMAGE) + ")"; // spy image
cardsImageRef["Turncoat"] = "border-image:url(" + QString(TURNCOAT_IMAGE) + ")"; // turncoat image
cardsImageRef["WhiteRakhsh"] = "border-image:url(" + QString(WHITERAKHSH_IMAGE) + ")"; //This code is related to phase 3 of the project
cardsImageRef["WhiteSeal"] = "border-image:url(" + QString(WHITESEALS_IMAGE) + ")"; //This code is related to phase 3 of the project
// cardsImageRef["ShirinAghl"] = "border-image:url(" + QString(SHIRINAGHL_IMAGE) + ")"; //This code is related to phase 3 of the project
}
Help::~Help()
{
delete ui;
}
void Help::on_btn_ok_clicked()
{
QMainWindow *campaign = qobject_cast<QMainWindow*>(parent());
campaign->show();
this->hide();
}
void Help::on_ptn_back_clicked()
{
}
void Help::on_cb_help_list_activated(int index)
{
}
void Help::on_cb_help_list_currentTextChanged(const QString &arg1) /// show help text fo player
{
ui->label_2->setVisible(false);
ui->lb_help_txt->setVisible(false);
if (arg1 == "Game") {
ui->lb_help_txt->setText(QString::fromStdString(Game::getHelp())); /// with gethelp function on the card class
ui->lb_help_txt->setVisible(true);
}
else if(arg1 == "Bishop") {
ui->lb_help_txt->setText(QString::fromStdString(Bishop::getHelp())); /// with gethelp function on the card class
ui->lb_help_txt->setVisible(true);
ui->label_2->setStyleSheet(cardsImageRef["Bishop"]);
ui->label_2->setVisible(true);
}
else if(arg1 == "Heroine") {
ui->lb_help_txt->setText(QString::fromStdString(Heroine::getHelp())); /// with gethelp function on the card class
ui->lb_help_txt->setVisible(true);
ui->label_2->setStyleSheet(cardsImageRef["Heroine"]);
ui->label_2->setVisible(true);
}
else if(arg1 == "Drummer") {
ui->lb_help_txt->setText(QString::fromStdString(Drummer::getHelp())); /// with gethelp function on the card class
ui->lb_help_txt->setVisible(true);
ui->label_2->setStyleSheet(cardsImageRef["Drummer"]);
ui->label_2->setVisible(true);
}
else if(arg1 == "Heroine") {
ui->lb_help_txt->setText(QString::fromStdString(Heroine::getHelp())); /// with gethelp function on the card class
ui->lb_help_txt->setVisible(false);
ui->label_2->setStyleSheet(cardsImageRef["Heroine"]);
ui->label_2->setVisible(true);
}
else if(arg1 == "Scarecrow") {
ui->lb_help_txt->setText(QString::fromStdString(Scarecrow::getHelp())); /// with gethelp function on the card class
ui->lb_help_txt->setVisible(true);
ui->label_2->setStyleSheet(cardsImageRef["Scarecrow"]);
ui->label_2->setVisible(true);
}
else if(arg1 == "Spring") {
ui->lb_help_txt->setText(QString::fromStdString(Spring::getHelp())); /// with gethelp function on the card class
ui->lb_help_txt->setVisible(true);
ui->label_2->setStyleSheet(cardsImageRef["Spring"]);
ui->label_2->setVisible(true);
}
else if(arg1 == "Winter") {
ui->lb_help_txt->setText(QString::fromStdString(Winter::getHelp())); /// with gethelp function on the card class
ui->lb_help_txt->setVisible(true);
ui->label_2->setStyleSheet(cardsImageRef["Winter"]);
ui->label_2->setVisible(true);
}
else if(arg1 == "Spy") {
ui->lb_help_txt->setText(QString::fromStdString(Spy::getHelp())); /// with gethelp function on the card class
ui->lb_help_txt->setVisible(true);
ui->label_2->setStyleSheet(cardsImageRef["Spy"]);
ui->label_2->setVisible(true);
}
else if(arg1 == "Turncoat") {
ui->lb_help_txt->setText(QString::fromStdString(Turncoat::getHelp())); /// with gethelp function on the card class
ui->lb_help_txt->setVisible(true);
ui->label_2->setStyleSheet(cardsImageRef["Turncoat"]);
ui->label_2->setVisible(true);
}
else if(arg1 == "WhiteSeal") {
ui->lb_help_txt->setText(QString::fromStdString(WhiteSeal::getHelp())); /// with gethelp function on the card class
ui->lb_help_txt->setVisible(true);
ui->label_2->setStyleSheet(cardsImageRef["WhiteSeal"]);
ui->label_2->setVisible(true);
}
else if(arg1 == "WhiteRakhsh") {
ui->lb_help_txt->setText(QString::fromStdString(WhiteRakhsh::getHelp())); /// with gethelp function on the card classs
ui->lb_help_txt->setVisible(true);
ui->label_2->setStyleSheet(cardsImageRef["WhiteRakhsh"]);
ui->label_2->setVisible(true);
}
/* else if(arg1 == "ShirinAghl") {
ui->lb_help_txt->setText(QString::fromStdString(ShirinAghl::getHelp())); /// with gethelp function on the card class
ui->lb_help_txt->setVisible(true);
ui->label_2->setStyleSheet(cardsImageRef["ShirinAghl"]);
ui->label_2->setVisible(true);
}*/
}