Subversion Repository Public Repository

Fangh

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
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
#include "FenetreMap.h"
#include "borderlayout.h"
#include "jeu.h"
#include <QtGui>

FenetreMap::FenetreMap(){

}

FenetreMap::FenetreMap(MainWindow *_parent, QString &_imageName)
    : IWidget(_parent,_imageName){

    QString fm("../Ressources/Fond_Map_Enigme.png");
    zonesEnigmes = new IWidget(parentWindow,fm);
    zonesEnigmes->setParent(this);
    zonesEnigmes->move(682,485);
    zonesEnigmes->resize(283,234);
    zonesEnigmes->hide();
    creerBoutons();
    //enigme1->setParent(zonesEnigmes);
    //enigme2->setParent(zonesEnigmes);

    QImage fond("../Ressources/gobelin2.png");
    QPixmap pixfond(fond.width(),fond.height());
    QPainter paintfond(&pixfond);
    paintfond.drawImage(0,0,fond);
    paintfond.fillRect(fond.rect(),Qt::transparent);

    imgGob = new QLabel(this);
    imgGob->setPixmap(QPixmap::fromImage(fond));
    imgGob->move(553,450);

    maison->resize(59,103);
    maison->move(554,439);
    maison->setFlat(true);
   // maison->setUpdatesEnabled(true);
    maison->show();
    tourBD->resize(56,89);
    tourBD->move(619,327);
    tourBD->setFlat(true);
    tourBD->setUpdatesEnabled(true);
    tourBD->show();
    tourBG->resize(56,89);
    tourBG->move(369,443);
    tourBG->setFlat(true);
    tourBG->setUpdatesEnabled(true);
    tourBG->show();
    tourHD->resize(56,89);
    tourHD->move(603,213);
    tourHD->setFlat(true);
    tourHD->setUpdatesEnabled(true);
    tourHD->show();
    tourHG->resize(56,89);
    tourHG->move(369,253);
    tourHG->setFlat(true);
    tourHG->setUpdatesEnabled(true);
    tourHG->show();
    chateau->resize(201,170);
    chateau->move(364,83);
    chateau->setFlat(true);
    chateau->setUpdatesEnabled(true);
    chateau->show();

    // a changer quand on a les enigmes
    enigme1->resize(168,37);
    enigme1->move(745,572);
    enigme1->hide();
    enigme2->resize(168,37);
    enigme2->move(745,638);
    enigme2->hide();

}

FenetreMap::~FenetreMap() {
    delete tourBD;
    delete tourBG;
    delete tourHD;
    delete tourHG;
    delete chateau;
    delete enigme1;
    delete enigme2;
    delete maison;

    delete imgMap;
    delete imgGob;
}


void FenetreMap::creerBoutons() {

    maison = new QPushButton(this);
    tourBD = new QPushButton(this);
    tourBG = new QPushButton(this);
    tourHD = new QPushButton(this);
    tourHG = new QPushButton(this);
    chateau = new QPushButton(this);
    enigme1 = new QPushButton(this);
    enigme2 = new QPushButton(this);

    connect(maison, SIGNAL(clicked()), this, SLOT(connectMaison()));
    connect(tourBD, SIGNAL(clicked()), this, SLOT(connectOffrebd()));
    connect(tourBG, SIGNAL(clicked()), this, SLOT(connectOffrebg()));
    connect(tourHD, SIGNAL(clicked()), this, SLOT(connectOffrehd()));
    connect(tourHG, SIGNAL(clicked()), this, SLOT(connectOffrehg()));
    connect(chateau, SIGNAL(clicked()), this, SLOT(connectOffrech()));

    connect(enigme1, SIGNAL(clicked()), this, SLOT(connectEnigme1()));
    connect(enigme2, SIGNAL(clicked()), this, SLOT(connectEnigme2()));

}

void FenetreMap::connectMaison(){
    Jeu *j = parentWindow->getJeu();
    const Tour * posi = j->getPersonnage()->getPosition();
    zonesEnigmes->show();
    enigme1->show();
    enigme2->show();
}

