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
#include "mainwindow.h"
//#include "ui_mainwindow.h"
#include "FenetreEnigme.h"
#include "FenetreMap.h"
#include "FenetreCV.h"
#include "FenetreDebriefingCV.h"
#include "musique.h"
#include "jeu.h"

MainWindow::MainWindow(QWidget *parent) :
        QMainWindow(parent)/*, ui(new Ui::MainWindow)*/ {
    //ui->setupUi(this);
    jeu = new Jeu();
    jeu->initialiserJeu();

    setFixedSize(1024, 768);
    setWindowTitle("Entretien en Terre de Fangh");
    setWindowIcon(QIcon("../Ressources/icone1.png"));

    QString fj("../Ressources/CarteDuJeu.jpg");
    fenetreMap = new FenetreMap(this,fj);

    //fenetreMap = new FenetreMap();
    QString f("../Ressources/fangh.png");

    fenetreEnigme = new FenetreEnigme(this, f);
    QString s("../Ressources/Cv_fond.png");
    fenetreCv = new FenetreCV(this,s);
    //setCentralWidget(fenetreMap);
    //setCentralWidget(fenetreEnigme);
    //setCentralWidget(fenetreCv);
    fenetreDebriefing = new FenetreDebriefingCV(this, f);


    // TEST !!
    Competence c(MARTIALES, "bagarre", "pour donner des coups");
    Competence c1(MARTIALES, "arme1main", "pour donner des coups");
    Competence c2(MARTIALES, "arme2mains", "pour donner des coups");
    Competence c3(MARTIALES, "armeTir", "pour donner des coups");
    Competence c4(MARTIALES, "combat aveugle", "pour donner des coups");
    Competence c5(GENERALES, "escalade", "pour monter aux murs");
    Competence c6(GENERALES, "dressage", "pour dresser les animaux");
    Experience e("garde du corps", "petite experience");
    Experience e1("jeux de troll", "petite experience");
    Experience e2("eleveur de poulet", "petite experience");
    Experience e3("gardien de bebe orc", "petite experience");
    Experience e4("concours de la plus longue sieste", "petite experience");
    Experience e5("bras casse", "petite experience");

    CV monCv;
    monCv.ajoutCompetenceFin(&c);
    monCv.ajoutCompetenceFin(&c1);
    monCv.ajoutCompetenceDebut(&c2);;
    monCv.ajoutCompetence(2, &c3);
    monCv.ajoutCompetence(4, &c4);
    monCv.ajoutCompetence(6, &c5);
    monCv.ajoutCompetence(1, &c6);
    monCv.ajoutExperienceDebut(&e);
    monCv.ajoutExperienceDebut(&e1);
    monCv.ajoutExperienceFin(&e2);
    monCv.ajoutExperience(3, &e3);
    monCv.ajoutExperience(2, &e4);
    monCv.ajoutExperienceDebut(&e5);


    ParseurDom p("../Ressources/offres.xml");
    std::vector<Offre> vectorOffre;
    //std::vector<Offre>::iterator itVecteurOffre;
    p.lireDocOffres(&vectorOffre);
    Offre offre1 = *vectorOffre.begin();
    fenetreDebriefing->setCV(&monCv);
    fenetreDebriefing->setOffre(&offre1);
    fenetreDebriefing->update();

    //setCentralWidget(fenetreEnigme);

    //setCentralWidget(fenetreDebriefing);

//    fenetreEnigme->setSizePolicy();
//    zz = new BorderLayout(this, 0,0);
//    zz->addWidget(fenetreEnigme, BorderLayout::Center);
//    setLayout(zz);

    mainWidget = new QWidget();

    mainLayout = new QStackedLayout;//new BorderLayout();
    mainLayout->addWidget(fenetreMap);//, BorderLayout::Center);
    //mainLayout->addWidget(fenetreCv);

    mainWidget->setLayout(mainLayout);
    setCentralWidget(mainWidget);

    QString fileName = "../Ressources/zz.mp3";
    musique = new Musique(this, fileName);
    musique->setVolume(30);
    musique->jouer();
}

void MainWindow::revenirJeu() {

    mainLayout->removeWidget(fenetreEnigme);
    mainLayout->addWidget(fenetreMap);

    musique->pause();
}

Jeu* MainWindow::getJeu(){
    return jeu;
}

void MainWindow::Enigmes() {

    mainLayout->removeWidget(fenetreMap);
    mainLayout->addWidget(fenetreEnigme);
}

void MainWindow::Debriefing() {

    mainLayout->removeWidget(fenetreCv);
    mainLayout->addWidget(fenetreDebriefing);
}

MainWindow::~MainWindow() {
}

void MainWindow::changeEvent(QEvent *e) {
//    QMainWindow::changeEvent(e);
//    switch (e->type()) {
//    case QEvent::LanguageChange:
//        ui->retranslateUi(this);
//        break;
//    default:
//        break;
//    }
}

Commits for Fangh/trunk/mainwindow.cpp

Diff revisions: vs.
Revision Author Commited Message
42 Diff Diff Mily81 picture Mily81 Fri 05 Mar, 2010 01:28:16 +0000
40 Diff Diff Mily81 picture Mily81 Fri 05 Mar, 2010 00:30:19 +0000
39 Diff Diff thanoc picture thanoc Thu 04 Mar, 2010 23:32:40 +0000
38 Diff Diff Mily81 picture Mily81 Thu 04 Mar, 2010 22:41:36 +0000
36 Diff Diff thanoc picture thanoc Thu 04 Mar, 2010 19:44:59 +0000
33 Diff Diff willix picture willix Wed 03 Mar, 2010 12:25:16 +0000
32 Diff Diff willix picture willix Mon 01 Mar, 2010 13:32:52 +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

24 willix picture willix Thu 25 Feb, 2010 22:19:20 +0000