From fddfde994fe98843db6802f438a5f23941836642 Mon Sep 17 00:00:00 2001
From: Andrei Karas <akaras@inbox.ru>
Date: Wed, 13 Jun 2018 04:29:42 +0300
Subject: Add cz enum for types in packet 0x0a68.

---
 src/map/clif.c   | 12 ++++++------
 src/map/clif.h   | 30 +++++++++++++++++++++---------
 src/map/script.c |  2 +-
 3 files changed, 28 insertions(+), 16 deletions(-)

diff --git a/src/map/clif.c b/src/map/clif.c
index a4d2f62b1..9be4feb70 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -20531,7 +20531,7 @@ void clif_parse_open_ui_request(int fd, struct map_session_data *sd)
 	clif->open_ui(sd, p->UIType);
 }
 
-void clif_open_ui(struct map_session_data *sd, int8 UIType)
+void clif_open_ui(struct map_session_data *sd, enum cz_ui_types uiType)
 {
 #if PACKETVER_RE_NUM >= 20180307 || PACKETVER_MAIN_NUM >= 20180404 || PACKETVER_ZERO_NUM >= 20180411
 	int claimed = 0;
@@ -20540,21 +20540,21 @@ void clif_open_ui(struct map_session_data *sd, int8 UIType)
 	nullpo_retv(sd);
 
 	p.PacketType = 0xAE2;
-	switch (UIType) {
-	case STYLIST_UI:
+	switch (uiType) {
+	case CZ_STYLIST_UI:
 		p.UIType = STYLIST_UI;
 		p.data = 0;
 		break;
-	case 5: // client will send 5 for the request but requires to receive ATTENDANCE_UI (7) to open the correct ui.
+	case CZ_ATTENDANCE_UI:
 		if (clif->attendance_timediff(sd) != true)
 			++claimed;
 		else if (sd->status.attendance_count >= VECTOR_LENGTH(clif->attendance_data))
 			sd->status.attendance_count = 0;
-		p.UIType = ATTENDANCE_UI;
+		p.UIType = ZC_ATTENDANCE_UI;
 		p.data = sd->status.attendance_count * 10 + claimed;
 		break;
 	default:
-		ShowWarning("clif_open_ui: Requested UI (%d) is not implemented yet.\n", UIType);
+		ShowWarning("clif_open_ui: Requested UI (%d) is not implemented yet.\n", uiType);
 		return;
 	}
 
diff --git a/src/map/clif.h b/src/map/clif.h
index 20ecf8e8d..40974b063 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -550,19 +550,31 @@ enum CZ_CONFIG {
 	CZ_CONFIG_PET_AUTOFEEDING        = 2,
 	CZ_CONFIG_HOMUNCULUS_AUTOFEEDING = 3,
 };
+
 /**
 * Client UI types
 * used with packet 0xAE2 to request the client to open a specific ui
 **/
-enum ui_types {
-	BANK_UI = 0,
-	STYLIST_UI,
-	CAPTCHA_UI,
-	MACRO_UI,
-	TIPBOX_UI = 5,
-	RENEWQUEST_UI,
-	ATTENDANCE_UI
+enum zc_ui_types {
+	ZC_BANK_UI = 0,
+	ZC_STYLIST_UI,
+	ZC_CAPTCHA_UI,
+	ZC_MACRO_UI,
+	ZC_TIPBOX_UI = 5,
+	ZC_RENEWQUEST_UI,
+	ZC_ATTENDANCE_UI
+};
+
+/**
+* Client to server open ui request types (packet 0x0a68)
+**/
+enum cz_ui_types {
+	CZ_STYLIST_UI = 1,
+	//unknown  = 2,
+	//unknown  = 3,
+	CZ_ATTENDANCE_UI = 5
 };
+
 /**
 * Private Airship Responds
 **/
@@ -1444,7 +1456,7 @@ struct clif_interface {
 	bool (*attendance_timediff) (struct map_session_data *sd);
 	time_t (*attendance_getendtime) (void);
 	void (*pOpenUIRequest) (int fd, struct map_session_data *sd);
-	void (*open_ui) (struct map_session_data *sd, int8 UIType);
+	void (*open_ui) (struct map_session_data *sd, enum cz_ui_types uiType);
 	void (*pAttendanceRewardRequest) (int fd, struct map_session_data *sd);
 	void (*ui_action) (struct map_session_data *sd, int32 UIType, int32 data);
 	void (*pPrivateAirshipRequest) (int fd, struct map_session_data *sd);
diff --git a/src/map/script.c b/src/map/script.c
index d9350081a..1f4a42669 100644
--- a/src/map/script.c
+++ b/src/map/script.c
@@ -24168,7 +24168,7 @@ BUILDIN(openstylist)
 	if (sd == NULL)
 		return false;
 
-	clif->open_ui(sd, STYLIST_UI);
+	clif->open_ui(sd, CZ_STYLIST_UI);
 	return true;
 }
 
-- 
cgit v1.2.3-70-g09d2