remove of visualisation and backPackTextEdit functional
This commit is contained in:
parent
04a2663a46
commit
646ec2fb0c
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();
|
||||
classe = json["classe"].toString();
|
||||
niveau = json["niveau"].toInt();
|
||||
|
||||
sexe = json["sexe"].toString();
|
||||
taille = json["taille"].toDouble();
|
||||
vie = json["vie"].toInt();
|
||||
|
||||
10
data/a.txt
10
data/a.txt
@ -1,10 +1,10 @@
|
||||
{
|
||||
"age": 0,
|
||||
"backPack": "",
|
||||
"blocNote": "dghdgdgfgd",
|
||||
"age": 1,
|
||||
"backPack": "ssdgfsdgd",
|
||||
"blocNote": "'(y'eyhrhyrhr",
|
||||
"classe": "",
|
||||
"image": "data/images/logo.png",
|
||||
"name": "",
|
||||
"name": "dfh",
|
||||
"niveau": 0,
|
||||
"race": "",
|
||||
"sexe": "",
|
||||
@ -45,5 +45,5 @@
|
||||
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->niveauLineEdit->setValidator(new QIntValidator(0, 999999, ui->niveauLineEdit));
|
||||
ui->tailleLineEdit->setValidator(new QDoubleValidator(0.0, 999999.0, 1,ui->tailleLineEdit));
|
||||
ui->BackPack->setHidden(true);
|
||||
|
||||
|
||||
loadImage(QString("data/images/logo.png"));
|
||||
}
|
||||
|
||||
@ -60,6 +63,7 @@ void MainWindow::loadNewCharacter(){
|
||||
|
||||
void MainWindow::createNewCharacter(Character* p) {
|
||||
notePad->setTexte(p->getTexteBlocNote());
|
||||
ui->BackPackPlainTextEdit->setPlainText(p->getTexteBlocNote());
|
||||
currentCharacter = p;
|
||||
characters.append(p);
|
||||
setUi(p);
|
||||
@ -103,9 +107,7 @@ void MainWindow::saveJson(){
|
||||
return;
|
||||
}
|
||||
|
||||
if(edition){
|
||||
getUi();
|
||||
}
|
||||
getUi();
|
||||
notePad->getUi();
|
||||
currentCharacter->setTexteBlocNote(notePad->getTexte());
|
||||
QJsonObject json;
|
||||
@ -153,9 +155,7 @@ void MainWindow::saveAsJson(){
|
||||
setWindowTitle(fileName);
|
||||
currentFile = fileName;
|
||||
|
||||
if(edition){
|
||||
getUi();
|
||||
}
|
||||
getUi();
|
||||
notePad->getUi();
|
||||
currentCharacter->setTexteBlocNote(notePad->getTexte());
|
||||
QJsonObject json;
|
||||
@ -228,6 +228,7 @@ void MainWindow::getUi(){
|
||||
}
|
||||
}
|
||||
currentCharacter->setStats(stats);
|
||||
currentCharacter->setTexteBackPack(ui->BackPackPlainTextEdit->toPlainText());
|
||||
//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){
|
||||
currentCharacter->setTexteBlocNote(contenu);
|
||||
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();}
|
||||
@ -298,4 +292,6 @@ void MainWindow::on_actionNouvelle_fiche_triggered(){this->createNewCharacter(ne
|
||||
void MainWindow::on_actionSauvegarder_triggered(){this->saveJson();}
|
||||
void MainWindow::on_actionEnregistrer_sous_triggered(){this->saveAsJson();}
|
||||
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 getUi();
|
||||
void setUi(Character* p);
|
||||
void toogleBackPack();
|
||||
|
||||
private slots:
|
||||
void on_actionEditer_triggered();
|
||||
void on_actionBlocNote_triggered();
|
||||
void on_actionOuvrir_une_fiche_triggered();
|
||||
void on_actionNouvelle_fiche_triggered();
|
||||
void on_actionSauvegarder_triggered();
|
||||
void on_actionEnregistrer_sous_triggered();
|
||||
void on_actionFermer_triggered();
|
||||
void on_actionBackPack_triggered();
|
||||
|
||||
void recevoirSauvegarde(QString contenu);
|
||||
|
||||
@ -44,7 +45,6 @@ private:
|
||||
NotePad *notePad;
|
||||
|
||||
bool edition = true;
|
||||
bool backPack = false;
|
||||
QString currentFile;
|
||||
QList<Character*> characters;
|
||||
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