void LandscapeEditorColor::ShowAction() { CreateMaskTexture(); landscapeSize = (int32)maskSprite->GetWidth(); workingLandscape->CursorEnable(); }
void LandscapeEditorColor::TextureDidChanged(const String &forKey) { if("property.landscape.texture.tilemask" == forKey) { CreateMaskTexture(); } }
void LandscapePropertyControl::OnFilepathPropertyChanged(PropertyList *forList, const String &forKey, const String &newValue) { if(EditorSettings::IsValidPath(newValue)) { LandscapeNode *landscape = dynamic_cast<LandscapeNode*> (currentSceneNode); if("property.landscape.heightmap" == forKey) { Vector3 size( propertyList->GetFloatPropertyValue("property.landscape.size"), propertyList->GetFloatPropertyValue("property.landscape.size"), propertyList->GetFloatPropertyValue("property.landscape.height")); AABBox3 bbox; bbox.AddPoint(Vector3(-size.x/2.f, -size.y/2.f, 0.f)); bbox.AddPoint(Vector3(size.x/2.f, size.y/2.f, size.z)); if(newValue.length()) { landscape->BuildLandscapeFromHeightmapImage(newValue, bbox); } } else if("property.landscape.texture.tile0" == forKey) { SetLandscapeTexture(LandscapeNode::TEXTURE_TILE0, newValue); } else if("property.landscape.texture.tile1" == forKey) { SetLandscapeTexture(LandscapeNode::TEXTURE_TILE1, newValue); } else if("property.landscape.texture.tile2" == forKey) { SetLandscapeTexture(LandscapeNode::TEXTURE_TILE2, newValue); } else if("property.landscape.texture.tile3" == forKey) { SetLandscapeTexture(LandscapeNode::TEXTURE_TILE3, newValue); } else if("property.landscape.texture.tilemask" == forKey) { SetLandscapeTexture(LandscapeNode::TEXTURE_TILE_MASK, newValue); } else if("property.landscape.texture.color" == forKey) { SetLandscapeTexture(LandscapeNode::TEXTURE_COLOR, newValue); } else if("property.landscape.texture.tiledtexture" == forKey) { SetLandscapeTexture(LandscapeNode::TEXTURE_TILE_FULL, newValue); } else if( "property.landscape.lightmap" == forKey || "property.landscape.alphamask" == forKey) { String lightMap = propertyList->GetFilepathPropertyValue("property.landscape.lightmap"); String alphaMask = propertyList->GetFilepathPropertyValue("property.landscape.alphamask"); CreateMaskTexture(lightMap, alphaMask); } } NodesPropertyControl::OnFilepathPropertyChanged(forList, forKey, newValue); }