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();
|
||||
}
|
||||
notePad->getUi();
|
||||
currentCharacter->setTexteBlocNote(notePad->getTexte());
|
||||
QJsonObject json;
|
||||
@ -153,9 +155,7 @@ void MainWindow::saveAsJson(){
|
||||
setWindowTitle(fileName);
|
||||
currentFile = fileName;
|
||||
|
||||
if(edition){
|
||||
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;
|
||||
|
||||
@ -17,11 +17,26 @@
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<widget class="QFrame" name="Edition">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>590</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Shape::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Shadow::Raised</enum>
|
||||
</property>
|
||||
<widget class="QFrame" name="topFrame">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>2</y>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>278</height>
|
||||
</rect>
|
||||
@ -494,9 +509,9 @@
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>280</y>
|
||||
<y>278</y>
|
||||
<width>800</width>
|
||||
<height>581</height>
|
||||
<height>312</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
@ -985,6 +1000,33 @@
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QFrame" name="BackPack">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>590</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Shape::StyledPanel</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Shadow::Raised</enum>
|
||||
</property>
|
||||
<widget class="QPlainTextEdit" name="BackPackPlainTextEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>800</width>
|
||||
<height>590</height>
|
||||
</rect>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</widget>
|
||||
<widget class="QMenuBar" name="menubar">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
@ -1017,8 +1059,9 @@
|
||||
<attribute name="toolBarBreak">
|
||||
<bool>false</bool>
|
||||
</attribute>
|
||||
<addaction name="actionEditer"/>
|
||||
<addaction name="actionBlocNote"/>
|
||||
<addaction name="actionBackPack"/>
|
||||
<addaction name="separator"/>
|
||||
</widget>
|
||||
<action name="actionOuvrir_une_fiche">
|
||||
<property name="text">
|
||||
@ -1052,17 +1095,6 @@
|
||||
<string>Ctrl+Q</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionEditer">
|
||||
<property name="icon">
|
||||
<iconset theme="QIcon::ThemeIcon::MailMessageNew"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Editer</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionBlocNote">
|
||||
<property name="icon">
|
||||
<iconset theme="QIcon::ThemeIcon::DocumentPageSetup"/>
|
||||
@ -1082,6 +1114,17 @@
|
||||
<string>Ctrl+N</string>
|
||||
</property>
|
||||
</action>
|
||||
<action name="actionBackPack">
|
||||
<property name="icon">
|
||||
<iconset theme="folder"/>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>BackPack</string>
|
||||
</property>
|
||||
<property name="menuRole">
|
||||
<enum>QAction::MenuRole::NoRole</enum>
|
||||
</property>
|
||||
</action>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user