summaryrefslogtreecommitdiff
path: root/src/map/stylist.h
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2019-03-11 03:51:57 +0100
committerGitHub <noreply@github.com>2019-03-11 03:51:57 +0100
commit95bf87b3b3c256f1d84e53a49ee43aab98912932 (patch)
tree661731e4ed4209101696323e235abb127a82822b /src/map/stylist.h
parent0d7b3609715453e100dc38d037fc47fb2337af88 (diff)
parent61ee0a6cee635a5948f1572c89c331b50f80016a (diff)
downloadhercules-95bf87b3b3c256f1d84e53a49ee43aab98912932.tar.gz
hercules-95bf87b3b3c256f1d84e53a49ee43aab98912932.tar.bz2
hercules-95bf87b3b3c256f1d84e53a49ee43aab98912932.tar.xz
hercules-95bf87b3b3c256f1d84e53a49ee43aab98912932.zip
Merge pull request #2400 from Asheraf/stylist_update
moving stylist into it's own interface
Diffstat (limited to 'src/map/stylist.h')
-rw-r--r--src/map/stylist.h69
1 files changed, 69 insertions, 0 deletions
diff --git a/src/map/stylist.h b/src/map/stylist.h
new file mode 100644
index 000000000..5bedfefc7
--- /dev/null
+++ b/src/map/stylist.h
@@ -0,0 +1,69 @@
+/**
+ * This file is part of Hercules.
+ * http://herc.ws - http://github.com/HerculesWS/Hercules
+ *
+ * Copyright (C) 2018-2019 Hercules Dev Team
+ *
+ * Hercules is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+#ifndef MAP_STYLIST_H
+#define MAP_STYLIST_H
+
+#include "common/hercules.h"
+#include "map/map.h" // LOOK_MAX
+
+struct map_session_data;
+
+/* Maximum available types for stylist */
+#ifndef MAX_STYLIST_TYPE
+#define MAX_STYLIST_TYPE LOOK_MAX
+#endif
+
+/* Stylist data [Asheraf/Hercules]*/
+struct stylist_data_entry {
+ int16 id;
+ int32 zeny;
+ int itemid;
+ int boxid;
+ bool allow_doram;
+};
+
+/**
+ * stylist.c Interface
+ **/
+struct stylist_interface {
+ VECTOR_DECL(struct stylist_data_entry) data[MAX_STYLIST_TYPE];
+
+ void (*init) (bool minimal);
+ void (*final) (void);
+
+ void (*vector_init) (void);
+ void (*vector_clear) (void);
+
+ bool (*read_db_libconfig) (void);
+ bool (*read_db_libconfig_sub) (struct config_setting_t *it, int idx, const char *source);
+
+ void (*request_style_change) (struct map_session_data *sd, int type, int16 idx, bool isitem);
+ bool (*validate_requirements) (struct map_session_data *sd, int type, int16 idx);
+ void (*send_rodexitem) (struct map_session_data *sd, int itemid);
+
+};
+
+#ifdef HERCULES_CORE
+void stylist_defaults(void);
+#endif // HERCULES_CORE
+
+HPShared struct stylist_interface *stylist; ///< Pointer to the stylist interface.
+
+#endif /* MAP_STYLIST_H */