Skip to content

Commit

Permalink
Revert "Attempt at adding auction dialog functionality"
Browse files Browse the repository at this point in the history
This reverts commit e134889.
  • Loading branch information
brightrim committed Jun 18, 2024
1 parent e134889 commit 47b43be
Show file tree
Hide file tree
Showing 19 changed files with 1 addition and 470 deletions.
4 changes: 0 additions & 4 deletions src/Character.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1472,10 +1472,6 @@ void Character::requestMerchantDialog(MerchantDialog *merchantDialog) {
// Nothing to do here, overloaded in Player
}

void Character::requestAuctionDialog(AuctionDialog *auctionDialog) {
// Nothing to do here, overloaded in Player
}

void Character::requestSelectionDialog(SelectionDialog *selectionDialog) {
// Nothing to do here, overloaded in Player
}
Expand Down
2 changes: 0 additions & 2 deletions src/Character.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
#include "dialog/CraftingDialog.hpp"
#include "dialog/InputDialog.hpp"
#include "dialog/MerchantDialog.hpp"
#include "dialog/AuctionDialog.hpp"
#include "dialog/MessageDialog.hpp"
#include "dialog/SelectionDialog.hpp"
#include "tuningConstants.hpp"
Expand Down Expand Up @@ -429,7 +428,6 @@ class Character {
virtual void requestInputDialog(InputDialog *inputDialog);
virtual void requestMessageDialog(MessageDialog *messageDialog);
virtual void requestMerchantDialog(MerchantDialog *merchantDialog);
virtual void requestAuctionDialog(AuctionDialog *auctionDialog);
virtual void requestSelectionDialog(SelectionDialog *selectionDialog);
virtual void requestCraftingDialog(CraftingDialog *craftingDialog);
virtual void requestCraftingLookAt(unsigned int dialogId, ItemLookAt &lookAt);
Expand Down
48 changes: 0 additions & 48 deletions src/Player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
#include "dialog/CraftingDialog.hpp"
#include "dialog/InputDialog.hpp"
#include "dialog/MerchantDialog.hpp"
#include "dialog/AuctionDialog.hpp"
#include "dialog/MessageDialog.hpp"
#include "dialog/SelectionDialog.hpp"
#include "map/Field.hpp"
Expand Down Expand Up @@ -2546,53 +2545,6 @@ void Player::executeMerchantDialogLookAt(unsigned int dialogId, uint8_t list, ui
}
}

void Player::requestAuctionDialog(AuctionDialog *auctionDialog) {
requestDialog<AuctionDialog, AuctionDialogTC>(auctionDialog);
}

void Player::executeAuctionDialogAbort(unsigned int dialogId) {
auto auctionDialog = getDialog<AuctionDialog>(dialogId);

if (auctionDialog) {
auctionDialog->setResult(AuctionDialog::playerAborts);
auctionDialog->setPurchaseIndex(0);
auctionDialog->setPurchaseAmount(0);
ScriptItem item;
auctionDialog->setSaleItem(item);
LuaScript::executeDialogCallback(*auctionDialog);
}

dialogs.erase(dialogId);
}

void Player::executeAuctionDialogBid(unsigned int dialogId, AuctionDialog::index_type index,
Item::number_type amount) const {
auto auctionDialog = getDialog<AuctionDialog>(dialogId);

if (auctionDialog) {
auctionDialog->setResult(AuctionDialog::playerBids);
auctionDialog->setPurchaseIndex(index);
auctionDialog->setPurchaseAmount(amount);
ScriptItem item;
auctionDialog->setSaleItem(item);
LuaScript::executeDialogCallback(*auctionDialog);
}
}

void Player::executeAuctionDialogLookAt(unsigned int dialogId, uint8_t list, uint8_t slot) {
auto auctionDialog = getDialog<AuctionDialog>(dialogId);

if (auctionDialog) {
auctionDialog->setResult(AuctionDialog::playerLooksAt);
auctionDialog->setLookAtList(static_cast<AuctionDialog::ListType>(list));
auctionDialog->setPurchaseIndex(slot);
auto lookAt = LuaScript::executeDialogCallback<ItemLookAt>(*auctionDialog);

ServerCommandPointer cmd = std::make_shared<LookAtDialogGroupItemTC>(dialogId, list, slot, lookAt);
Connection->addCommand(cmd);
}
}

void Player::requestSelectionDialog(SelectionDialog *selectionDialog) {
requestDialog<SelectionDialog, SelectionDialogTC>(selectionDialog);
}
Expand Down
7 changes: 0 additions & 7 deletions src/Player.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
#include "Item.hpp"
#include "Showcase.hpp"
#include "dialog/MerchantDialog.hpp"
#include "dialog/AuctionDialog.hpp"
#include "dialog/SelectionDialog.hpp"
#include "netinterface/BasicServerCommand.hpp"
#include "netinterface/NetInterface.hpp"
Expand Down Expand Up @@ -510,12 +509,6 @@ class Player : public Character {
Item::number_type amount);
void executeMerchantDialogLookAt(unsigned int dialogId, uint8_t list, uint8_t slot);

void requestAuctionDialog(AuctionDialog *auctionDialog) override;
void executeAuctionDialogAbort(unsigned int dialogId);
void executeAuctionDialogBid(unsigned int dialogId, AuctionDialog::index_type index,
Item::number_type amount) const;
void executeAuctionDialogLookAt(unsigned int dialogId, uint8_t list, uint8_t slot);

void requestSelectionDialog(SelectionDialog *selectionDialog) override;
void executeSelectionDialog(unsigned int dialogId, bool success, SelectionDialog::index_type index);

Expand Down
103 changes: 0 additions & 103 deletions src/dialog/AuctionDialog.cpp

This file was deleted.

126 changes: 0 additions & 126 deletions src/dialog/AuctionDialog.hpp

This file was deleted.

1 change: 0 additions & 1 deletion src/dialog/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ target_sources( dialog
Dialog.cpp
InputDialog.cpp
MerchantDialog.cpp
AuctionDialog.cpp
MessageDialog.cpp
SelectionDialog.cpp
)
Expand Down
1 change: 0 additions & 1 deletion src/netinterface/CommandFactory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ CommandFactory::CommandFactory() {
templateList[C_MESSAGEDIALOG_TS] = std::make_unique<MessageDialogTS>();
templateList[C_INPUTDIALOG_TS] = std::make_unique<InputDialogTS>();
templateList[C_MERCHANTDIALOG_TS] = std::make_unique<MerchantDialogTS>();
templateList[C_AUCTIONDIALOG_TS] = std::make_unique<AuctionDialogTS>();
templateList[C_SELECTIONDIALOG_TS] = std::make_unique<SelectionDialogTS>();
templateList[C_CRAFTINGDIALOG_TS] = std::make_unique<CraftingDialogTS>();
templateList[C_LOGIN_TS] = std::make_unique<LoginCommandTS>();
Expand Down
Loading

0 comments on commit 47b43be

Please sign in to comment.