|
@@ -11,9 +11,13 @@ StatusConfig::StatusConfig(QWidget *parent) :
|
|
|
ui(new Ui::StatusConfig)
|
|
|
{
|
|
|
ui->setupUi(this);
|
|
|
- ui->tableWidget_event->setHorizontalHeaderLabels({"事件名称","是否需要颜色一致","状态变化幅度","特效","根据格子数量消除","触发动作","触发动作设置"});
|
|
|
+ ui->tableWidget_event->setHorizontalHeaderLabels({"事件名称","是否需要颜色一致","状态变化幅度","特效","根据格子数量消除"});
|
|
|
ui->lineEdit_collectionType->setReadOnly(true);
|
|
|
ui->comboBox_collectAnimation->setDisabled(true);
|
|
|
+
|
|
|
+ // 动作选择和配置
|
|
|
+ connect(ui->pushButton_actionCfg,SIGNAL(clicked()),this,SLOT(onSetActionButtonClicked()));
|
|
|
+ connect(ui->comboBox_action,SIGNAL(currentTextChanged(QString)),this,SLOT(onActionBoxTextChanged(QString)));
|
|
|
}
|
|
|
|
|
|
StatusConfig::~StatusConfig()
|
|
@@ -93,35 +97,34 @@ void StatusConfig::onEventBoxTextChanged(const QString &arg1)
|
|
|
DataManager::getInstance()->changeEventTable(currentElem,arg1,statusIndex,row,column);
|
|
|
}
|
|
|
|
|
|
+// 动作comboBox选择发生变化
|
|
|
+void StatusConfig::onActionBoxTextChanged(const QString &arg1) {
|
|
|
+ int statusIndex = ui->listWidget_status->currentRow();
|
|
|
+ if(statusIndex == -1 || isSetUi) return;
|
|
|
+ DataManager::getInstance()->changeAction(currentElem,arg1,statusIndex);
|
|
|
+}
|
|
|
+
|
|
|
///动作配置中的设置点击后
|
|
|
void StatusConfig::onSetActionButtonClicked()
|
|
|
{
|
|
|
int statusRow = ui->listWidget_status->currentRow();
|
|
|
if(statusRow == -1) return;
|
|
|
- //获取设置按钮所在位置
|
|
|
- QPushButton *button = dynamic_cast<QPushButton*>(this->sender());
|
|
|
- int x = button->frameGeometry().x();
|
|
|
- int y = button->frameGeometry().y();
|
|
|
- QModelIndex index = ui->tableWidget_event->indexAt(QPoint(x,y));
|
|
|
- int row = index.row();
|
|
|
+ auto status = DataManager::getInstance()->getStatusConfigData(currentElem, statusRow);
|
|
|
QVector<ElemPropertyData::EventConfig> eventTable = DataManager::getInstance()->getStatusConfigData(currentElem,statusRow).eventConfig;
|
|
|
- QString action = eventTable[row].triggerAction;
|
|
|
- std::cout<<"row:"<<row<<std::endl;
|
|
|
- std::cout<<qPrintable(action)<<std::endl;
|
|
|
- createSetWindow(action,row);
|
|
|
+ createSetWindow(status.action);
|
|
|
}
|
|
|
|
|
|
///点击动作配置的设置按钮后生成新窗口
|
|
|
-void StatusConfig::createSetWindow(QString actionName,int row)
|
|
|
+void StatusConfig::createSetWindow(QString actionName)
|
|
|
{
|
|
|
int statusIndex = ui->listWidget_status->currentRow();
|
|
|
if(actionName == "尚未选择"){
|
|
|
QMap<QString,QString> nullMap;
|
|
|
- DataManager::getInstance()->changeActionConfigData(currentElem,statusIndex,row,nullMap);
|
|
|
+ DataManager::getInstance()->changeActionConfigData(currentElem,statusIndex,nullMap);
|
|
|
return;
|
|
|
}
|
|
|
ActionSettingDialog setDialog;
|
|
|
- setDialog.setDialogUi(actionName,currentElem,statusIndex,row);
|
|
|
+ setDialog.setDialogUi(actionName,currentElem,statusIndex);
|
|
|
setDialog.exec();
|
|
|
}
|
|
|
|
|
@@ -153,14 +156,18 @@ void StatusConfig::setAnimComboBox()
|
|
|
isSetUi = true;
|
|
|
ui->comboBox_initAnim->clear();
|
|
|
ui->comboBox_clickAnim->clear();
|
|
|
+ ui->comboBox_action->clear();
|
|
|
ui->comboBox_collectAnimation->clear();
|
|
|
ui->comboBox_initAnim->addItem("尚未选择");
|
|
|
ui->comboBox_clickAnim->addItem("尚未选择");
|
|
|
ui->comboBox_collectAnimation->addItem("尚未选择");
|
|
|
+ ui->comboBox_action->addItem("尚未选择");
|
|
|
QStringList animList = DataManager::getInstance()->getList(currentElem,DataManager::ListType::Anim);
|
|
|
ui->comboBox_clickAnim->addItems(animList);
|
|
|
ui->comboBox_initAnim->addItems(animList);
|
|
|
ui->comboBox_collectAnimation->addItems(DataManager::getInstance()->getList(currentElem,DataManager::ListType::CollAnim));
|
|
|
+ ui->comboBox_action->addItems(DataManager::getInstance()->getList(currentElem,DataManager::ListType::Actions));
|
|
|
+
|
|
|
int row = ui->listWidget_status->currentRow();
|
|
|
if(row != -1) {
|
|
|
ElemPropertyData::StatusConfig statusData = DataManager::getInstance()->getStatusConfigData(currentElem,row);
|
|
@@ -171,7 +178,6 @@ void StatusConfig::setAnimComboBox()
|
|
|
for(int i=0;i<rowNum;i++){
|
|
|
ui->tableWidget_event->setCellWidget(i,3,createBox(event[i].specialEffect,BoxType::Effect));
|
|
|
ui->tableWidget_event->setCellWidget(i,0,createBox(event[i].name,BoxType::Event));
|
|
|
- ui->tableWidget_event->setCellWidget(i,5,createBox(event[i].triggerAction,BoxType::Action));
|
|
|
}
|
|
|
}
|
|
|
isSetUi = false;
|
|
@@ -226,6 +232,9 @@ void StatusConfig::setStatusUi()
|
|
|
//可掉落
|
|
|
if(statusData.dropable) ui->checkBox_dropable->setCheckState(Qt::Checked);
|
|
|
else ui->checkBox_dropable->setCheckState(Qt::Unchecked);
|
|
|
+ // 打击子元素
|
|
|
+ if(statusData.beatSubItem) ui->checkBox_beatSubItem->setCheckState(Qt::Checked);
|
|
|
+ else ui->checkBox_beatSubItem->setCheckState(Qt::Unchecked);
|
|
|
//是否需要收集
|
|
|
ui->lineEdit_collectionType->clear();
|
|
|
if(statusData.needCollect){
|
|
@@ -241,7 +250,17 @@ void StatusConfig::setStatusUi()
|
|
|
ui->comboBox_collectAnimation->setDisabled(true);
|
|
|
ui->comboBox_collectAnimation->setCurrentIndex(0);
|
|
|
}
|
|
|
- //事件配置
|
|
|
+ // action
|
|
|
+ if (statusData.action != "尚未选择") {
|
|
|
+ int index = ui->comboBox_action->findText(statusData.action);
|
|
|
+ if(index != -1) {
|
|
|
+ ui->comboBox_action->setCurrentIndex(index);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ ui->comboBox_action->setCurrentIndex(0);
|
|
|
+ }
|
|
|
+
|
|
|
+ // 事件配置
|
|
|
int rowNum = ui->tableWidget_event->rowCount();
|
|
|
for(int i=0;i<rowNum;i++){
|
|
|
ui->tableWidget_event->removeRow(0);
|
|
@@ -260,10 +279,10 @@ void StatusConfig::setStatusUi()
|
|
|
ui->tableWidget_event->setCellWidget(rowNum,3,createBox(i.specialEffect,BoxType::Effect));
|
|
|
//根据格子数量消除
|
|
|
ui->tableWidget_event->setCellWidget(rowNum,4,createCheckBox(i.elimATLattices));
|
|
|
- //触发动作
|
|
|
- ui->tableWidget_event->setCellWidget(rowNum,5,createBox(i.triggerAction,BoxType::Action));
|
|
|
- //触发动作设置
|
|
|
- ui->tableWidget_event->setCellWidget(rowNum,6,createSetButton());
|
|
|
+// //触发动作
|
|
|
+// ui->tableWidget_event->setCellWidget(rowNum,5,createBox(i.triggerAction,BoxType::Action));
|
|
|
+// //触发动作设置
|
|
|
+// ui->tableWidget_event->setCellWidget(rowNum,6,createSetButton());
|
|
|
}
|
|
|
isSetUi = false;
|
|
|
}
|
|
@@ -285,7 +304,7 @@ void StatusConfig::on_pushButton_addStatus_clicked()
|
|
|
{
|
|
|
int maxLayer = DataManager::getInstance()->getMaxLayer(currentElem).toInt();
|
|
|
QString statusName;
|
|
|
- for(int i=0;i<maxLayer;i++){
|
|
|
+ for(int i=0;i<=maxLayer;i++){
|
|
|
if(!DataManager::getInstance()->existStatusVal(currentElem,QString::number(i))){
|
|
|
statusName = QString::number(i);
|
|
|
break;
|
|
@@ -322,7 +341,7 @@ void StatusConfig::on_listWidget_status_itemDoubleClicked(QListWidgetItem *item)
|
|
|
bool isNum;double tmp = name.toDouble(&isNum);
|
|
|
int maxLayer = DataManager::getInstance()->getMaxLayer(currentElem).toInt();
|
|
|
int statusNum = name.toInt();
|
|
|
- if(!isNum ||statusNum < 0 || statusNum >= maxLayer){
|
|
|
+ if(!isNum ||statusNum < 0 || statusNum > maxLayer){
|
|
|
QMessageBox::critical(this,"错误","状态值必须是大于等于0且小于最大层数的数字");
|
|
|
return;
|
|
|
}
|
|
@@ -352,6 +371,14 @@ void StatusConfig::on_checkBox_dropable_stateChanged(int arg1)
|
|
|
DataManager::getInstance()->setFundCheckBox(currentElem,index,DataManager::CheckType::Dropable,arg1);
|
|
|
}
|
|
|
|
|
|
+///多重打击数据变化
|
|
|
+void StatusConfig::on_checkBox_beatSubItem_stateChanged(int arg1)
|
|
|
+{
|
|
|
+ int index = ui->listWidget_status->currentRow();
|
|
|
+ if(index == -1 || isSetUi) return;
|
|
|
+ DataManager::getInstance()->setFundCheckBox(currentElem,index,DataManager::CheckType::BeatSubitem,arg1);
|
|
|
+}
|
|
|
+
|
|
|
///需要收集数据变化
|
|
|
void StatusConfig::on_checkBox_needCollect_stateChanged(int arg1)
|
|
|
{
|
|
@@ -446,7 +473,7 @@ void StatusConfig::on_comboBox_collectAnimation_currentTextChanged(const QString
|
|
|
{
|
|
|
int index = ui->listWidget_status->currentRow();
|
|
|
if(index==-1 || isSetUi) return;
|
|
|
- std::cout<<"初始化动画:"<<qPrintable(arg1)<<std::endl;
|
|
|
+ std::cout<<"收集动画:"<<qPrintable(arg1)<<std::endl;
|
|
|
DataManager::getInstance()->changeStatusFundVal(currentElem,DataManager::StatusDataType::CollAnim,arg1,index);
|
|
|
}
|
|
|
|