void FenetreMap::connectEnigme1() {



    if((imgGob->pos().x() == 553 && imgGob->pos().y()==450)
        || (imgGob->pos().x() == 553 && imgGob->pos().y()==450) ){
        //imgGob->move(632,330);
        zonesEnigmes->hide();
        enigme1->hide();
        enigme2->hide();
    }

    parentWindow->Enigmes();
}

void FenetreMap::connectEnigme2() {
    zonesEnigmes->hide();
    enigme1->hide();
    enigme2->hide();
    parentWindow->Enigmes();
}

void FenetreMap::connectOffrebd(){
    Jeu *j = parentWindow->getJeu();
    const Tour * posi = j->getPersonnage()->getPosition();

    std::vector<Enigme> enigmes = *(j->getVecteurEnigmesActuelles());
    if((imgGob->pos().x() == 553 && imgGob->pos().y()==450) ){
        imgGob->move(545,375);
        zonesEnigmes->show();
        //enigme1->setText(enigmes[0].getCompetence());
        enigme1->show();
       // enigme2->setText(enigmes[1].getCompetence());
        enigme2->show();
    }
    //imgGob->move(619,327);
    //parentWindow->Enigmes();
}

void FenetreMap::connectOffrebg(){
    if((imgGob->pos().x() == 553 && imgGob->pos().y()==450) ){
        imgGob->move(474,456);
        zonesEnigmes->show();
        enigme1->show();
        enigme2->show();
    }
    //imgGob->move(369,443);
    //parentWindow->Enigmes();
}

void FenetreMap::connectOffrehd(){
    if(imgGob->pos().x() == 369 && imgGob->pos().y()==443){
        // en BG
        imgGob->move(503,323);
        zonesEnigmes->show();
        enigme1->show();
        enigme2->show();
    }

     if(imgGob->pos().x() == 619 && imgGob->pos().y()==327) { // en BD
        imgGob->move(601,299);
        zonesEnigmes->show();
        enigme1->show();
        enigme2->show();
    }
    //imgGob->move(603,213);
    //parentWindow->Enigmes();
}

void FenetreMap::connectOffrehg(){
    if(imgGob->pos().x() == 369 && imgGob->pos().y()==443) {
        // en BG
        imgGob->move(371,364);
        zonesEnigmes->show();
        enigme1->show();
        enigme2->show();
    }
    if(imgGob->pos().x() == 619 && imgGob->pos().y()==327){ // en BD
        imgGob->move(503,323);
        zonesEnigmes->show();
        enigme1->show();
        enigme2->show();
    }
    //imgGob->move(369,253);
    //parentWindow->Enigmes();
}

void FenetreMap::connectOffrech(){
    imgGob->move(494,143);
    zonesEnigmes->show();
    enigme1->show();
    enigme2->show();
    //parentWindow->Enigmes();
}

Commits for Fangh/trunk/FenetreMap.cpp

Diff revisions: vs.
Revision Author Commited Message
42 Diff Diff Mily81 picture Mily81 Fri 05 Mar, 2010 01:28:16 +0000
31 Diff Diff Mily81 picture Mily81 Sun 28 Feb, 2010 14:33:05 +0000

et voilou toujours quelques pb a regarder mais fini
dans l’ensemble, Willy j’ai un bug quand je clique
sur “quitter” dans fenetre Enigme regerde si j’aurais
pas modif quelque chose sans faire exprès

27 Diff Diff Mily81 picture Mily81 Sat 27 Feb, 2010 23:46:14 +0000

Voilou encore un avancement du projet, reste plus qu’une
partie du drag and drop à finir et le déplacement du petit
gobelin

14 Diff Diff Mily81 picture Mily81 Fri 19 Feb, 2010 13:59:13 +0000
11 Diff Diff Mily81 picture Mily81 Fri 19 Feb, 2010 13:44:15 +0000

changement

10 Mily81 picture Mily81 Fri 19 Feb, 2010 13:01:31 +0000

et voilou des interfaces ...