From 548dfac58cfc332555ed4dd9654fb93f6391a970 Mon Sep 17 00:00:00 2001 From: Lutz Date: Sun, 21 Jan 2018 13:57:45 -0600 Subject: [PATCH 1/3] + Added 'CloseIdentifyGUI()' for consistency --- src/interface/identify_and_appraise.cpp | 6 ++++++ src/interface/interface.hpp | 1 + 2 files changed, 7 insertions(+) diff --git a/src/interface/identify_and_appraise.cpp b/src/interface/identify_and_appraise.cpp index f1879d119..53f0ae65f 100644 --- a/src/interface/identify_and_appraise.cpp +++ b/src/interface/identify_and_appraise.cpp @@ -79,6 +79,12 @@ void rebuildIdentifyGUIInventory() } } +void CloseIdentifyGUI() +{ + identifygui_active = false; + selectedIdentifySlot = -1; +} + void updateIdentifyGUI() { //if (openedChest[clientnum]) diff --git a/src/interface/interface.hpp b/src/interface/interface.hpp index 4254aa7b1..694bc4b0a 100644 --- a/src/interface/interface.hpp +++ b/src/interface/interface.hpp @@ -220,6 +220,7 @@ extern int selectedIdentifySlot; void selectIdentifySlot(int slot); void warpMouseToSelectedIdentifySlot(); +void CloseIdentifyGUI(); void updateIdentifyGUI(); //Updates the identify item GUI. void identifyGUIIdentify(Item* item); //Identify the given item. int getAppraisalTime(Item* item); // Return time in ticks needed to appraise an item From 5735cefc348ca51294842218b8315afcb889433d Mon Sep 17 00:00:00 2001 From: Lutz Date: Sun, 21 Jan 2018 13:59:45 -0600 Subject: [PATCH 2/3] * Changed Remove Curse spell for Client to send 'CRCU' instead --- src/magic/castSpell.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/magic/castSpell.cpp b/src/magic/castSpell.cpp index 5f23c867f..beac78ed5 100644 --- a/src/magic/castSpell.cpp +++ b/src/magic/castSpell.cpp @@ -569,7 +569,7 @@ Entity* castSpell(Uint32 caster_uid, spell_t* spell, bool using_magicstaff, bool if (i != 0) { //Tell the client to uncurse an item. - strcpy((char*)net_packet->data, "RCUR"); //TODO: Send a different packet, to pop open the remove curse GUI. + strcpy((char*)net_packet->data, "CRCU"); net_packet->address.host = net_clients[i - 1].host; net_packet->address.port = net_clients[i - 1].port; net_packet->len = 4; @@ -582,6 +582,12 @@ Entity* castSpell(Uint32 caster_uid, spell_t* spell, bool using_magicstaff, bool gui_mode = GUI_MODE_INVENTORY; //Reset the GUI to the inventory. removecursegui_active = true; identifygui_active = false; + + if ( identifygui_active ) + { + CloseIdentifyGUI(); + } + if ( openedChest[i] ) { openedChest[i]->closeChest(); From 529a523e6d81fc8b70aa40bef03fedbf97cef6ac Mon Sep 17 00:00:00 2001 From: Lutz Date: Sun, 21 Jan 2018 14:17:42 -0600 Subject: [PATCH 3/3] + Added packet 'CRCU' which opens Remove Curse GUI on Client --- src/net.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/src/net.cpp b/src/net.cpp index 089100ca8..8f4bab781 100644 --- a/src/net.cpp +++ b/src/net.cpp @@ -2727,6 +2727,28 @@ void clientHandlePacket() return; } + // Open up the Remove Curse GUI + else if ( !strncmp((char*)net_packet->data, "CRCU", 4) ) + { + removecursegui_active = true; + shootmode = false; + gui_mode = GUI_MODE_INVENTORY; + + if ( identifygui_active ) + { + CloseIdentifyGUI(); + } + + if ( openedChest[clientnum] ) + { + openedChest[clientnum]->closeChest(); + } + + initRemoveCurseGUIControllerCode(); + + return; + } + //Add a spell to the channeled spells list. else if (!strncmp((char*)net_packet->data, "CHAN", 4)) {