Implement api for checkboxes
This commit is contained in:
parent
bf64764103
commit
7072c001af
3 changed files with 34 additions and 1 deletions
|
@ -89,6 +89,12 @@ public:
|
|||
Q_INVOKABLE QString getSecondaryTileset();
|
||||
Q_INVOKABLE void setPrimaryTileset(QString tileset);
|
||||
Q_INVOKABLE void setSecondaryTileset(QString tileset);
|
||||
Q_INVOKABLE void setGridVisibility(bool visible);
|
||||
Q_INVOKABLE bool getGridVisibility();
|
||||
Q_INVOKABLE void setBorderVisibility(bool visible);
|
||||
Q_INVOKABLE bool getBorderVisibility();
|
||||
Q_INVOKABLE void setSmartPathsEnabled(bool visible);
|
||||
Q_INVOKABLE bool getSmartPathsEnabled();
|
||||
Q_INVOKABLE void registerAction(QString functionName, QString actionName);
|
||||
|
||||
|
||||
|
|
|
@ -2961,6 +2961,30 @@ void MainWindow::setSecondaryTileset(QString tileset) {
|
|||
this->on_comboBox_SecondaryTileset_currentTextChanged(tileset);
|
||||
}
|
||||
|
||||
void MainWindow::setGridVisibility(bool visible) {
|
||||
this->ui->checkBox_ToggleGrid->setChecked(visible);
|
||||
}
|
||||
|
||||
bool MainWindow::getGridVisibility() {
|
||||
return this->ui->checkBox_ToggleGrid->isChecked();
|
||||
}
|
||||
|
||||
void MainWindow::setBorderVisibility(bool visible) {
|
||||
this->editor->toggleBorderVisibility(visible);
|
||||
}
|
||||
|
||||
bool MainWindow::getBorderVisibility() {
|
||||
return this->ui->checkBox_ToggleBorder->isChecked();
|
||||
}
|
||||
|
||||
void MainWindow::setSmartPathsEnabled(bool visible) {
|
||||
this->ui->checkBox_smartPaths->setChecked(visible);
|
||||
}
|
||||
|
||||
bool MainWindow::getSmartPathsEnabled() {
|
||||
return this->ui->checkBox_smartPaths->isChecked();
|
||||
}
|
||||
|
||||
void MainWindow::registerAction(QString functionName, QString actionName) {
|
||||
if (!this->ui || !this->ui->menuTools)
|
||||
return;
|
||||
|
|
|
@ -11,6 +11,8 @@ function applyTint(palette, tint) {
|
|||
}
|
||||
}
|
||||
|
||||
let visible = true;
|
||||
|
||||
function applyTintToPalettes(tint) {
|
||||
try {
|
||||
// const primaryPalettes = map.getPrimaryTilesetPalettes()
|
||||
|
@ -23,7 +25,8 @@ function applyTintToPalettes(tint) {
|
|||
|
||||
// map.setPrimaryTilesetPalettesPreview(primaryPalettes)
|
||||
// map.setSecondaryTilesetPalettesPreview(secondaryPalettes)
|
||||
map.setSecondaryTileset("gTileset_Rustboro")
|
||||
console.log(map.setSmartPathsEnabled(visible))
|
||||
visible = !visible
|
||||
} catch(err) {
|
||||
console.log(err)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue