Found your great client today... Finally somebody completed the task of doing a real client based on one of the RO-protocol-servers, even if you're going to change the protocol/server soon.
Anyways, just saw http://www.lindeijer.nl/flyspray/?do=details&id=7
I never used eathena, just got my old yare/nezumi cvs/work dumps/packetlist, so it would be great if you could release your cvs for the server to the public (If you're not using eathena without any code changes, then I'll just get newest eathena version)...
But anyways, this will reimplement the Cancel Button and make it reenable walking around (Sorry, no .diff)
File: /src/gui/npc.c
Code: Select all
NpcListDialog::NpcListDialog():
Window("NPC")
{
itemList = new ListBox(this);
scrollArea = new ScrollArea(itemList);
okButton = new Button("OK");
cancelButton = new Button("Cancel");
setSize(260, 175);
scrollArea->setDimension(gcn::Rectangle(
5, 5, 250, 160 - okButton->getHeight()));
okButton->setPosition(
260 - 5 - okButton->getWidth(),
175 - 5 - okButton->getHeight());
cancelButton->setPosition(
260 - 5 - okButton->getWidth() - 5 - cancelButton->getWidth(),
175 - 5 - cancelButton->getHeight());
itemList->setEventId("item");
okButton->setEventId("ok");
cancelButton->setEventId("cancel");
itemList->addActionListener(this);
okButton->addActionListener(this);
cancelButton->addActionListener(this);
add(scrollArea);
add(okButton);
add(cancelButton);
setLocationRelativeTo(getParent());
}
Code: Select all
NpcListDialog::~NpcListDialog()
{
delete okButton;
delete cancelButton;
delete itemList;
delete scrollArea;
}
Code: Select all
void NpcListDialog::action(const std::string& eventId)
{
if (eventId == "ok") {
// Send the selected index back to the server
int selectedIndex = itemList->getSelected();
if (selectedIndex > -1) {
WFIFOW(0) = net_w_value(0x00b8);
WFIFOL(2) = net_l_value(current_npc);
WFIFOB(6) = net_b_value(selectedIndex + 1);
WFIFOSET(7);
setVisible(false);
reset();
}
}
else if (eventId == "cancel") {
// 0xff packet means cancel
WFIFOW(0) = net_w_value(0x00b8);
WFIFOL(2) = net_l_value(current_npc);
WFIFOB(6) = net_b_value(0xff);
WFIFOSET(7);
setVisible(false);
reset();
}
}
And something slightly different: A question regarding your desired npc system:
Currently walking while talking to a npc is either enabled (= other players see you walk) (this happens, if the textbox you read happens to be the last one before close (ok = close)) or disabled (You can walk, but others don't see it)
This is (as far as i can guess without direct yare-eathena-client-comparison) a server-side problem....So another reason to give us the server cvs
Anyways, the question: How do you want the walking-while-talking to be?
Do you actually want the players to be able to walk while talking to a npc?
Or do you want them not to be able to walk? On local client & on others clients..
Or do you want the player to be able to walk, but only in a special range around the npc (for example 10 tiles) and if he leaves, the npc window either just disappears or he's stopped at the outer ring of this range....
Just asking because I'm pretty bored these days (yay school) and would like to help you getting forward if you don't mind
Have a nice day
Mra