Beispiel #1
0
void MapperGui::valueChanged(const gcn::SelectionEvent& event){
    //if event from drop down
    if( event.getSource() == tilesetBox->getTilesetDropDown() ){
        //change the info source for tilset info box
        tilesetDetailsBox->setInfoSource( tilesetBox->getSelectedTileset() );
    }
}
Beispiel #2
0
void WindowMenu::valueChanged(const gcn::SelectionEvent &event)
{
    if (event.getSource() == mEmotePopup)
    {
        int emote = mEmotePopup->getSelectedEmote();
        if (emote)
            Net::getPlayerHandler()->emote(emote);

        windowContainer->scheduleDelete(mEmotePopup);
        mEmotePopup = 0;
    }
}
Beispiel #3
0
void TradeWindow::valueChanged(const gcn::SelectionEvent &event)
{
    const Item *item;

    /* If an item is selected in one container, make sure no item is selected
     * in the other container.
     */
    if (event.getSource() == mMyItemContainer &&
            (item = mMyItemContainer->getSelectedItem()))
        mPartnerItemContainer->selectNone();
    else if ((item = mPartnerItemContainer->getSelectedItem()))
        mMyItemContainer->selectNone();
}
void InventoryWindow::valueChanged(const gcn::SelectionEvent &event)
{
    if (event.getSource() == mItems)
    {
        Item *item = mItems->getSelectedItem();

        item ? itemShortcut->setSelected(item->getId()) : 
               itemShortcut->setSelected(-1);

        updateButtons();
        distributeValueChangedEvent();
    }
}
void MapperTilesetBox::valueChanged(const gcn::SelectionEvent& event){
    //if event from drop down
    if( event.getSource() == tilesetDropDown ){
        Tileset *newTileset = tilesetList->at( tilesetDropDown->getSelected() );
        selectedTile.setTileset( newTileset );
        if( tilesetList->at( tilesetDropDown->getSelected() ) != attribTs ){
            selectedTile.setAttribute( MapTile::REGULAR );
        } else {
            selectedTile.setAttribute( attribGrid[0][0] );
        }
        setTilesetPreview( newTileset );
    }
}
Beispiel #6
0
void FileDialog::valueChanged(const gcn::SelectionEvent& se)
{
    gcn::Widget *src = se.getSource();
    
    if(src == lbFiles)
    {
        if(IsFileSelected())
            tbFilename->setText(getElementAt(lbFiles->getSelected()));
        else
            tbFilename->setText(""); // do not put directory name in text field if directory selected

        // TODO: update preview, once implemented
    }
}
Beispiel #7
0
void TradeWindow::valueChanged(const gcn::SelectionEvent &event)
{
    if (!mMyItemContainer || !mPartnerItemContainer)
        return;

    /* If an item is selected in one container, make sure no item is selected
     * in the other container.
     */
    if (event.getSource() == mMyItemContainer &&
        mMyItemContainer->getSelectedItem())
    {
        mPartnerItemContainer->selectNone();
    }
    else if (mPartnerItemContainer->getSelectedItem())
    {
        mMyItemContainer->selectNone();
    }
}
void EquipmentWindow::valueChanged(const gcn::SelectionEvent &event)
{
    if (event.getSource() == mItems)
        updateButtons();
}
Beispiel #9
0
void StorageWindow::valueChanged(const gcn::SelectionEvent &event)
{
    if (event.getSource() == mItems)
        mRetrieveButton->setEnabled(mItems->getSelectedItem() != 0);
}