void SwingingBlade::onFrameChanged(FrameChangeType frameChangeType) { auto room = getCurrentRoom(); auto sector = getLevel().findFloorSectorWithClampedPosition( getPosition().toInexact(), &room ); setCurrentRoom( room ); setFloorHeight( HeightInfo::fromFloor( sector, getPosition().toInexact(), getLevel().m_cameraController ) .distance ); ItemNode::onFrameChanged( frameChangeType ); }
// ----------------------------------------------------------------------------- // Apply values to opened objects // ----------------------------------------------------------------------------- void SectorPropsPanel::applyChanges() { for (auto& object : objects_) { auto sector = dynamic_cast<MapSector*>(object); // Special if (cb_override_special_->GetValue()) sector->setIntProperty("special", panel_special_->selectedSpecial()); // Floor texture if (!fcb_floor_->GetValue().IsEmpty()) sector->setFloorTexture(fcb_floor_->GetValue().ToStdString()); // Ceiling texture if (!fcb_ceiling_->GetValue().IsEmpty()) sector->setCeilingTexture(fcb_ceiling_->GetValue().ToStdString()); // Floor height if (!text_height_floor_->GetValue().IsEmpty()) sector->setFloorHeight(text_height_floor_->number(sector->floor().height)); // Ceiling height if (!text_height_ceiling_->GetValue().IsEmpty()) sector->setCeilingHeight(text_height_ceiling_->number(sector->ceiling().height)); // Light level if (!text_light_->GetValue().IsEmpty()) sector->setLightLevel(text_light_->number(sector->lightLevel())); // Tag if (!text_tag_->GetValue().IsEmpty()) sector->setTag(text_tag_->number(sector->tag())); } if (mopp_all_props_) mopp_all_props_->applyChanges(); }