dev #2
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -31,6 +31,7 @@ Character::Character(QFile *file){
|
|||||||
race = json["race"].toString();
|
race = json["race"].toString();
|
||||||
classe = json["classe"].toString();
|
classe = json["classe"].toString();
|
||||||
niveau = json["niveau"].toInt();
|
niveau = json["niveau"].toInt();
|
||||||
|
|
||||||
sexe = json["sexe"].toString();
|
sexe = json["sexe"].toString();
|
||||||
taille = json["taille"].toDouble();
|
taille = json["taille"].toDouble();
|
||||||
vie = json["vie"].toInt();
|
vie = json["vie"].toInt();
|
||||||
|
|||||||
10
data/a.txt
10
data/a.txt
@ -1,10 +1,10 @@
|
|||||||
{
|
{
|
||||||
"age": 0,
|
"age": 1,
|
||||||
"backPack": "",
|
"backPack": "ssdgfsdgd",
|
||||||
"blocNote": "dghdgdgfgd",
|
"blocNote": "'(y'eyhrhyrhr",
|
||||||
"classe": "",
|
"classe": "",
|
||||||
"image": "data/images/logo.png",
|
"image": "data/images/logo.png",
|
||||||
"name": "",
|
"name": "dfh",
|
||||||
"niveau": 0,
|
"niveau": 0,
|
||||||
"race": "",
|
"race": "",
|
||||||
"sexe": "",
|
"sexe": "",
|
||||||
@ -45,5 +45,5 @@
|
|||||||
0
|
0
|
||||||
],
|
],
|
||||||
"taille": 0,
|
"taille": 0,
|
||||||
"vie": 6619181
|
"vie": 569
|
||||||
}
|
}
|
||||||
|
|||||||
49
data/b.txt
49
data/b.txt
@ -1,49 +0,0 @@
|
|||||||
{
|
|
||||||
"age": 0,
|
|
||||||
"backPack": "",
|
|
||||||
"blocNote": "ssd",
|
|
||||||
"classe": "",
|
|
||||||
"image": "data/images/logo.png",
|
|
||||||
"name": "",
|
|
||||||
"niveau": 0,
|
|
||||||
"race": "",
|
|
||||||
"sexe": "",
|
|
||||||
"skills": [
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0
|
|
||||||
],
|
|
||||||
"skillsMod": [
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0
|
|
||||||
],
|
|
||||||
"stats": [
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0
|
|
||||||
],
|
|
||||||
"taille": 0,
|
|
||||||
"vie": 6619181
|
|
||||||
}
|
|
||||||
@ -1,49 +0,0 @@
|
|||||||
{
|
|
||||||
"age": 0,
|
|
||||||
"backPack": "",
|
|
||||||
"blocNote": "sfsfsffsd",
|
|
||||||
"classe": "",
|
|
||||||
"image": "data/images/logo.png",
|
|
||||||
"name": "Gio",
|
|
||||||
"niveau": 0,
|
|
||||||
"race": "",
|
|
||||||
"sexe": "",
|
|
||||||
"skills": [
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0
|
|
||||||
],
|
|
||||||
"skillsMod": [
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0
|
|
||||||
],
|
|
||||||
"stats": [
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0,
|
|
||||||
0
|
|
||||||
],
|
|
||||||
"taille": 0,
|
|
||||||
"vie": 0
|
|
||||||
}
|
|
||||||
@ -24,6 +24,9 @@ MainWindow::MainWindow(QWidget *parent)
|
|||||||
ui->ageLineEdit->setValidator(new QIntValidator(0, 999999, ui->ageLineEdit));
|
ui->ageLineEdit->setValidator(new QIntValidator(0, 999999, ui->ageLineEdit));
|
||||||
ui->niveauLineEdit->setValidator(new QIntValidator(0, 999999, ui->niveauLineEdit));
|
ui->niveauLineEdit->setValidator(new QIntValidator(0, 999999, ui->niveauLineEdit));
|
||||||
ui->tailleLineEdit->setValidator(new QDoubleValidator(0.0, 999999.0, 1,ui->tailleLineEdit));
|
ui->tailleLineEdit->setValidator(new QDoubleValidator(0.0, 999999.0, 1,ui->tailleLineEdit));
|
||||||
|
ui->BackPack->setHidden(true);
|
||||||
|
|
||||||
|
|
||||||
loadImage(QString("data/images/logo.png"));
|
loadImage(QString("data/images/logo.png"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -60,6 +63,7 @@ void MainWindow::loadNewCharacter(){
|
|||||||
|
|
||||||
void MainWindow::createNewCharacter(Character* p) {
|
void MainWindow::createNewCharacter(Character* p) {
|
||||||
notePad->setTexte(p->getTexteBlocNote());
|
notePad->setTexte(p->getTexteBlocNote());
|
||||||
|
ui->BackPackPlainTextEdit->setPlainText(p->getTexteBlocNote());
|
||||||
currentCharacter = p;
|
currentCharacter = p;
|
||||||
characters.append(p);
|
characters.append(p);
|
||||||
setUi(p);
|
setUi(p);
|
||||||
@ -103,9 +107,7 @@ void MainWindow::saveJson(){
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(edition){
|
getUi();
|
||||||
getUi();
|
|
||||||
}
|
|
||||||
notePad->getUi();
|
notePad->getUi();
|
||||||
currentCharacter->setTexteBlocNote(notePad->getTexte());
|
currentCharacter->setTexteBlocNote(notePad->getTexte());
|
||||||
QJsonObject json;
|
QJsonObject json;
|
||||||
@ -153,9 +155,7 @@ void MainWindow::saveAsJson(){
|
|||||||
setWindowTitle(fileName);
|
setWindowTitle(fileName);
|
||||||
currentFile = fileName;
|
currentFile = fileName;
|
||||||
|
|
||||||
if(edition){
|
getUi();
|
||||||
getUi();
|
|
||||||
}
|
|
||||||
notePad->getUi();
|
notePad->getUi();
|
||||||
currentCharacter->setTexteBlocNote(notePad->getTexte());
|
currentCharacter->setTexteBlocNote(notePad->getTexte());
|
||||||
QJsonObject json;
|
QJsonObject json;
|
||||||
@ -228,6 +228,7 @@ void MainWindow::getUi(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
currentCharacter->setStats(stats);
|
currentCharacter->setStats(stats);
|
||||||
|
currentCharacter->setTexteBackPack(ui->BackPackPlainTextEdit->toPlainText());
|
||||||
//currentCharacter->setImage();
|
//currentCharacter->setImage();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -269,28 +270,21 @@ void MainWindow::setUi(Character* p){
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::on_actionEditer_triggered(){
|
|
||||||
if(edition){
|
|
||||||
//Mode edition
|
|
||||||
}else{
|
|
||||||
//Mode visualisation
|
|
||||||
}
|
|
||||||
edition=!edition;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::on_actionBlocNote_triggered(){
|
|
||||||
this->notePad->show();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::recevoirSauvegarde(QString contenu){
|
void MainWindow::recevoirSauvegarde(QString contenu){
|
||||||
currentCharacter->setTexteBlocNote(contenu);
|
currentCharacter->setTexteBlocNote(contenu);
|
||||||
saveJson();
|
saveJson();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void MainWindow::toogleBackPack(){
|
||||||
|
if(ui->BackPack->isHidden()){
|
||||||
|
ui->Edition->setHidden(true);
|
||||||
|
ui->BackPack->setHidden(false);
|
||||||
|
}else{
|
||||||
|
ui->BackPack->setHidden(true);
|
||||||
|
ui->Edition->setHidden(false);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void MainWindow::on_actionOuvrir_une_fiche_triggered(){this->loadNewCharacter();}
|
void MainWindow::on_actionOuvrir_une_fiche_triggered(){this->loadNewCharacter();}
|
||||||
@ -298,4 +292,6 @@ void MainWindow::on_actionNouvelle_fiche_triggered(){this->createNewCharacter(ne
|
|||||||
void MainWindow::on_actionSauvegarder_triggered(){this->saveJson();}
|
void MainWindow::on_actionSauvegarder_triggered(){this->saveJson();}
|
||||||
void MainWindow::on_actionEnregistrer_sous_triggered(){this->saveAsJson();}
|
void MainWindow::on_actionEnregistrer_sous_triggered(){this->saveAsJson();}
|
||||||
void MainWindow::on_actionFermer_triggered(){QApplication::quit();}
|
void MainWindow::on_actionFermer_triggered(){QApplication::quit();}
|
||||||
|
void MainWindow::on_actionBlocNote_triggered(){this->notePad->show();}
|
||||||
|
void MainWindow::on_actionBackPack_triggered(){this->toogleBackPack();}
|
||||||
|
|
||||||
|
|||||||
@ -27,15 +27,16 @@ public:
|
|||||||
void saveAsJson();
|
void saveAsJson();
|
||||||
void getUi();
|
void getUi();
|
||||||
void setUi(Character* p);
|
void setUi(Character* p);
|
||||||
|
void toogleBackPack();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void on_actionEditer_triggered();
|
|
||||||
void on_actionBlocNote_triggered();
|
void on_actionBlocNote_triggered();
|
||||||
void on_actionOuvrir_une_fiche_triggered();
|
void on_actionOuvrir_une_fiche_triggered();
|
||||||
void on_actionNouvelle_fiche_triggered();
|
void on_actionNouvelle_fiche_triggered();
|
||||||
void on_actionSauvegarder_triggered();
|
void on_actionSauvegarder_triggered();
|
||||||
void on_actionEnregistrer_sous_triggered();
|
void on_actionEnregistrer_sous_triggered();
|
||||||
void on_actionFermer_triggered();
|
void on_actionFermer_triggered();
|
||||||
|
void on_actionBackPack_triggered();
|
||||||
|
|
||||||
void recevoirSauvegarde(QString contenu);
|
void recevoirSauvegarde(QString contenu);
|
||||||
|
|
||||||
@ -44,7 +45,6 @@ private:
|
|||||||
NotePad *notePad;
|
NotePad *notePad;
|
||||||
|
|
||||||
bool edition = true;
|
bool edition = true;
|
||||||
bool backPack = false;
|
|
||||||
QString currentFile;
|
QString currentFile;
|
||||||
QList<Character*> characters;
|
QList<Character*> characters;
|
||||||
Character* currentCharacter;
|
Character* currentCharacter;
|
||||||
|
|||||||
1877
mainwindow.ui
1877
mainwindow.ui
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user