Beispiel #1
0
void LandscapeToolsPanel::WillAppear()
{
    if(selectionPanel)
    {
        selectedBrushTool = selectionPanel->Tool();
        selectedTool = selectedBrushTool;
        if(selectedBrushTool)
        {
            brushIcon->SetSprite(selectedBrushTool->sprite, 0);
        }
        else 
        {
            brushIcon->SetSprite(NULL, 0);
        }
        ToolIconSelected(brushIcon);
    }
    
    UpdateRect();
}
Beispiel #2
0
void LandscapeToolsPanel::OnBrushTool(DAVA::BaseObject *, void *, void *)
{
    if(selectedTool == selectedBrushTool)
    {
        if(selectionPanel)
        {
            selectionPanel->Show();
        }
    }
    else 
    {
        selectedTool = selectedBrushTool;
        if(delegate)
        {
            delegate->OnToolSelected(selectedTool);
        }
    }
    
    ToolIconSelected(brushIcon);
}
void LandscapeToolsPanelHeightmap::OnDropperTool(DAVA::BaseObject *, void *, void *)
{
    selectedTool = dropperTool;
    if(delegate)
    {
        delegate->OnToolSelected(selectedTool);
    }
    
    if(average->Checked())
    {
        average->SetChecked(false, true);
    }
    if(relative->Checked())
    {
        relative->SetChecked(false, true);
    }
    if(absoluteDropper->Checked())
    {
        absoluteDropper->SetChecked(false, true);
    }
    
    ToolIconSelected(dropperIcon);
}
void LandscapeToolsPanelHeightmap::OnCopypasteTool(DAVA::BaseObject *, void *, void *)
{
    copypasteTool->size = sizeSlider->GetValue();
    copypasteTool->strength = strengthSlider->GetValue();
    copypasteTool->averageStrength = averageStrength->GetValue();
    
    SafeRelease(copypasteTool->sprite);
    SafeRelease(copypasteTool->image);
    if(selectedBrushTool)
    {
        copypasteTool->sprite = SafeRetain(selectedBrushTool->sprite);
        copypasteTool->image = SafeRetain(selectedBrushTool->image);
    }
    
    
    selectedTool = copypasteTool;
    
    if(delegate)
    {
        delegate->OnToolSelected(selectedTool);
    }
    
    if(average->Checked())
    {
        average->SetChecked(false, true);
    }
    if(relative->Checked())
    {
        relative->SetChecked(false, true);
    }
    if(absoluteDropper->Checked())
    {
        absoluteDropper->SetChecked(false, true);
    }
    
    ToolIconSelected(copypasteIcon);
}