mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2024-11-15 14:09:06 +00:00
ParallaxLock fix + little layer hiding improvement
Fixed an oversight where not all parallax layers got their parallaxLock status cleared in case the map file was missing this attribute, or not all affected layers were listed there. The editor does now no longer switch to a layer when hiding it (Alt+Layer key). It is still possible to edit invisible layers, though.
This commit is contained in:
parent
90b613b1fb
commit
35b52af0ac
2 changed files with 8 additions and 18 deletions
|
@ -6442,7 +6442,7 @@ void Game::applyState()
|
||||||
dsq->overlay->color = 0;
|
dsq->overlay->color = 0;
|
||||||
|
|
||||||
|
|
||||||
for (i = LR_ELEMENTS1; i <= LR_ELEMENTS12; i++)
|
for (i = LR_ELEMENTS1; i <= LR_ELEMENTS12; i++) // LR_ELEMENTS13 is darkness, stop before that
|
||||||
{
|
{
|
||||||
dsq->game->setElementLayerVisible(i-LR_ELEMENTS1, true);
|
dsq->game->setElementLayerVisible(i-LR_ELEMENTS1, true);
|
||||||
}
|
}
|
||||||
|
@ -6453,7 +6453,7 @@ void Game::applyState()
|
||||||
cameraConstrained = true;
|
cameraConstrained = true;
|
||||||
// reset parallax
|
// reset parallax
|
||||||
RenderObjectLayer *l = 0;
|
RenderObjectLayer *l = 0;
|
||||||
for (i = LR_ELEMENTS10; i <= LR_ELEMENTS12; i++)
|
for (i = LR_ELEMENTS10; i <= LR_ELEMENTS16; i++)
|
||||||
{
|
{
|
||||||
l = &dsq->renderObjectLayers[i];
|
l = &dsq->renderObjectLayers[i];
|
||||||
l->followCamera = 0;
|
l->followCamera = 0;
|
||||||
|
|
|
@ -2499,36 +2499,26 @@ void SceneEditor::action(int id, int state)
|
||||||
}
|
}
|
||||||
else if (editType == ET_ELEMENTS && state && id >= ACTION_BGLAYER1 && id < ACTION_BGLAYEREND)
|
else if (editType == ET_ELEMENTS && state && id >= ACTION_BGLAYER1 && id < ACTION_BGLAYEREND)
|
||||||
{
|
{
|
||||||
/*
|
int newLayer = id - ACTION_BGLAYER1;
|
||||||
std::string copy = action;
|
|
||||||
copy = copy.substr(std::string("bgLayer").length(), action.length());
|
|
||||||
std::istringstream is(copy);
|
|
||||||
int v;
|
|
||||||
is >> v;
|
|
||||||
this->bgLayer = v-1;
|
|
||||||
*/
|
|
||||||
|
|
||||||
int v = id - ACTION_BGLAYER1;
|
|
||||||
this->bgLayer = v;
|
|
||||||
|
|
||||||
updateText();
|
updateText();
|
||||||
|
|
||||||
if (core->getAltState())
|
if (core->getAltState())
|
||||||
{
|
{
|
||||||
dsq->game->setElementLayerVisible(bgLayer, !dsq->game->isElementLayerVisible(bgLayer));
|
dsq->game->setElementLayerVisible(newLayer, !dsq->game->isElementLayerVisible(newLayer));
|
||||||
//core->getRenderObjectLayer(LR_ELEMENTS1+bgLayer)->visible = !core->getRenderObjectLayer(LR_ELEMENTS1+bgLayer)->visible;
|
return; // do not switch to the layer that was just hidden
|
||||||
}
|
}
|
||||||
else if (core->getShiftState() && (editingElement || !selectedElements.empty()))
|
else if (core->getShiftState() && (editingElement || !selectedElements.empty()))
|
||||||
{
|
{
|
||||||
moveElementToLayer(editingElement, bgLayer);
|
moveElementToLayer(editingElement, newLayer);
|
||||||
//editingElement->bgLayer
|
|
||||||
//editingElement->bgLayer = this->bgLayer;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
selectedElements.clear();
|
selectedElements.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this->bgLayer = newLayer;
|
||||||
|
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
Vector multiSelectPoint, secondMultiSelectPoint;
|
Vector multiSelectPoint, secondMultiSelectPoint;
|
||||||
|
|
Loading…
Reference in a new issue