Cavestory Mod API
CSMAPI_types.h
Go to the documentation of this file.
1 /*
2  Cavestory Multiplayer API
3  Copyright (C) 2021 Johnny Ledger
4 
5  This software is provided 'as-is', without any express or implied
6  warranty. In no event will the authors be held liable for any damages
7  arising from the use of this software.
8 
9  Permission is granted to anyone to use this software for any purpose,
10  including commercial applications, and to alter it and redistribute it
11  freely, subject to the following restrictions:
12 
13  1. The origin of this software must not be misrepresented; you must not
14  claim that you wrote the original software. If you use this software
15  in a product, an acknowledgment in the product documentation would be
16  appreciated but is not required.
17  2. Altered source versions must be plainly marked as such, and must not be
18  misrepresented as being the original software.
19  3. This notice may not be removed or altered from any source distribution.
20 */
21 
26 #pragma once
27 
28 namespace CaveNet
29 {
30  namespace DataStructures
31  {
32  class NetPacket;
33  }
34 };
35 
36 namespace Input
37 {
38  class KeyShortcut;
39 };
40 
41 class VideoTexture;
42 class ExternalWindow;
43 
44 #include <List.h>
45 #include "CSMAPI_begincode.h"
46 
47 #ifdef CAVESTORY_MOD_EXPORTS
48 #include <SDL.h>
49 #else
50 typedef struct SDL_Rect
51 {
52  int x, y;
53  int w, h;
54 } SDL_Rect;
55 #endif
56 
57 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
58 
59 typedef int BOOL;
60 
61 #ifndef FALSE
62 #define FALSE 0
63 #endif
64 
65 #ifndef TRUE
66 #define TRUE 1
67 #endif
68 
69 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
70 
71 // wip
72 namespace CaveNet
73 {
74  namespace DataStructures
75  {
76  class NetClient;
77  class NetPlayer;
78  class NetTeam;
79  class NetScoreType;
80  class NetScoreInstance;
81  }
82 }
83 
84 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
85 
86 extern CAVESTORY_MOD_API int magnification;
87 extern CAVESTORY_MOD_API bool fullscreen;
88 extern CAVESTORY_MOD_API const char** MainArgv;
89 extern CAVESTORY_MOD_API int MainArgc;
90 
91 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
92 
93 typedef void* NetClientPointer;
94 typedef int NetClientGhostId;
95 
96 class CustomPlayer;
97 struct NPCHAR;
98 struct MYCHAR;
99 extern CAVESTORY_MOD_API int empty;
100 
107 typedef void(*PutNPCFunc)(NPCHAR* npc, int fx, int fy);
108 
112 typedef void(*FreeNPCFunc)(NPCHAR* npc);
113 
119 typedef BOOL(*CollideNPCFunc)(NPCHAR* npc);
120 
121 #if !defined(_CAVEEDITOR) && (!defined(CAVESTORY_MOD_EXPORTS) || !defined(DONT_DEFINE_RECT))
124 struct RECT
125 {
128  union
129  {
130  int left;
131  int front;
132  };
133 
136  int top;
137 
140  union
141  {
142  int right;
143  int back;
144  };
145 
148  int bottom;
149 };
150 #endif
151 
154 struct CSM_POINT
155 {
158  int x;
159 
162  int y;
163 };
164 
165 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
166 
169 struct FRAME
170 {
173  int x;
174 
177  int y;
178 
181  int* tgt_x;
182 
185  int* tgt_y;
186 
189  int wait;
190 
193  int quake;
194 
197  int quake2;
198 
202 
206 
210 
214 };
215 
219 {
222  bool use;
223 
226  int x;
227 
230  int y;
231 
234  int w;
235 
238  int h;
239 };
240 
241 extern CAVESTORY_MOD_API CUSTOM_FRAME_LIMITS gFrameLimits;
242 extern CAVESTORY_MOD_API FRAME gFrame;
243 
244 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
245 
249 
250 typedef struct FontObject FontObject;
251 
255 {
256  friend class FontHandle;
257 
258 public:
261  static FontManager* lFirst;
262 
265  FontManager* lNext;
266 
269  FontManager* lPrev;
270 
271 public:
274  char mFontName[127];
275 
278  FontObject* mFont;
279 
284 
287  int mWidth;
288 
291  int mHeight;
292 
293 public:
294 
295  FontManager(const char* font_name, FontObject* fo, int width, int height);
296  ~FontManager();
297 
298 protected:
299 
311  static FontObject* LoadFont(const char* font_name, int font_width, int font_height, bool bDoNotUse = false, VideoTexture* pTexture = NULL, FontManager** resultingManager = NULL, unsigned int iMagnification = 0xFFFFFFFF);
312 
316  static void UnloadFont(FontObject* fo);
317 
318 public:
319 
324  static void LinkFontToTexture(FontObject* fo, VideoTexture* pTexture);
325 
326 public:
327 
333  static FontManager* GetManagerForFont(FontObject* fo);
334 
338  static void UseFont(FontObject* pFont);
339 
343 
346  static void ResizeAllFonts();
347 
351  static void DestroyRendererTextures(void* pTarget);
352 };
353 
357 {
358 public: // Linking
359 
360  static FontHandle* first;
361  FontHandle* next;
362  FontHandle* prev;
363 
364 public: // Variables
365 
366  FontManager* object;
367 
368 public: // Methods
369 
370  void set(FontManager* fo)
371  {
372  if (fo == object)
373  return;
374 
375  if (object)
377 
378  object = fo;
379 
380  if (fo)
381  ++fo->mUserCount;
382  }
383 
384  void set(FontObject* fo)
385  {
387  }
388 
389  void unload()
390  {
391  set((FontManager*)NULL);
392  }
393 
394 public: // C Stuff
395 
396  FontHandle()
397  {
398  object = NULL;
399  }
400 
402  {
403  object = NULL;
404  set(fo);
405  }
406 
407  FontHandle(FontObject* fo)
408  {
409  object = NULL;
410  set(fo);
411  }
412 
413  FontHandle(const char* font_name, int font_width, int font_height)
414  {
415  object = NULL;
416  FontManager* newManager = NULL;
417  FontManager::LoadFont(font_name, font_width, font_height, true, NULL, &newManager);
418  set(newManager);
419  }
420 
421  FontHandle(const char* font_name, int font_width, int font_height, VideoTexture* pTexture)
422  {
423  object = NULL;
424  FontManager* newManager = NULL;
425  FontManager::LoadFont(font_name, font_width, font_height, true, pTexture, &newManager);
426  set(newManager);
427  }
428 
429  FontHandle(const char* font_name, int font_width, int font_height, int iMagnification)
430  {
431  object = NULL;
432  FontManager* newManager = NULL;
433  FontManager::LoadFont(font_name, font_width, font_height, true, NULL, &newManager, iMagnification);
434  set(newManager);
435  }
436 
437  ~FontHandle()
438  {
439  set((FontManager*)NULL);
440  }
441 
442 public: // Functions
443 
444  void linkToTexture(VideoTexture* pTexture)
445  {
446  FontManager::LinkFontToTexture(object->mFont, pTexture);
447  }
448 
449 public: // Operators
450 
451  FontHandle& operator=(const FontHandle& t)
452  {
453  set(t.object);
454  return *this;
455  }
456 
457  FontHandle& operator=(FontObject*& t)
458  {
459  set(t);
460  return *this;
461  }
462 
463  bool operator==(const FontHandle& t) const { return t.object == object; }
464  bool operator!=(const FontHandle& t) const { return t.object != object; }
465 
469  const char* getName() const
470  {
471  return (object ? object->mFontName : NULL);
472  }
473 
477  operator FontObject* ()
478  {
479  if (!object)
480  return NULL;
481 
482  return object->mFont;
483  }
484 
488  bool isValid() const
489  {
490  return (object ? true : false);
491  }
492 };
493 
497 {
500  unsigned char r;
501 
504  unsigned char g;
505 
508  unsigned char b;
509 
512  unsigned char a;
513 
517  inline unsigned long to_rgb()
518  {
519  return ((r) | ((g) << 8) | ((b) << 16) | ((a) << 24));
520  }
521 
525  inline void from_rgb(unsigned long color)
526  {
527  r = (unsigned char)((color) & 0xFF);
528  g = (unsigned char)(((color) >> 8) & 0xFF);
529  b = (unsigned char)(((color) >> 16) & 0xFF);
530  a = (unsigned char)(((color) >> 24) & 0xFF);
531  }
532 
533  bool operator==(GUI_COLOR other) { return (other.r == r && other.g == g && other.b == b && other.a == a); }
534  bool operator!=(GUI_COLOR other) { return (other.r != r || other.g != g || other.b != b || other.a != a); }
535 
536  GUI_COLOR() { r = 0; g = 0; b = 0; a = 0; }
537  GUI_COLOR(int _r, int _g, int _b, int _a = 255) : r(_r), g(_g), b(_b), a(_a) {}
538  GUI_COLOR(unsigned long color) { from_rgb(color); }
539 };
540 
542 
546 {
549  int x;
550 
553  int y;
554 
555  GUI_POINT() : x(0), y(0)
556  {
557  }
558 
559  GUI_POINT(int _x, int _y) : x(_x), y(_y)
560  {
561  }
562 
563  GUI_POINT(RECT r) : x(r.left), y(r.top)
564  {
565  }
566 
567  GUI_POINT(GUI_RECT r);
568 
569  // Multiplies the points by the current screen magnification
570  inline GUI_POINT to_screenspace()
571  {
572  GUI_POINT ret;
573  ret.x = x * magnification;
574  ret.y = y * magnification;
575  return ret;
576  }
577 
578  // Divides the points by the current screen magnification
579  inline GUI_POINT from_screenspace()
580  {
581  GUI_POINT ret;
582  ret.x = x / magnification;
583  ret.y = y / magnification;
584  return ret;
585  }
586 
587  // Divides the points by the current screen magnification
588  inline GUI_POINT make_frame_relative()
589  {
590  GUI_POINT ret;
591  ret.x = x + gFrame.x;
592  ret.y = y + gFrame.y;
593  return ret;
594  }
595 
596  // Divides the points by the current screen magnification
597  inline GUI_POINT reset_frame_relativity()
598  {
599  GUI_POINT ret;
600  ret.x = x - gFrame.x;
601  ret.y = y - gFrame.y;
602  return ret;
603  }
604 
605  inline GUI_POINT normalize()
606  {
607  float mag = sqrtf((x * x) + (y * y));
608  GUI_POINT ret(x / mag, y / mag);
609 
610  return ret;
611  }
612 
613  inline GUI_POINT setX(int NewInt)
614  {
615  GUI_POINT ret(NewInt, y);
616  return ret;
617  }
618 
619  inline GUI_POINT setY(int NewInt)
620  {
621  GUI_POINT ret(x, NewInt);
622  return ret;
623  }
624 
625  inline float angle_to(GUI_POINT other)
626  {
627  float dot = (float)x * (float)other.x + (float)y * (float)other.y;
628  float det = (float)x * (float)other.y - (float)y * (float)other.x;
629 
630  return atan2f(det, dot);
631  }
632 
633  inline float distance(GUI_POINT other)
634  {
635  return sqrtf(powf(other.x - x, 2) + powf(other.y - y, 2));
636  }
637 
638  inline float distance_x(GUI_POINT other)
639  {
640  return fabsf(other.x - x);
641  }
642 
643  inline float distance_y(GUI_POINT other)
644  {
645  return fabsf(other.y - y);
646  }
647 
648  inline int dot(GUI_POINT other)
649  {
650  return (this->x * other.x) + (this->y * other.y);
651  }
652 
653  inline int cross(GUI_POINT other)
654  {
655  return (this->x * other.y) - (this->y * other.x);
656  }
657 
658  // line1 = a to b, line2 = c to d
659  static inline bool intersect(GUI_POINT a, GUI_POINT b, GUI_POINT c, GUI_POINT d, GUI_POINT* hit)
660  {
661  double detL1 = ((double)a.x * (double)b.y) - ((double)a.y * (double)b.x);
662  double detL2 = ((double)c.x * (double)d.y) - ((double)c.y * (double)d.x);
663  double x1mx2 = a.x - b.x;
664  double x3mx4 = c.x - d.x;
665  double y1my2 = a.y - b.y;
666  double y3my4 = c.y - d.y;
667 
668  double xnom = detL1 * x3mx4 - x1mx2 * detL2;
669  double ynom = detL1 * y3my4 - y1my2 * detL2;
670  double denom = x1mx2 * y3my4 - y1my2 * x3mx4;
671 
672  if (denom == 0.0)
673  return false;
674 
675  hit->x = xnom / denom;
676  hit->y = ynom / denom;
677 
678  return true;
679  }
680 
681  inline void operator+=(const GUI_POINT& n) { x += n.x; y += n.y; }
682  inline void operator*=(const int n) { x *= n; y *= n; }
683  inline bool operator==(const GUI_POINT& o) { return (o.x == x && o.y == y); }
684  inline bool operator!=(const GUI_POINT& o) { return (o.x != x || o.y != y); }
685  inline GUI_POINT operator+(const GUI_POINT& n) { GUI_POINT out; out.x = x + n.x; out.y = y + n.y; return out; }
686  inline GUI_POINT operator-(const GUI_POINT& n) { GUI_POINT out; out.x = x - n.x; out.y = y - n.y; return out; }
687  inline GUI_POINT operator*(const int n) { return GUI_POINT(x * n, y * n); }
688  inline GUI_POINT operator/(const int n) { return GUI_POINT(x / n, y / n); }
689  inline GUI_POINT operator*(const float n) { return GUI_POINT(int((float)x * n), int((float)y * n)); }
690  inline GUI_POINT operator/(const float n) { return GUI_POINT(int((float)x / n), int((float)y / n)); }
691  bool operator==(const GUI_POINT_F& o);
692  bool operator!=(const GUI_POINT_F& o);
693  GUI_POINT_F operator+(const GUI_POINT_F& n);
694  GUI_POINT_F operator-(const GUI_POINT_F& n);
695  GUI_POINT_F operator*(const GUI_POINT_F& n);
696  GUI_POINT_F operator/(const GUI_POINT_F& n);
697 
698  inline int HashIndex() { return ((y & 0xFFFF) << 16) | ((x & 0xFFFF)); }
699  inline int HashIndex() const { return ((y & 0xFFFF) << 16) | ((x & 0xFFFF)); }
700  inline bool operator<(GUI_POINT other) { return HashIndex() < other.HashIndex(); }
701  inline bool operator<=(GUI_POINT other) { return HashIndex() <= other.HashIndex(); }
702  inline bool operator>(GUI_POINT other) { return HashIndex() > other.HashIndex(); }
703  inline bool operator>=(GUI_POINT other) { return HashIndex() >= other.HashIndex(); }
704  inline bool operator<(const GUI_POINT other) const { return HashIndex() < other.HashIndex(); }
705  inline bool operator<=(const GUI_POINT other) const { return HashIndex() <= other.HashIndex(); }
706  inline bool operator>(const GUI_POINT other) const { return HashIndex() > other.HashIndex(); }
707  inline bool operator>=(const GUI_POINT other) const { return HashIndex() >= other.HashIndex(); }
708 };
709 
713 {
714  float x;
715  float y;
716 
717  GUI_POINT_F() : x(0), y(0) {}
718  GUI_POINT_F(float _x, float _y) : x(_x), y(_y) {}
719  GUI_POINT_F(RECT r) : x(r.left), y(r.top) {}
721 
725  {
726  GUI_POINT_F ret;
727  ret.x = x * (float)magnification;
728  ret.y = y * (float)magnification;
729  return ret;
730  }
731 
735  {
736  GUI_POINT_F ret;
737  ret.x = x / (float)magnification;
738  ret.y = y / (float)magnification;
739  return ret;
740  }
741 
745  {
746  GUI_POINT_F ret;
747  ret.x = x + ((float)gFrame.x / 512.f);
748  ret.y = y + ((float)gFrame.y / 512.f);
749  return ret;
750  }
751 
755  {
756  GUI_POINT_F ret;
757  ret.x = x - ((float)gFrame.x / 512.f);
758  ret.y = y - ((float)gFrame.y / 512.f);
759  return ret;
760  }
761 
762  inline GUI_POINT_F normalize()
763  {
764  float mag = sqrtf((x * x) + (y * y));
765  GUI_POINT_F ret(x / mag, y / mag);
766  return ret;
767  }
768 
769  inline float angle_to(GUI_POINT_F other)
770  {
771  float dot = x * other.x + y * other.y;
772  float det = x * other.y - y * other.x;
773  return atan2f(det, dot);
774  }
775 
776  inline float angle_to(GUI_POINT other)
777  {
778  float dot = x * (float)other.x + y * (float)other.y;
779  float det = x * (float)other.y - y * (float)other.x;
780  return atan2f(det, dot);
781  }
782 
783  inline float distance(GUI_POINT_F other)
784  {
785  return sqrtf(powf(other.x - x, 2) + powf(other.y - y, 2));
786  }
787 
788  inline GUI_POINT_F max_normal()
789  {
790  GUI_POINT_F ret(x < 0 ? -1 : (x == 0 ? 0 : 1), y < 0 ? -1 : (y == 0 ? 0 : 1));
791  return ret;
792  }
793 
794  static inline bool intersect(GUI_POINT_F a, GUI_POINT_F b, GUI_POINT_F c, GUI_POINT_F d, GUI_POINT_F* hit)
795  {
796  // Line AB represented as a1x + b1y = c1
797  float a1 = b.y - a.y;
798  float b1 = a.x - b.x;
799  float c1 = a1 * (a.x) + b1 * (a.y);
800 
801  // Line CD represented as a2x + b2y = c2
802  float a2 = d.y - c.y;
803  float b2 = c.x - d.x;
804  float c2 = a2 * (c.x) + b2 * (c.y);
805 
806  float determinant = a1 * b2 - a2 * b1;
807 
808  // Check to see if the determinant is valid
809  if (determinant != 0.f)
810  {
811  hit->x = (b2 * c1 - b1 * c2) / determinant;
812  hit->y = (a1 * c2 - a2 * c1) / determinant;
813 
814  return true;
815  }
816 
817  return false;
818  }
819 
820  inline bool operator==(const GUI_POINT_F& o) { return (o.x == x && o.y == y); }
821  inline bool operator!=(const GUI_POINT_F& o) { return (o.x != x || o.y != y); }
822  inline bool operator==(const GUI_POINT& o) { return ((float)o.x == x && (float)o.y == y); }
823  inline bool operator!=(const GUI_POINT& o) { return ((float)o.x != x || (float)o.y != y); }
824  inline void operator+=(const GUI_POINT_F& n) { x += n.x; y += n.y; }
825  inline void operator*=(const float n) { x *= n; y *= n; }
826  inline GUI_POINT_F operator+(const GUI_POINT_F& n) { GUI_POINT_F out; out.x = x + n.x; out.y = y + n.y; return out; }
827  inline GUI_POINT_F operator-(const GUI_POINT_F& n) { GUI_POINT_F out; out.x = x - n.x; out.y = y - n.y; return out; }
828  inline GUI_POINT_F operator*(const float n) { return GUI_POINT_F(x * n, y * n); }
829  inline GUI_POINT_F operator/(const float n) { return GUI_POINT_F(x / n, y / n); }
830  inline GUI_POINT_F operator+(const GUI_POINT& n) { GUI_POINT_F out; out.x = x + (float)n.x; out.y = y + (float)n.y; return out; }
831  inline GUI_POINT_F operator-(const GUI_POINT& n) { GUI_POINT_F out; out.x = x - (float)n.x; out.y = y - (float)n.y; return out; }
832 };
833 
834 inline bool GUI_POINT::operator==(const GUI_POINT_F& o) { return ((float)x == o.x && (float)y == o.y); }
835 inline bool GUI_POINT::operator!=(const GUI_POINT_F& o) { return ((float)x != o.x || (float)y != o.y); }
836 inline GUI_POINT_F GUI_POINT::operator+(const GUI_POINT_F& n) { GUI_POINT_F out; out.x = (float)x + n.x; out.y = (float)y + n.y; return out; }
837 inline GUI_POINT_F GUI_POINT::operator-(const GUI_POINT_F& n) { GUI_POINT_F out; out.x = (float)x - n.x; out.y = (float)y - n.y; return out; }
838 inline GUI_POINT_F GUI_POINT::operator*(const GUI_POINT_F& n) { GUI_POINT_F out; out.x = (float)x * n.x; out.y = (float)y * n.y; return out; }
839 inline GUI_POINT_F GUI_POINT::operator/(const GUI_POINT_F& n) { GUI_POINT_F out; out.x = (float)x / n.x; out.y = (float)y / n.y; return out; }
840 
842 {
843  int x;
844  int y;
845  int w;
846  int h;
847 
848  GUI_RECT() : x(0), y(0), w(0), h(0) {}
849  GUI_RECT(NPCHAR* npc);
850  GUI_RECT(int _x, int _y, int _w, int _h) : x(_x), y(_y), w(_w), h(_h) {}
851  GUI_RECT(GUI_POINT one, int _w, int _h) : x(one.x), y(one.y), w(_w), h(_h) {}
852  GUI_RECT(int _x, int _y, GUI_POINT one) : x(_x), y(_y), w(one.x), h(one.y) {}
853  GUI_RECT(GUI_POINT one, GUI_POINT two) : x(one.x), y(one.y), w(two.x), h(two.y) {}
854  GUI_RECT(SDL_Rect r) : x(r.x), y(r.y), w(r.w), h(r.h) {}
855  GUI_RECT(RECT r) : x(r.left), y(r.top), w(r.right - r.left), h(r.bottom - r.top) {}
856  GUI_RECT(const GUI_RECT& r) : x(r.x), y(r.y), w(r.w), h(r.h) {}
857  GUI_RECT(GUI_RECT* r) : x(r->x), y(r->y), w(r->w), h(r->h) {}
858 
859  void from_npc(NPCHAR* npc);
860 
861  inline GUI_POINT get_center()
862  {
863  return GUI_POINT(
864  x + (w / 2),
865  y + (h / 2)
866  );
867  }
868 
869  inline bool operator==(GUI_RECT other)
870  {
871  return (
872  x == other.x &&
873  y == other.y &&
874  w == other.w &&
875  h == other.h
876  );
877  }
878 
879  inline bool operator==(const GUI_RECT other) const
880  {
881  return (
882  x == other.x &&
883  y == other.y &&
884  w == other.w &&
885  h == other.h
886  );
887  }
888 
889  inline bool operator!=(GUI_RECT other)
890  {
891  return (
892  x != other.x ||
893  y != other.y ||
894  w != other.w ||
895  h != other.h
896  );
897  }
898 
899  GUI_POINT uncontain_point(GUI_POINT pnt);
900  GUI_POINT_F uncontain_point(GUI_POINT_F pnt);
901  GUI_POINT contain_point(GUI_POINT pnt);
902  GUI_POINT_F contain_point(GUI_POINT_F pnt);
903 
904  inline bool is_point_bordering(GUI_POINT p)
905  {
906  if (contain_point(p) != p)
907  return false;
908 
909  return (p.x == x || p.y == y || p.x == x + w || p.y == y + h);
910  }
911 
912  inline GUI_RECT setX(int NewInt)
913  {
914  GUI_RECT ret(NewInt, y, w, h);
915  return ret;
916  }
917 
918  inline GUI_RECT setY(int NewInt)
919  {
920  GUI_RECT ret(x, NewInt, w, h);
921  return ret;
922  }
923 
924  inline GUI_RECT setW(int NewInt)
925  {
926  GUI_RECT ret(x, y, NewInt, h);
927  return ret;
928  }
929 
930  inline GUI_RECT setH(int NewInt)
931  {
932  GUI_RECT ret(x, y, w, NewInt);
933  return ret;
934  }
935 
937  inline GUI_RECT pad(int amount)
938  {
939  GUI_RECT ret(x, y, w, h);
940  ret.x += amount;
941  ret.y += amount;
942  ret.w -= (amount * 2);
943  ret.h -= (amount * 2);
944  return ret;
945  }
946 
947  // Get the closest bording point
948  inline GUI_POINT border(GUI_POINT rel)
949  {
950  GUI_POINT p(get_center());
951 
952  p.x = rel.x < p.x ? x : x + w;
953  p.y = rel.y < p.y ? y : y + h;
954 
955  return p;
956  }
957 
958  inline GUI_RECT to_screenspace()
959  {
960  GUI_RECT ret;
961  ret.x = x * magnification;
962  ret.y = y * magnification;
963  ret.w = w * magnification;
964  ret.h = h * magnification;
965  return ret;
966  }
967 
968  inline GUI_RECT to_custom(int mag)
969  {
970  GUI_RECT ret;
971  ret.x = x * mag;
972  ret.y = y * mag;
973  ret.w = w * mag;
974  ret.h = h * mag;
975  return ret;
976  }
977 
978  inline GUI_RECT from_custom(int mag)
979  {
980  GUI_RECT ret;
981  ret.x = x / mag;
982  ret.y = y / mag;
983  ret.w = w / mag;
984  ret.h = h / mag;
985  return ret;
986  }
987 
988  inline GUI_RECT from_screenspace()
989  {
990  GUI_RECT ret;
991  ret.x = x / magnification;
992  ret.y = y / magnification;
993  ret.w = w / magnification;
994  ret.h = h / magnification;
995  return ret;
996  }
997 
998  inline GUI_RECT to_game_rect()
999  {
1000  GUI_RECT ret;
1001  ret.x = x;
1002  ret.y = y;
1003  ret.w = ret.x + w;
1004  ret.h = ret.y + h;
1005  return ret;
1006  }
1007 
1008  inline RECT to_rect()
1009  {
1010  RECT ret;
1011  ret.left = x;
1012  ret.top = y;
1013  ret.right = x + w;
1014  ret.bottom = y + h;
1015  return ret;
1016  }
1017 
1018  inline SDL_Rect to_sdl_rect()
1019  {
1020  SDL_Rect ret = { x, y, w, h };
1021  return ret;
1022  }
1023 
1024  inline GUI_POINT position() { return GUI_POINT(x, y); }
1025  inline GUI_POINT extent() { return GUI_POINT(w, h); }
1026  inline int left() { return x; }
1027  inline int right() { return x + w; }
1028  inline int top() { return y; }
1029  inline int bottom() { return y + h; }
1030  inline int width() { return w; }
1031  inline int height() { return h; }
1032 
1033  inline bool pointInRect(const GUI_POINT& pt) const
1034  {
1035  return (pt.x >= x && pt.x < x + w && pt.y >= y && pt.y < y + h);
1036  }
1037 
1038  inline bool contains(const GUI_RECT& R) const
1039  {
1040  if (x <= R.x && y <= R.y)
1041  if (R.x + R.w <= x + w)
1042  if (R.y + R.h <= y + h)
1043  return true;
1044  return false;
1045  }
1046 
1047  inline void contain(GUI_RECT& other)
1048  {
1049  int LEFT = other.left();
1050  int RIGHT = other.right();
1051  int TOP = other.top();
1052  int BOTTOM = other.bottom();
1053 
1054  if (LEFT < x)
1055  LEFT = x;
1056  if (TOP < y)
1057  TOP = y;
1058  if (RIGHT > right())
1059  RIGHT = right();
1060  if (BOTTOM > bottom())
1061  BOTTOM = bottom();
1062 
1063  other.x = LEFT;
1064  other.y = TOP;
1065  other.w = (RIGHT - LEFT);
1066  other.h = (BOTTOM - TOP);
1067  }
1068 
1069  bool isValidRect() const
1070  {
1071  return (w > 0 && h > 0);
1072  }
1073 
1074  inline bool intersect(const GUI_RECT& clipRect)
1075  {
1076  GUI_POINT bottomL;
1077  bottomL.x = MIN(x + w - 1, clipRect.x + clipRect.w - 1);
1078  bottomL.y = MIN(y + h - 1, clipRect.y + clipRect.h - 1);
1079 
1080  x = MAX(x, clipRect.x);
1081  y = MAX(y, clipRect.y);
1082 
1083  w = bottomL.x - x + 1;
1084  h = bottomL.y - y + 1;
1085 
1086  return isValidRect();
1087  }
1088 
1089  inline bool overlaps(const GUI_RECT& R) const
1090  {
1091  GUI_RECT test = *this;
1092  return test.intersect(R);
1093  }
1094 
1095  static inline GUI_RECT FromRect(int left, int top, int right, int bottom)
1096  {
1097  RECT pRect;
1098  pRect.left = left;
1099  pRect.top = top;
1100  pRect.right = right;
1101  pRect.bottom = bottom;
1102  return GUI_RECT(pRect);
1103  }
1104 
1105  inline int HashIndex() { return (x + w) + ((y + h) * 0x007FFFFF); }
1106  inline int HashIndex() const { return (x + w) + ((y + h) * 0x007FFFFF); }
1107  bool operator<(GUI_RECT other) { return HashIndex() < other.HashIndex(); }
1108  bool operator<=(GUI_RECT other) { return HashIndex() <= other.HashIndex(); }
1109  bool operator>(GUI_RECT other) { return HashIndex() > other.HashIndex(); }
1110  bool operator>=(GUI_RECT other) { return HashIndex() >= other.HashIndex(); }
1111  bool operator<(const GUI_RECT other) const { return HashIndex() < other.HashIndex(); }
1112  bool operator<=(const GUI_RECT other) const { return HashIndex() <= other.HashIndex(); }
1113  bool operator>(const GUI_RECT other) const { return HashIndex() > other.HashIndex(); }
1114  bool operator>=(const GUI_RECT other) const { return HashIndex() >= other.HashIndex(); }
1115  void operator*=(float iMagnification) { x *= iMagnification; y *= iMagnification; w *= iMagnification; h *= iMagnification; }
1116  void operator/=(float iMagnification) { x /= iMagnification; y /= iMagnification; w /= iMagnification; h /= iMagnification; }
1117  void operator*=(GUI_RECT other) { x *= other.x; y *= other.y; w *= other.w; h *= other.h; }
1118  void operator/=(GUI_RECT other) { x /= other.x; y /= other.y; w /= other.w; h /= other.h; }
1119  GUI_RECT operator*(float fAmount) { GUI_RECT a; a.x = x * fAmount; a.y = y * fAmount; a.w = w * fAmount; a.h = h * fAmount; return a; }
1120  GUI_RECT operator/(float fAmount) { GUI_RECT a; a.x = x / fAmount; a.y = y / fAmount; a.w = w / fAmount; a.h = h / fAmount; return a; }
1121 };
1122 
1123 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
1124 
1127 struct BULLET
1128 {
1131  int flag;
1132 
1136 
1140 
1143  int bbits;
1144 
1147  int cond;
1148 
1151  int x;
1152 
1155  int y;
1156 
1159  int xm;
1160 
1163  int ym;
1164 
1167  int tgt_x;
1168 
1171  int tgt_y;
1172 
1175  int act_no;
1176 
1180 
1184 
1187  int ani_no;
1188 
1191  unsigned char direct;
1192 
1196 
1199  int count1;
1200 
1203  int count2;
1204 
1208 
1211  int damage;
1212 
1215  int life;
1216 
1219  int enemyXL;
1220 
1223  int enemyYL;
1224 
1227  int blockXL;
1228 
1231  int blockYL;
1232 
1236 
1239  int ghostId;
1240 
1243  int level;
1244 
1247  int team_id;
1248 };
1249 
1253 {
1255  int index;
1256 
1258  int event;
1259 };
1260 
1263 struct ARMS
1264 {
1267  int code;
1268 
1271  int level;
1272 
1275  int exp;
1276 
1279  int max_num;
1280 
1283  int num;
1284 };
1285 
1288 struct ITEM
1289 {
1292  int code;
1293 };
1294 
1297 struct CARET
1298 {
1301  int cond;
1302 
1305  int code;
1306 
1309  int direct;
1310 
1313  int x;
1314 
1317  int y;
1318 
1321  int xm;
1322 
1325  int ym;
1326 
1329  int act_no;
1330 
1334 
1337  int ani_no;
1338 
1342 
1346 
1350 
1354 };
1355 
1359 {
1363 
1367 
1371 
1375 
1378  int dash1;
1379 
1382  int dash2;
1383 
1386  int resist;
1387 
1390  int jump;
1391 };
1392 
1396 {
1400 
1403  int x;
1404 
1407  int y;
1408 
1411  int xm;
1412 
1415  int ym;
1416 
1419  int tgt_x;
1420 
1423  int tgt_y;
1424 
1427  int flag;
1428 };
1429 
1433 {
1437 
1441 
1444  unsigned int delay_expire;
1445 
1448  unsigned int frame_no;
1449 
1453 
1457 
1461 
1464  unsigned int change_time;
1465 };
1466 
1469 struct MYCHAR
1470 {
1473  CustomPlayer* character;
1474 
1477  unsigned short cond;
1478 
1482 
1486 
1489  unsigned int flag;
1490 
1493  unsigned int next_flag;
1494 
1498  int direct;
1499 
1503 
1506  int up;
1507 
1510  int down;
1511 
1514  int netanim;
1515 
1518  int equip;
1519 
1522  int x;
1523 
1526  int y;
1527 
1530  int tgt_x;
1531 
1534  int tgt_y;
1535 
1539 
1543 
1546  int index_x;
1547 
1550  int index_y;
1551 
1554  int xm;
1555 
1558  int ym;
1559 
1562  int old_xm;
1563 
1566  int old_ym;
1567 
1571 
1574  int ani_no;
1575 
1578  int act_no;
1579 
1583 
1586  int count1;
1587 
1590  int count2;
1591 
1594  int count3;
1595 
1598  int count4;
1599 
1603 
1607 
1611 
1615 
1618  int level;
1619 
1623 
1627 
1634  unsigned char shock;
1635 
1640 
1643  unsigned char no_life;
1644 
1647  unsigned char rensha;
1648 
1651  unsigned char bubble;
1652 
1656 
1659  short life;
1660 
1665  short star;
1666 
1669  short max_life;
1670 
1673  short a;
1674 
1677  int lifeBr;
1678 
1682 
1685  int air;
1686 
1689  int air_get;
1690 
1693  signed char sprash;
1694 
1697  signed char ques;
1698 
1701  signed char boost_sw;
1702 
1706 
1710 
1713  unsigned char col_r;
1714 
1717  unsigned char col_g;
1718 
1721  unsigned char col_b;
1722 
1726 
1729  int zone;
1730 
1734 
1738 
1742 
1746 
1750 
1754 
1758 
1762 
1766 
1770 };
1771 
1775 {
1779 
1783 
1787 
1791 
1795 
1799 
1803 
1807 
1810  int* mKey;
1811 
1814  int* mKeyTrg;
1815 
1818  int* mKeyOld;
1819 
1823 
1826  bool* mSpurMax;
1827 
1831 
1835 
1839  {
1840  memset(this, 0, sizeof(SafeClientInterface));
1841  }
1842 
1846  {
1847  memset(this, 0, sizeof(SafeClientInterface));
1848  Set(pClient, iSetType);
1849  }
1850 
1858  bool Set(CaveNet::DataStructures::NetClient* pClient, unsigned int iSetType = SCI_SetType::SCI_ST_AUTO);
1859 
1865  void DamagePlayer(int iDamage);
1866 
1871  void AddExp(int iAmount, bool bSpur = false);
1872 
1876  bool IsMaxExp();
1877 
1880  void ZeroExp();
1881 
1887  int CountArmsBullet(int iArmsCode);
1888 
1894  int CountBulletNum(int iBulletCode);
1895 
1901  bool ChangeArmsEnergy(int iAmmoAmt);
1902 
1908  bool UseArmsEnergy(int iAmount);
1909 
1916  bool HasArmsEnergy(int iWeaponId, int iAmount);
1917 
1923  int GetArmsEnergy(int iWeaponId);
1924 
1930  int GetArmsMaxEnergy(int iWeaponId);
1931 
1938  int GetArmsExp(int iWeaponId, int* iMaxExp = NULL);
1939 
1942  void ChangeToFirstArms();
1943 
1946  void NextWeapon();
1947 
1950  void PreviousWeapon();
1951 
1962  unsigned long long int TestInput(unsigned long long int iFlags, CSM_KEY_DESC iInputType = CSM_KEY_DESC::CSM_KEY_DESC_KEY);
1963 };
1964 
1968 {
1972 
1976 
1979  int key;
1980 
1983  int keyTrg;
1984 
1988 
1992 
1995  int ghostId;
1996 
2000 
2004 
2008 
2011  int bullet_ids[3];
2012 
2016 };
2017 
2020 struct NPCHAR
2021 {
2024  unsigned int last_update_time;
2025 
2028  unsigned long long int nodes;
2029 
2032  unsigned long long int transmit_nodes;
2033 
2036  unsigned char cond;
2037 
2040  int flag;
2041 
2044  int x;
2045 
2048  int y;
2049 
2052  int xm;
2053 
2056  int ym;
2057 
2060  int xm2;
2061 
2064  int ym2;
2065 
2068  int tgt_x;
2069 
2072  int tgt_y;
2073 
2077 
2081 
2085 
2089 
2093 
2097 
2100  int life;
2101 
2104  int exp;
2105 
2108  int size;
2109 
2112  int direct;
2113 
2116  unsigned int bits;
2117 
2121 
2125 
2128  int ani_no;
2129 
2132  int count1;
2133 
2136  int count2;
2137 
2140  int count3;
2141 
2144  int count4;
2145 
2148  int act_no;
2149 
2153 
2157 
2161 
2164  unsigned char shock;
2165 
2169 
2172  int damage;
2173 
2178 
2182 
2186 
2190 
2194 
2197  int old_x;
2198 
2201  int old_y;
2202 
2206 
2209  int zone;
2210 
2214 
2218 
2222 
2233 
2237 
2241 
2244  bool sized;
2245 
2248  int scalar;
2249 
2252  void* data;
2253 
2257 
2261 
2265 
2271  CAVESTORY_MOD_API unsigned int GetHash(bool bForce = false);
2272 
2276  CAVESTORY_MOD_API GUI_POINT GetDrawPosition(int fx = -1, int fy = -1);
2277 };
2278 
2282 {
2283  int cond;
2284  int x;
2285  int y;
2286  int xm;
2287  int ym;
2288 
2292 };
2293 
2294 #define _NPCHAR_CACHE_SET(varName) this->varName = npc->varName;
2295 #define _NPCHAR_CACHE_TRANSMIT(varName) npc->varName = this->varName;
2296 #define _NPCHAR_CACHE_EQUALS(varName) npc->varName == this->varName
2297 
2299 {
2300  unsigned char cond;
2301  int x;
2302  int y;
2303  int xm;
2304  int ym;
2305  unsigned short code_char;
2306  unsigned short act_no;
2307  unsigned short act_wait;
2308  unsigned short ani_no;
2309  unsigned short ani_wait;
2310  unsigned short life;
2311  unsigned char shock;
2312  char direct;
2313  int count1;
2314  int count2;
2315  int count3;
2316  int count4;
2317  NPCHAR* pNpc;
2318  MYCHAR* focus;
2319 
2320  inline void SetNpc(NPCHAR* npc)
2321  {
2322  _NPCHAR_CACHE_TRANSMIT(cond);
2323  _NPCHAR_CACHE_TRANSMIT(x);
2324  _NPCHAR_CACHE_TRANSMIT(y);
2325  _NPCHAR_CACHE_TRANSMIT(xm);
2326  _NPCHAR_CACHE_TRANSMIT(ym);
2327  _NPCHAR_CACHE_TRANSMIT(code_char);
2328  _NPCHAR_CACHE_TRANSMIT(act_no);
2329  _NPCHAR_CACHE_TRANSMIT(act_wait);
2330  _NPCHAR_CACHE_TRANSMIT(ani_no);
2331  _NPCHAR_CACHE_TRANSMIT(ani_wait);
2332  _NPCHAR_CACHE_TRANSMIT(pNpc);
2333  _NPCHAR_CACHE_TRANSMIT(focus);
2334  _NPCHAR_CACHE_TRANSMIT(shock);
2335  _NPCHAR_CACHE_TRANSMIT(life);
2336  _NPCHAR_CACHE_TRANSMIT(direct);
2337  _NPCHAR_CACHE_TRANSMIT(count1);
2338  _NPCHAR_CACHE_TRANSMIT(count2);
2339  _NPCHAR_CACHE_TRANSMIT(count3);
2340  _NPCHAR_CACHE_TRANSMIT(count4);
2341  }
2342 
2343  inline _NPCHAR_CACHE* operator=(NPCHAR* npc)
2344  {
2345  _NPCHAR_CACHE_SET(cond);
2346  _NPCHAR_CACHE_SET(x);
2347  _NPCHAR_CACHE_SET(y);
2348  _NPCHAR_CACHE_SET(xm);
2349  _NPCHAR_CACHE_SET(ym);
2350  _NPCHAR_CACHE_SET(code_char);
2351  _NPCHAR_CACHE_SET(act_no);
2352  _NPCHAR_CACHE_SET(act_wait);
2353  _NPCHAR_CACHE_SET(ani_no);
2354  _NPCHAR_CACHE_SET(ani_wait);
2355  _NPCHAR_CACHE_SET(pNpc);
2356  _NPCHAR_CACHE_SET(focus);
2357  _NPCHAR_CACHE_SET(shock);
2358  _NPCHAR_CACHE_SET(life);
2359  _NPCHAR_CACHE_SET(direct);
2360  _NPCHAR_CACHE_SET(count1);
2361  _NPCHAR_CACHE_SET(count2);
2362  _NPCHAR_CACHE_SET(count3);
2363  _NPCHAR_CACHE_SET(count4);
2364 
2365  return this;
2366  }
2367 
2368  inline bool operator==(NPCHAR* npc)
2369  {
2370  return (
2371  _NPCHAR_CACHE_EQUALS(cond) &&
2372  _NPCHAR_CACHE_EQUALS(x) &&
2373  _NPCHAR_CACHE_EQUALS(y) &&
2374  _NPCHAR_CACHE_EQUALS(xm) &&
2375  _NPCHAR_CACHE_EQUALS(ym) &&
2376  _NPCHAR_CACHE_EQUALS(code_char) &&
2377  _NPCHAR_CACHE_EQUALS(act_no) &&
2378  _NPCHAR_CACHE_EQUALS(act_wait) &&
2379  _NPCHAR_CACHE_EQUALS(ani_no) &&
2380  _NPCHAR_CACHE_EQUALS(ani_wait) &&
2381  _NPCHAR_CACHE_EQUALS(pNpc) &&
2382  _NPCHAR_CACHE_EQUALS(focus) &&
2383  _NPCHAR_CACHE_EQUALS(shock) &&
2384  _NPCHAR_CACHE_EQUALS(life) &&
2385  _NPCHAR_CACHE_EQUALS(direct) &&
2386  _NPCHAR_CACHE_EQUALS(count1) &&
2387  _NPCHAR_CACHE_EQUALS(count2) &&
2388  _NPCHAR_CACHE_EQUALS(count3) &&
2389  _NPCHAR_CACHE_EQUALS(count4)
2390  );
2391  }
2392 
2393  inline bool operator!=(NPCHAR* npc) { return !this->operator==(npc); }
2394 };
2395 #undef _NPCHAR_CACHE_SET
2396 #undef _NPCHAR_CACHE_EQUALS
2397 #undef _NPCHAR_CACHE_TRANSMIT
2398 
2399 //------------------------------------------------------------------------------------------------------------
2400 
2403 struct PROFILE
2404 {
2407  char code[8];
2408 
2411  int stage;
2412 
2415  int music;
2416 
2419  int x;
2420 
2423  int y;
2424 
2427  int direct;
2428 
2431  short max_life;
2432 
2435  short star;
2436 
2439  short life;
2440 
2443  short a;
2444 
2448 
2452 
2455  int equip;
2456 
2459  int unit;
2460 
2463  int counter;
2464 
2468 
2472 
2476 
2479  signed char permit_mapping[0x80];
2480 
2483  char FLAG[4];
2484 
2487  unsigned char flags[1000];
2488 
2491  int unused1;
2492 
2495  int unused2;
2496 
2499  char CharName[256];
2500 
2503  long long int frame_count;
2504 
2508 
2512 
2516 
2520 };
2521 
2522 //------------------------------------------------------------------------------------------------------------
2523 
2528 {
2532 
2536 
2539  int* Key;
2540 
2543  int* KeyTrg;
2544 
2548 
2552 };
2553 
2557 {
2560  char path[PATH_LENGTH];
2561 
2564  int size;
2565 
2568  char* data;
2569 
2572  signed char mode;
2573 
2575  TextScriptTarget target;
2576 
2579  signed char flags;
2580 
2583  unsigned int p_read;
2584 
2587  int p_write;
2588 
2591  int p_tur_x;
2592 
2595  int line;
2596 
2599  int ypos_line[4];
2600 
2603  int wait;
2604 
2608 
2612 
2616 
2620 
2623  signed char select;
2624 
2627  int face;
2628 
2631  int face_x;
2632 
2635  int item;
2636 
2639  int item_y;
2640 
2644 
2647  int offsetY;
2648 
2652 
2657 
2661 
2664  bool transmit;
2665 
2669 
2673 
2677 
2681 
2684  unsigned char wait_beam;
2685 
2689 
2693 };
2694 
2698 {
2701  unsigned short p_read;
2702 
2705  unsigned short event_number;
2706 };
2707 
2708 //------------------------------------------------------------------------------------------------------------
2709 
2713 
2717 {
2718 public: // Magnification
2719 
2720  static unsigned int defaultCustomMagnification;
2721 
2722 public: // Linkage
2723 
2724  static GuiBase* gFirst;
2725  GuiBase* pNext;
2726  GuiBase* pPrev;
2727 
2728 public: // Enum / data
2732  {
2734  PRT_DIRTY = 0b000001,
2736  PRT_IGNORE_MOUSE = 0b000010,
2738  PRT_IGNORE_KEYS = 0b000100,
2740  PRT_SELECTED = 0b001000,
2742  PRT_DISABLE_MOUSE_ON_MOVE = 0b010000,
2744  PRT_CHANGED = 0b100000
2745  };
2746 
2749  typedef void(*OnHoverChangeCallbackFunc)(GuiBase*, int value);
2750 
2753  typedef void(*OnValueChangeCallbackFunc)(GuiBase*, const char*& newValue);
2754 
2757  typedef bool(*OnValidateChangeCallbackFunc)(GuiBase*, const char* oldValue, char* newValue);
2758 
2759 public: // Cache
2760 
2763  OnValueChangeCallbackFunc OnValueChange;
2764 
2767  OnValidateChangeCallbackFunc OnValidateChange;
2768 
2772 
2775  void* userData;
2776 
2779  void* userData2;
2780 
2783  unsigned int customMagnification;
2784 
2785 public: // Configuration
2786 
2789  OnHoverChangeCallbackFunc OnHoverChange;
2790 
2794 
2798 
2802 
2803 public: // Basic constructor
2804 
2808  {
2809  customMagnification = defaultCustomMagnification;
2810  rect = GUI_RECT(0, 0, 0, 0);
2811  hotspot_rect = GUI_RECT(0, 0, 0, 0);
2812  OnHoverChange = nullptr;
2813  OnValueChange = nullptr;
2814  OnValidateChange = nullptr;
2815  pNext = nullptr;
2816  pPrev = nullptr;
2817 
2818  // Ready the config
2819  has_special_mouse_processing = false;
2820  has_special_hotspot_rect = false;
2821  }
2822 
2825  virtual ~GuiBase()
2826  {
2827  }
2828 
2829 protected: // Linkage
2830 
2833  void Link();
2834 
2837  void Unlink();
2838 
2839 public: // Virtual sets & gets
2840 
2845  virtual const char* getClassName() { return "GuiBase"; }
2846 
2851  virtual void setSelected(int value) = 0;
2852 
2857  virtual void setHovered(int value) = 0;
2858 
2863  virtual bool isSelected() = 0;
2864 
2869  virtual bool isHovered() = 0;
2870 
2875  virtual bool isHoverable() = 0;
2876 
2881  virtual int getSelectableCount() { return 0; }
2882 
2886  virtual int getHoverableCount() { return 0; }
2887 
2893  virtual GuiBase* getHoverable(int index) { return (!index ? this : NULL); }
2894 
2900  virtual GuiBase* getSelectable(int index) { return (!index ? this : NULL); }
2901 
2905  virtual bool SelectOnMouseUp() { return true; }
2906 
2907 public: // Virtual methods
2908 
2912  virtual void setFont(FontObject* pFont) {}
2913 
2917  virtual FontObject* getFont() { return NULL; }
2918 
2924  virtual int process(GUI_POINT mouse) = 0;
2925 
2930  virtual void calculate() = 0;
2931 
2935  virtual void render() = 0;
2936 
2941  virtual int processKeys() { return 0; }
2942 
2946  virtual void importantRender() {}
2947 
2948 public: // Inlined functions
2949 
2950  virtual int getMagnification();
2951 
2952 public: // Crucial for managing linkage
2953 
2954  GuiBase(const GuiBase&) = delete;
2955  GuiBase& operator=(const GuiBase&) = delete;
2956  GuiBase(GuiBase&&) = delete;
2957  GuiBase& operator=(GuiBase&&) = delete;
2958 };
2959 
2960 //------------------------------------------------------------------------------------------------------------
2961 
2965 {
2966 protected: // Cache variables
2967 
2971  unsigned int mTextColor_RGB;
2972 
2976  FontObject* mFont;
2977 
2982 
2986  char mText[256];
2987 
2988 public: // Configuration
2989 
2994 
2999 
3003 
3007  char* mNewLines[8];
3008 
3013 
3017 
3021 
3022 public:
3023 
3027  ~CenteredTextInfo();
3028 
3029 public:
3030 
3034  virtual const char* getClassName() { return "CenteredTextInfo"; }
3035 
3039  virtual void setSelected(int value);
3040 
3044  virtual void setHovered(int value);
3045 
3049  virtual bool isSelected();
3050 
3054  virtual bool isHovered();
3055 
3059  virtual bool isHoverable();
3060 
3061 public:
3065  virtual void setFont(FontObject* pFont) { mFont = pFont; }
3066 
3070  inline FontObject* getFont() { return mFont; }
3071 
3072 public:
3077 
3083  int getLineLength(int index);
3084 
3090  void getLineText(int index, char* buffer, int buffer_len);
3091 
3098 
3102  void setText(const char* text);
3103 
3107  inline const char* getText() { return mText; }
3108 
3109 public:
3114  virtual int process(GUI_POINT mouse);
3115 
3119  virtual void calculate();
3120 
3123  virtual void render();
3124 };
3125 
3126 //------------------------------------------------------------------------------------------------------------
3127 
3131 {
3132 protected: // Cache variables
3133 
3137  unsigned int mTextColor_RGB;
3138 
3142  unsigned int mOutlineColor_RGB;
3143 
3147  FontObject* mFont;
3148 
3152  char mText[256];
3153 
3158 
3159 public: // Configuration
3160 
3164 
3168 
3172 
3176 
3177 public:
3178 
3182  ~LabelInfo();
3183 
3184 public:
3185 
3189  virtual const char* getClassName() { return "LabelInfo"; }
3190 
3194  virtual void setSelected(int value);
3195 
3199  virtual void setHovered(int value);
3200 
3204  virtual bool isSelected();
3205 
3209  virtual bool isHovered();
3210 
3214  virtual bool isHoverable();
3215 
3216 public:
3220  virtual void setFont(FontObject* pFont) { mFont = pFont; }
3221 
3225  virtual FontObject* getFont() { return mFont; }
3226 
3227 public:
3231  void setText(const char* text);
3232 
3236  inline const char* getText() { return mText;}
3237 
3238 public:
3243  virtual int process(GUI_POINT mouse);
3244 
3248  virtual void calculate();
3249 
3252  virtual void render();
3253 };
3254 
3255 //------------------------------------------------------------------------------------------------------------
3256 
3260 {
3261 protected: // Cache variables
3262 
3266  FontObject* mFont;
3267 
3271  char mText[256];
3272 
3273 public: // Configuration
3274 
3278 
3282 
3286 
3290 
3294 
3298 
3302 
3305  bool mHovered;
3306 
3307 public:
3308 
3313 
3314 public:
3315 
3319  virtual const char* getClassName() { return "SelectableLabelInfo"; }
3320 
3324  virtual void setSelected(int value);
3325 
3329  virtual void setHovered(int value);
3330 
3334  virtual bool isSelected();
3335 
3339  virtual bool isHovered();
3340 
3344  virtual bool isHoverable();
3345 
3349  virtual int getSelectableCount() { return 1; }
3350 
3354  virtual int getHoverableCount() { return 1; }
3355 
3359  virtual bool SelectOnMouseUp() { return false; }
3360 
3361 public:
3365  virtual void setFont(FontObject* pFont) { mFont = pFont; }
3366 
3370  virtual FontObject* getFont() { return mFont; }
3371 
3372 public:
3376  void setText(const char* text);
3377 
3381  inline const char* getText() { return mText;}
3382 
3383 public:
3388  virtual int process(GUI_POINT mouse);
3389 
3393  virtual void calculate();
3394 
3397  virtual void render();
3398 };
3399 
3400 //------------------------------------------------------------------------------------------------------------
3401 
3405 {
3406 private:
3409  static GUI_RECT srcScrollBarX_BG[3];
3410 
3413  static GUI_RECT srcScrollBarX_LeftBtn[2];
3414 
3417  static GUI_RECT srcScrollBarX_RightBtn[2];
3418 
3421  static GUI_RECT srcScrollBarX_Handle[3];
3422 
3425  static GUI_RECT srcScrollBarX_HandleSel[3];
3426 
3429  static GUI_RECT srcScrollBarY_BG[3];
3430 
3433  static GUI_RECT srcScrollBarY_UpBtn[2];
3434 
3437  static GUI_RECT srcScrollBarY_DownBtn[2];
3438 
3441  static GUI_RECT srcScrollBarY_Handle[3];
3442 
3445  static GUI_RECT srcScrollBarY_HandleSel[3];
3446 
3449  static unsigned int srcBackgroundColor;
3450 
3453  static unsigned int srcOutlineColor;
3454 
3455 public:
3456 
3459  enum HoverType : unsigned char
3460  {
3462  HOVER_NONE = 0,
3463 
3466 
3469 
3471  HOVER_BUTTON_2
3472  };
3473 
3477  {
3479  SCROLL_NONE = 0,
3480 
3483 
3485  SCROLL_Y
3486  };
3487 
3492  typedef void(*OnScrollCallbackFunc)(ScrollAreaInfo* pGui, GUI_POINT_F scrollAmt);
3493 
3494 protected: // Cache variables
3495 
3498  ScrollState scrollState;
3499 
3502  GUI_RECT scrollBarXBtn_Left;
3503 
3506  GUI_RECT scrollBarXBtn_Right;
3507 
3510  GUI_RECT scrollBarYBtn_Up;
3511 
3514  GUI_RECT scrollBarYBtn_Down;
3515 
3518  GUI_RECT scrollBarHandleY;
3519 
3522  GUI_RECT scrollBarY;
3523 
3526  GUI_RECT scrollBarHandleX;
3527 
3530  GUI_RECT scrollBarX;
3531 
3534  GUI_POINT offsetPoint;
3535 
3538  bool showingHandleX;
3539 
3542  bool showingHandleY;
3543 
3544 public: // Public configuration
3545 
3547  OnScrollCallbackFunc OnScroll;
3548 
3552 
3556 
3560 
3564 
3568 
3572 
3576 
3580 
3584 
3588 
3592 
3596 
3597 public:
3598 
3602  ~ScrollAreaInfo();
3603 
3604 public:
3605 
3609  inline bool isScrolling()
3610  {
3611  return (scrollState != ScrollState::SCROLL_NONE);
3612  }
3613 
3614 public: // Configuration
3615 
3619  virtual const char* getClassName() { return "ScrollAreaInfo"; }
3620 
3624  virtual void setSelected(int value);
3625 
3629  virtual void setHovered(int value);
3630 
3634  virtual bool isSelected();
3635 
3639  virtual bool isHovered();
3640 
3644  virtual bool isHoverable();
3645 
3646 public:
3653 
3660 
3667 
3672 
3673 public:
3680 
3685 
3690 
3695 
3700 
3705  virtual int process(GUI_POINT mouse);
3706 
3710  virtual void calculate();
3711 
3714  virtual void render();
3715 
3719  void begin();
3720 
3725  void end();
3726 };
3727 
3728 //------------------------------------------------------------------------------------------------------------
3729 
3733 {
3734 public:
3735 
3739  {
3743 
3746 
3748  MOUSE_BUTTON
3749  };
3750 
3751  enum EInputBoxStyle
3752  {
3753  STYLE_NORMAL,
3754  STYLE_WHITE_BG
3755  };
3756 
3757 private:
3758 
3761  static GUI_RECT srcInputBox[9];
3762 
3765  static GUI_RECT srcInputBoxSel[9];
3766 
3769  static GUI_RECT srcInputBox_Style_1[9];
3770 
3773  static GUI_RECT srcInputBoxSel_Style_1[9];
3774 
3777  static GUI_RECT srcInputBox_Disabled[9];
3778 
3781  static GUI_RECT srcInputBoxSel_Disabled[9];
3782 
3785  static unsigned int srcSelBgColor;
3786 
3789  static unsigned int srcCursorColor;
3790 
3793  static unsigned int srcTextColor;
3794 
3797  static unsigned int srcTextColorStyle2;
3798 
3801  static unsigned int srcTextColorDisabled;
3802 
3805  static unsigned int srcTextColorCensored;
3806 
3807 public: // Data
3808 
3816  typedef bool(*ValidateInputCallbackFunc)(TextInputInfo* pTextInput, const char* pValue, char pValidateOutput[1024]);
3817 
3818 private: // Cache variables
3819 
3822  unsigned int textColor;
3823 
3826  FontObject* font;
3827 
3830  char value[1024];
3831 
3834  char* censoredvalue;
3835 
3838  bool isHovering;
3839 
3842  bool isTyping;
3843 
3846  GUI_POINT textSize;
3847 
3850  GUI_RECT textRect;
3851 
3854  GUI_RECT selectionRect;
3855 
3858  GUI_RECT cursorRect;
3859 
3862  int fontHeight;
3863 
3866  int textXOffset;
3867 
3870  int cursorBlink;
3871 
3872 public: // Public configuration
3873 
3876  EInputBoxStyle mInputStyle;
3877 
3880  ValidateInputCallbackFunc ValidateInput;
3881 
3885 
3889 
3893 
3896  int sel_end;
3897 
3901 
3905 
3909 
3913 
3916  int margin;
3917 
3918 public: // Methods
3919 
3923 
3927 
3928 protected:
3929 
3933 
3934 public:
3935 
3939  virtual const char* getClassName() { return "TextInputInfo"; }
3940 
3944  virtual void setSelected(int value);
3945 
3949  virtual void setHovered(int value);
3950 
3954  virtual bool isSelected();
3955 
3959  virtual bool isHovered();
3960 
3964  virtual bool isHoverable();
3965 
3969  virtual int getSelectableCount() { return 1; }
3970 
3974  virtual int getHoverableCount() { return 1; }
3975 
3979  virtual bool SelectOnMouseUp() { return false; }
3980 
3981 public:
3987  void setValue(const char* value, bool bUseCallback = true);
3988 
3992  const char* getValue();
3993 
3997  virtual void setFont(FontObject* pFont);
3998 
4002  virtual FontObject* getFont() { return font; }
4003 
4007  void startInput(GUI_POINT mouse = GUI_POINT(0, 0));
4008 
4011  void stopInput();
4012 
4019 
4024  virtual int processKeys();
4025 
4030  virtual int process(GUI_POINT mouse);
4031 
4035  virtual void calculate();
4036 
4039  virtual void render();
4040 };
4041 
4042 //------------------------------------------------------------------------------------------------------------
4043 
4047 {
4048 public:
4049 
4053  {
4057 
4060 
4062  MOUSE_BUTTON
4063  };
4064 
4065 private:
4066 
4069  static GUI_RECT srcInputBox[9];
4070 
4073  static GUI_RECT srcInputBoxSel[9];
4074 
4077  static GUI_RECT srcInputBox_Disabled[9];
4078 
4081  static GUI_RECT srcInputBoxSel_Disabled[9];
4082 
4085  static unsigned int srcSelBgColor;
4086 
4089  static unsigned int srcCursorColor;
4090 
4093  static unsigned int srcTextColor;
4094 
4097  static unsigned int srcTextColorDisabled;
4098 
4101  static unsigned int srcTextColorCensored;
4102 
4103 public: // Data
4104 
4111  typedef bool(*ValidateKeyInputCallbackFunc)(KeyInputInfo* pKeyInput, int iKeyValue);
4112 
4113 private: // Cache variables
4114 
4117  FontObject* font;
4118 
4121  int m_KeyValue;
4122 
4125  bool isHovering;
4126 
4129  bool isTyping;
4130 
4133  GUI_RECT textRect;
4134 
4137  int fontHeight;
4138 
4141  char disp_text[256];
4142 
4143 public: // Public configuration
4144 
4148 
4151  ValidateKeyInputCallbackFunc ValidateInput;
4152 
4156 
4160 
4163  int margin;
4164 
4165 public: // Methods
4166 
4170 
4174 
4175 public:
4176 
4180  virtual const char* getClassName() { return "KeyInputInfo"; }
4181 
4185  virtual void setSelected(int value);
4186 
4190  virtual void setHovered(int value);
4191 
4195  virtual bool isSelected();
4196 
4200  virtual bool isHovered();
4201 
4205  virtual bool isHoverable();
4206 
4210  virtual int getSelectableCount() { return 1; }
4211 
4215  virtual int getHoverableCount() { return 1; }
4216 
4220  virtual bool SelectOnMouseUp() { return false; }
4221 
4222 public:
4229  void setValue(int iScancode, bool bUseCallback = true);
4230 
4234  int getValue();
4235 
4239  virtual void setFont(FontObject* pFont);
4240 
4244  virtual FontObject* getFont() { return font; }
4245 
4249 
4252  void startInput();
4253 
4257  void stopInput(bool bSaveValue = true);
4258 
4263  virtual int processKeys();
4264 
4269  virtual int process(GUI_POINT mouse);
4270 
4274  virtual void calculate();
4275 
4278  virtual void render();
4279 };
4280 
4281 //------------------------------------------------------------------------------------------------------------
4282 
4286 {
4287 
4288 private: // Cache variables
4289 
4292  bool mIsHovering;
4293 
4294 public: // Public configuration
4295 
4298  bool mValue;
4299 
4303 
4306  bool mSmall;
4307 
4311 
4312 public:
4313 
4317 
4321 
4322 public:
4323 
4327  virtual const char* getClassName() { return "CheckBoxInfo"; }
4328 
4332  virtual void setSelected(int value);
4333 
4337  virtual void setHovered(int value);
4338 
4342  virtual bool isSelected();
4343 
4347  virtual bool isHovered();
4348 
4352  virtual bool isHoverable();
4353 
4357  virtual int getSelectableCount() { return 1; }
4358 
4362  virtual int getHoverableCount() { return 1; }
4363 
4364 public:
4368  void setValue(bool val);
4369 
4373  bool getValue();
4374 
4375 public:
4376 
4381  virtual int processKeys();
4382 
4387  virtual int process(GUI_POINT mouse);
4388 
4392  virtual void calculate();
4393 
4396  virtual void render();
4397 };
4398 
4399 //------------------------------------------------------------------------------------------------------------
4400 
4404 {
4405 private:
4406 
4409  static GUI_RECT srcHeadButton[2];
4410 
4413  static GUI_RECT srcTimeline[3];
4414 
4417  static unsigned int srcTooltipTextColor;
4418 
4419 private:
4420 
4423  char mText[32];
4424 
4427  FontObject* font;
4428 
4431  bool mIsHovering;
4432 
4435  bool mIsDragging;
4436 
4439  char mKeyWait;
4440 
4443  int mKeyHeld;
4444 
4447  int mKeyHeldOld;
4448 
4451  GUI_POINT mButton;
4452 
4455  GUI_RECT mTooltip;
4456 
4459  GUI_POINT mTextPoint;
4460 
4463  GUI_POINT mTooltipArrow;
4464 
4465 public: // Public configuration
4466 
4469  float mValue;
4470 
4473  float mMax;
4474 
4477  float mMin;
4478 
4481  bool mIntOnly;
4482 
4486 
4487 public:
4488 
4492 
4496 
4497 public:
4498 
4502  virtual const char* getClassName() { return "SliderIntInfo"; }
4503 
4507  virtual void setSelected(int value);
4508 
4512  virtual void setHovered(int value);
4513 
4517  virtual bool isSelected();
4518 
4522  virtual bool isHovered();
4523 
4527  virtual bool isHoverable();
4528 
4532  virtual int getSelectableCount() { return 1; }
4533 
4537  virtual int getHoverableCount() { return 1; }
4538 
4542  virtual bool SelectOnMouseUp() { return false; }
4543 
4544 public:
4545 
4549  void setValue(int val);
4550 
4554  int getValue();
4555 
4556 public:
4560  virtual void setFont(FontObject* pFont) { font = pFont; }
4561 
4565  virtual FontObject* getFont() { return font; }
4566 
4571  virtual int processKeys();
4572 
4577  virtual int process(GUI_POINT mouse);
4578 
4582  virtual void calculate();
4583 
4586  virtual void render();
4587 
4591  virtual void importantRender();
4592 };
4593 
4594 //------------------------------------------------------------------------------------------------------------
4595 
4599 {
4600 public:
4601 
4604  typedef void(*OnButtonPressedFunc)(ButtonInfo*, void*);
4605 
4606 private:
4607 
4610  static GUI_RECT srcButton[9];
4611 
4614  static GUI_RECT srcButtonSel[9];
4615 
4618  static GUI_RECT srcButtonDis[9];
4619 
4622  static GUI_RECT srcButtonDisSel[9];
4623 
4626  static unsigned int srcTextColor;
4627 
4630  static unsigned int srcDisabledTextColor;
4631 
4632 private: // Cache variables
4633 
4636  FontObject* font;
4637 
4640  GUI_POINT textPoint;
4641 
4644  bool isHovering;
4645 
4646 public: // Public configuration
4647 
4650  char text[256];
4651 
4654  int vmargin;
4655 
4658  int margin;
4659 
4662  OnButtonPressedFunc OnClicked;
4663 
4667 
4668 public: // Methods
4669 
4673 
4677 
4678 public:
4679 
4683  virtual const char* getClassName() { return "ButtonInfo"; }
4684 
4688  virtual void setSelected(int value);
4689 
4693  virtual void setHovered(int value);
4694 
4698  virtual bool isSelected();
4699 
4703  virtual bool isHovered();
4704 
4708  virtual bool isHoverable();
4709 
4713  virtual int getSelectableCount() { return 1; }
4714 
4718  virtual int getHoverableCount() { return 1; }
4719 
4720 public:
4721 
4725  virtual void setFont(FontObject* pFont) { font = pFont; }
4726 
4730  virtual FontObject* getFont() { return font; }
4731 
4736  virtual int processKeys();
4737 
4742  virtual int process(GUI_POINT mouse);
4743 
4747  virtual void calculate();
4748 
4751  virtual void render();
4752 };
4753 
4754 //------------------------------------------------------------------------------------------------------------
4755 
4759 {
4760 private:
4761 
4764  static GUI_RECT srcDropdownBoxBG_Sel[3];
4765 
4768  static GUI_RECT srcDropdownBoxBG_Off[3];
4769 
4772  static GUI_RECT srcDropdownBoxBG_OffSel[3];
4773 
4776  static GUI_RECT srcDropdownBoxBG[3];
4777 
4780  static GUI_RECT srcContentBG[9];
4781 
4784  static GUI_RECT srcPointer;
4785 
4786 public:
4787 
4790  struct DBI_Item
4791  {
4794  char text[256];
4795 
4799 
4803 
4807  };
4808 
4809 public: // Public data
4810 
4813  DBI_Item* mItems;
4814 
4817  int mItemCount;
4818 
4821  int mItemsSize;
4822 
4823 private: // Cache variables
4824 
4827  GUI_POINT mTextPoint;
4828 
4831  GUI_POINT mTextSize;
4832 
4835  GUI_POINT mPointerPos;
4836 
4839  GUI_RECT mTextRect;
4840 
4843  GUI_RECT mContentBG;
4844 
4847  FontObject* mFont;
4848 
4851  bool mIsOpen;
4852 
4855  bool mHovered;
4856 
4859  int mHoverId;
4860 
4863  ScrollAreaInfo mScroll;
4864 
4865 
4866 public: // Public configuration
4867 
4871 
4875 
4879 
4883 
4887 
4891 
4895 
4899 
4903 
4904 public: // Methods
4905 
4909 
4913 
4914 public:
4915 
4919  virtual const char* getClassName() { return "DropdownBoxInfo"; }
4920 
4926  const char* getItemText(int index);
4927 
4931  virtual void setFont(FontObject* pFont);
4932 
4936  virtual FontObject* getFont() { return mFont; }
4937 
4941  void addItem(const char* text);
4942 
4945  void clearItems();
4946 
4950  int getCount();
4951 
4954  void setSelectedItem(int iItemId);
4955 
4956 public:
4957 
4962 
4963 public:
4964 
4968  virtual void setIsOpen(bool bIsOpen);
4969 
4973  virtual bool getIsOpen();
4974 
4978  virtual void setSelected(int value);
4979 
4983  virtual void setHovered(int value);
4984 
4988  virtual bool isSelected();
4989 
4993  virtual bool isHovered();
4994 
4998  virtual bool isHoverable();
4999 
5003  virtual int getSelectableCount() { return 1; }
5004 
5008  virtual int getHoverableCount() { return 1; }
5009 
5010 public:
5015  virtual int processKeys();
5016 
5021  virtual int process(GUI_POINT mouse);
5022 
5026  virtual void calculate();
5027 
5030  virtual void render();
5031 
5035  virtual void importantRender();
5036 
5037 public: // Helper methods
5038 
5045  static int GetDropdownBoxHeight(FontObject* pFont = NULL, int iTextMargin = -1);
5046 };
5047 
5048 //------------------------------------------------------------------------------------------------------------
5049 
5053 {
5054 private:
5057  static GUI_RECT srcPanelLeft[9];
5058 
5061  static GUI_RECT srcPanelRight[9];
5062 
5063 private: // Cache variables
5064 
5067  FontObject* mFont;
5068 
5071  GUI_RECT mSpriteRect;
5072 
5075  GUI_RECT mLeftPanel;
5076 
5079  GUI_RECT mRightPanel;
5080 
5083  GUI_RECT mOldClipRect;
5084 
5087  bool isHovering;
5088 
5091  GuiBase* mGuiBaseList[6];
5092 
5093 public:
5094 
5098 
5102 
5106 
5110 
5114 
5118 
5119 public: // Public configuration
5120 
5126  void(*OnRenderSprite)(ColorPickerInfo* pGui, GUI_RECT pRect, GUI_COLOR pColor);
5127 
5131 
5135 
5138  int margin;
5139 
5140 public: // Methods
5141 
5145 
5149 
5150 public:
5151 
5155  virtual const char* getClassName() { return "ColorPickerInfo"; }
5156 
5160  virtual void setSelected(int value);
5161 
5165  virtual void setHovered(int value);
5166 
5170  virtual bool isSelected();
5171 
5175  virtual bool isHovered();
5176 
5180  virtual bool isHoverable();
5181 
5185  virtual int getSelectableCount();
5186 
5190  virtual int getHoverableCount();
5191 
5197  virtual GuiBase* getHoverable(int index);
5198 
5204  virtual GuiBase* getSelectable(int index);
5205 
5206 public:
5207 
5211  void updateColor(bool callback = true);
5212 
5213 public:
5214 
5218  virtual void setFont(FontObject* pFont);
5219 
5223  virtual FontObject* getFont() { return mFont; }
5224 
5229  virtual int process(GUI_POINT mouse);
5230 
5234  virtual void calculate();
5235 
5238  virtual void render();
5239 
5243  virtual void importantRender();
5244 };
5245 
5246 //------------------------------------------------------------------------------------------------------------
5247 
5251 {
5252 public:
5253 
5256  typedef void(*OnWindowDraggedFunc)(DraggableWindowInfo*);
5257 
5260  typedef void(*OnWindowCollapsedFunc)(DraggableWindowInfo*);
5261 
5264  typedef void(*OnWindowExpandedFunc)(DraggableWindowInfo*);
5265 
5268  typedef void(*OnWindowClosedFunc)(DraggableWindowInfo*);
5269 
5270 public:
5271 
5272  enum ActionType
5273  {
5274  ACTION_NONE,
5275  ACTION_HOVER_CLOSE,
5276  ACTION_HOVER_MINMAX,
5277  ACTION_CLICK_CLOSE,
5278  ACTION_CLICK_MINMAX,
5279  ACTION_DRAG,
5280  ACTION_RESIZE_LEFT,
5281  ACTION_RESIZE_TOP,
5282  ACTION_RESIZE_RIGHT,
5283  ACTION_RESIZE_BOTTOM,
5284  ACTION_RESIZE_BOTTOMLEFT,
5285  ACTION_RESIZE_BOTTOMRIGHT,
5286  ACTION_RESIZE_TOPLEFT
5287  };
5288 
5289 private:
5290 
5293  static unsigned int srcTextColor;
5294 
5295 private: // Cache variables
5296 
5299  GUI_POINT last_mouse_pos;
5300 
5303  GUI_RECT last_rect;
5304 
5307  bool using_lmb;
5308 
5309 public: // Draggable stuff
5310 
5313  CenteredTextInfo text;
5314 
5317  GUI_RECT rect_resize_width[2];
5318 
5321  GUI_RECT rect_resize_height[2];
5322 
5323 public: //
5324 
5327  GUI_RECT topRect;
5328 
5331  GUI_RECT bottomRect;
5332 
5335  GUI_RECT Button_Close;
5336 
5339  GUI_RECT Button_MinMax;
5340 
5343  bool is_collapsed;
5344 
5347  ActionType current_action;
5348 
5349 public: // Public configuration
5350 
5353  int margin;
5354 
5357  OnWindowDraggedFunc OnDragged;
5358 
5361  OnWindowDraggedFunc OnDragStart;
5362 
5365  OnWindowDraggedFunc OnDragEnd;
5366 
5369  OnWindowDraggedFunc OnResizeStart;
5370 
5373  OnWindowDraggedFunc OnResizing;
5374 
5377  OnWindowDraggedFunc OnResizeEnd;
5378 
5381  OnWindowCollapsedFunc OnCollapse;
5382 
5385  OnWindowExpandedFunc OnExpand;
5386 
5389  OnWindowClosedFunc OnClose;
5390 
5394 
5398 
5402 
5406 
5410 
5414 
5418 
5422 
5426 
5430 
5434 
5435 public: // Methods
5436 
5440 
5444 
5445 public:
5446 
5450  virtual const char* getClassName() { return "DraggableWindowInfo"; }
5451 
5455  inline bool isCollapsed() { return is_collapsed; }
5456 
5460  inline void setCollapsed(bool bValue) { is_collapsed = bValue; }
5461 
5465  void setText(const char* pValue);
5466 
5470  virtual void setSelected(int value);
5471 
5475  virtual void setHovered(int value);
5476 
5480  virtual bool isSelected();
5481 
5485  virtual bool isHovered();
5486 
5490  virtual bool isHoverable();
5491 
5495  virtual int getSelectableCount() { return 1; }
5496 
5500  virtual int getHoverableCount() { return 1; }
5501 
5502 public:
5503 
5507 
5511 
5515 
5519  virtual void setFont(FontObject* pFont);
5520 
5524  virtual FontObject* getFont() { return text.getFont(); }
5525 
5530  virtual int processKeys();
5531 
5536  virtual int process(GUI_POINT mouse);
5537 
5541 
5545  virtual void calculate();
5546 
5549  virtual void render();
5550 };
5551 
5552 //------------------------------------------------------------------------------------------------------------
5553 
5557 {
5558 private:
5559 
5562  FontObject* mFont;
5563 
5564 public:
5565 
5568  char text[128];
5569 
5570  GUI_POINT mTextPoint;
5571  GUI_POINT mTextSize;
5572  GUI_RECT mContentRect;
5573  GUI_POINT mLine_Top_1[2];
5574  GUI_POINT mLine_Top_2[2];
5575  GUI_POINT mLine_Left[2];
5576  GUI_POINT mLine_Right[2];
5577  GUI_POINT mLine_Bottom[2];
5578 
5579 public: // Methods
5580 
5584 
5588 
5589 public:
5590 
5594  virtual bool isHoverable();
5595 
5599  virtual int getSelectableCount() { return 0; }
5600 
5604  virtual int getHoverableCount() { return 0; }
5605 
5606 public:
5607 
5608  virtual void setSelected(int value) {}
5609  virtual void setHovered(int value) { }
5610  virtual bool isSelected() { return false; }
5611  virtual bool isHovered() { return false; }
5612  virtual int process(GUI_POINT) { return 0; }
5613 
5614 public:
5615 
5619  virtual const char* getClassName() { return "GroupBoxInfo"; }
5620 
5624  void fitRect(GUI_RECT content_rect, int margin = 0);
5625 
5629  virtual void setFont(FontObject* pFont) { mFont = pFont; }
5630 
5634  virtual FontObject* getFont() { return mFont; }
5635 
5639  virtual void calculate();
5640 
5643  virtual void render();
5644 };
5645 
5646 //------------------------------------------------------------------------------------------------------------
5647 
5651 {
5652 public:
5653 
5656  typedef void(*OnTabSelectedFunc)(TabBookInfo*, int);
5657 
5660  typedef void(*OnTabCloseFunc)(TabBookInfo*, int);
5661 
5662 private:
5663 
5666  static GUI_RECT srcSelectedTabButton_Normal[9];
5667 
5670  static GUI_RECT srcSelectedTabButton_Pressed[9];
5671 
5674  static GUI_RECT srcTabButton_Normal[9];
5675 
5678  static GUI_RECT srcTabButton_Pressed[9];
5679 
5682  static GUI_RECT srcTabButton_CloseButton[3];
5683 
5684 public:
5685 
5688  struct TAB
5689  {
5692  char text[64];
5693 
5697 
5701 
5705 
5709 
5713 
5717  };
5718 
5719 private: // Cache variables
5720 
5723  TAB* mItems;
5724 
5727  int mItemCount;
5728 
5731  FontObject* mFont;
5732 
5735  int mHoveredTab;
5736 
5739  bool mHoveredTab_Close;
5740 
5741 
5744  int mLargestTabHeight;
5745 
5746 public: // Public configuration
5747 
5751 
5754  OnTabSelectedFunc OnTabSelectCallback;
5755 
5758  OnTabCloseFunc OnTabCloseCallback;
5759 
5763 
5766  int mMargin;
5767 
5771 
5775 
5776 public: // Methods
5777 
5781 
5785 
5786 public:
5787 
5791  virtual const char* getClassName() { return "TabBookInfo"; }
5792 
5796  virtual void setFont(FontObject* pFont) { mFont = pFont; }
5797 
5801  virtual FontObject* getFont() { return mFont; }
5802 
5807  void addTab(const char* pTabText, bool bCanBeClosed = false);
5808 
5811  void clearTabs();
5812 
5817 
5823  TAB* getTab(int tab);
5824 
5825 public:
5826 
5830  inline void setHoveredOverCloseButton(bool bValue) { mHoveredTab_Close = bValue; }
5831 
5835  inline bool getHoveredOverCloseButton() { return mHoveredTab_Close; }
5836 
5840  virtual void setSelected(int value);
5841 
5845  virtual void setHovered(int value);
5846 
5850  void setCloseHovered(int value);
5851 
5855  virtual bool isSelected();
5856 
5860  virtual bool isHovered();
5861 
5865  virtual bool isHoverable();
5866 
5870  virtual int getSelectableCount();
5871 
5875  virtual int getHoverableCount();
5876 
5880  inline GUI_RECT getDrawRect() { return mTabContentRect; }
5881 
5882 public:
5883 
5888  virtual int processKeys();
5889 
5894  virtual int process(GUI_POINT mouse);
5895 
5899  virtual void calculate();
5900 
5903  virtual void render();
5904 };
5905 
5908 
5909 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
5910 
5914 {
5915 public:
5916 
5917  void* mUserData1;
5918  void* mUserData2;
5919  void* mUserData3;
5920  void(*mOnDrawFunc)(CustomDrawInfo* pUs, void* pUserData1, void* pUserData2, void* pUserData3);
5921  int mMinWidth;
5922  int mMinHeight;
5923 
5924 public:
5925 
5929 
5933 
5934 public:
5935 
5939  virtual const char* getClassName() { return "CustomDrawInfo"; }
5940 
5944  virtual void setSelected(int value);
5945 
5949  virtual void setHovered(int value);
5950 
5954  virtual bool isSelected();
5955 
5959  virtual bool isHovered();
5960 
5964  virtual bool isHoverable();
5965 
5966 public:
5971  virtual int process(GUI_POINT mouse);
5972 
5976  virtual void calculate();
5977 
5980  virtual void render();
5981 };
5982 
5983 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
5984 
5988 {
5989 private: // Private variables
5990 
5995 
6000 
6005 
6008  GUI_COLOR m_ColorMod;
6009 
6012  bool m_UseColorMod;
6013 
6014 public: // Public variables
6015 
6019 
6020 public:
6021 
6025 
6029 
6030 public:
6031 
6034  void Cleanup();
6035 
6042  bool LoadImage(const char* pImage);
6043 
6050  bool LoadImage(Surface_Ids eSurfId);
6051 
6055  void SetImageSourceRect(GUI_RECT* pSrcRect);
6056 
6060  void SetColorMod(GUI_COLOR* pColor);
6061 
6065  GUI_RECT GetImageSourceRect() { return m_SrcRect; }
6066 
6070  Surface_Ids GetSurfaceID() { return m_SurfID; }
6071 
6075  GUI_COLOR GetColorMod() { return m_ColorMod; }
6076 
6077 public:
6078 
6082  virtual const char* getClassName() { return "DrawBitmapInfo"; }
6083 
6087  virtual void setSelected(int value);
6088 
6092  virtual void setHovered(int value);
6093 
6097  virtual bool isSelected();
6098 
6102  virtual bool isHovered();
6103 
6107  virtual bool isHoverable();
6108 
6109 public:
6114  virtual int process(GUI_POINT mouse);
6115 
6119  virtual void calculate();
6120 
6123  virtual void render();
6124 };
6125 
6126 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
6127 
6131 {
6132 protected:
6133  static GUI_RECT m_TileRect;
6134 
6135 public:
6136  GUI_COLOR m_FillColor;
6137  GUI_COLOR m_BorderColor;
6138  GUI_RECT m_ContentRect;
6139 
6140 public:
6141 
6145 
6149 
6150 public:
6151 
6155  virtual const char* getClassName() { return "CaveStoryDialogBoxInfo"; }
6156 
6160  virtual void setSelected(int value);
6161 
6165  virtual void setHovered(int value);
6166 
6170  virtual bool isSelected();
6171 
6175  virtual bool isHovered();
6176 
6180  virtual bool isHoverable();
6181 
6182 public:
6183 
6189  virtual GUI_RECT getContentArea(int iMargin = 0);
6190 
6191 public:
6196  virtual int process(GUI_POINT mouse);
6197 
6201  virtual void calculate();
6202 
6205  virtual void render();
6206 };
6207 
6208 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
6209 
6211 struct SystemMenuItem;
6212 
6213 typedef void(*SystemMenuInfo_OnItemClickFunc)(SystemMenuInfo* pSMI, SystemMenuItem* pItem);
6214 
6218 {
6221  unsigned int ItemId;
6222 
6225  unsigned int TotalItemIndex;
6226 
6229  unsigned int ItemIndex;
6230 
6234 
6238 
6242 
6246 
6250 
6254 
6257  char Text[270];
6258 
6262 
6266 
6270 
6274 
6278 
6282 
6285  bool Disabled;
6286 
6289  bool Checked;
6290 
6293  SystemMenuInfo_OnItemClickFunc OnClicked;
6294 
6297  Input::KeyShortcut* Shortcut;
6298 
6301  char ShortcutText[64];
6302 };
6303 
6307 {
6308 private:
6309 
6312  static GUI_RECT srcDropdownBoxBG_Sel[3];
6313 
6316  static GUI_RECT srcDropdownBoxBG_Off[3];
6317 
6320  static GUI_RECT srcDropdownBoxBG_OffSel[3];
6321 
6324  static GUI_RECT srcDropdownBoxBG[3];
6325 
6328  static GUI_RECT srcContentBG[9];
6329 
6330 private: // Cache variables
6331 
6334  SystemMenuItem** mItemList;
6335 
6338  int mItemCount;
6339 
6342  SystemMenuItem** mTotalItemList;
6343 
6346  int mTotalItemCount;
6347 
6350  SystemMenuItem** mItemShortcutList;
6351 
6354  int mItemShortcutCount;
6355 
6358  FontObject* mFont;
6359 
6362  bool mHovered;
6363 
6366  bool mUsedKeyboard;
6367 
6370  unsigned int mTimeHovered;
6371 
6374  SystemMenuItem* mCurrentlyOpen;
6375 
6378  SystemMenuItem* mCurrentlyHovered;
6379 
6382  SystemMenuItem* mLastHovered;
6383 
6386  bool mRecentlyCleared;
6387 
6388 public: // Public configuration
6389 
6390  struct
6391  {
6394  unsigned long text_normal;
6395 
6398  unsigned long submenu_itembg_hovered;
6399 
6403 
6406  unsigned long background;
6407  } mColors;
6408 
6412 
6413 public: // Methods
6414 
6418 
6422 
6423 protected: // Memory methods
6424 
6430 
6431 public:
6432 
6436  virtual const char* getClassName() { return "SystemMenuInfo"; }
6437 
6441  inline void setFont(FontObject* pFont) { mFont = pFont; }
6442 
6450  SystemMenuItem* AddItem(int iItemId, const char* pText, SystemMenuItem* pParent = NULL, Input::KeyShortcut* pShortcut = NULL);
6451 
6457  SystemMenuItem* GetItemByText(const char* pText);
6458 
6465 
6472 
6477 
6480  void ClearItems();
6481 
6484  void DumpItems();
6485 
6486 public:
6487 
6491  virtual void setSelected(int value);
6492 
6496  virtual void setHovered(int value);
6497 
6501  virtual bool isSelected();
6502 
6506  virtual bool isHovered();
6507 
6511  virtual bool isHoverable();
6512 
6516  virtual int getSelectableCount() { return 1; }
6517 
6521  virtual int getHoverableCount() { return 1; }
6522 
6523 public:
6524 
6528 
6533  virtual int processKeys();
6534 
6539  virtual int process(GUI_POINT mouse);
6540 
6541 protected:
6542 
6548 
6549 public:
6550 
6553  void closeMenu();
6554 
6555 public:
6556 
6560  virtual void calculate();
6561 
6564  virtual void render();
6565 
6569  virtual void importantRender();
6570 };
6571 
6572 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
6573 
6577 {
6578 public: // Structs
6579 
6583  {
6586  int index;
6587 
6591 
6595 
6599 
6602  int id;
6603 
6606  char* text;
6607 
6611  };
6612 
6613 protected: // Cache variables
6614 
6618  FontObject* mFont;
6619 
6622  List<SEL_LIST_ENTRY*> mEntries;
6623 
6627 
6631 
6635 
6639 
6642  bool mDirty;
6643 
6647 
6651 
6652 public: // Configuration
6653 
6657 
6661 
6665 
6669 
6673 
6677 
6680  int mMargin;
6681 
6685 
6686 public:
6687 
6691 
6694 
6695 public:
6696 
6700  virtual const char* getClassName() { return "SelectableListInfo"; }
6701 
6705  virtual void setSelected(int value);
6706 
6710  virtual void setHovered(int value);
6711 
6715  virtual bool isSelected();
6716 
6720  virtual bool isHovered();
6721 
6725  virtual bool isHoverable();
6726 
6730  virtual int getSelectableCount() { return 1; }
6731 
6735  virtual int getHoverableCount() { return 1; }
6736 
6740  virtual bool SelectOnMouseUp() { return false; }
6741 
6742 public:
6746  virtual void setFont(FontObject* pFont) { mFont = pFont; }
6747 
6748 public:
6749 
6756  bool AddEntry(int iSelectionId, const char* pText);
6757 
6761 
6766 
6770  GUI_RECT GetEntryRectById(int iSelectedId, bool bUseScrolled = false);
6771 
6776  void SetScrollOffset(int iOffsetX, int iOffsetY);
6777 
6782 
6783 public:
6788  virtual int process(GUI_POINT mouse);
6789 
6793  virtual void calculate();
6794 
6797  virtual void render();
6798 };
6799 
6800 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
6801 
6805 {
6809 
6813 
6817 
6821 
6825 
6829 
6833 
6836  unsigned char mDirect;
6837 
6840  struct
6841  {
6844  unsigned int ent_bits_mask;
6845 
6849 
6854 
6858  {
6859  mConfig.ent_bits_mask = 0;
6860  mConfig.hit_slopes = true;
6861  mConfig.hit_entities = false;
6862  }
6863 };
6864 
6865 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
6866 
6868 {
6869  int tile_index;
6870  unsigned short new_tile_id;
6871  unsigned short old_tile_id;
6872 
6873  inline bool operator==(const MAP_CHANGED_TILE& other) const { return tile_index == other.tile_index; }
6874  inline bool operator!=(const MAP_CHANGED_TILE& other) const { return tile_index != other.tile_index; }
6875  inline bool operator< (const MAP_CHANGED_TILE& other) const { return tile_index < other.tile_index; }
6876  inline bool operator<=(const MAP_CHANGED_TILE& other) const { return tile_index <= other.tile_index; }
6877  inline bool operator> (const MAP_CHANGED_TILE& other) const { return tile_index > other.tile_index; }
6878  inline bool operator>=(const MAP_CHANGED_TILE& other) const { return tile_index >= other.tile_index; }
6879 
6881  {
6882  tile_index = 0;
6883  new_tile_id = 0;
6884  old_tile_id = 0;
6885  }
6886 
6887  MAP_CHANGED_TILE(int index)
6888  {
6889  MAP_CHANGED_TILE();
6890 
6891  tile_index = index;
6892  }
6893 };
6894 
6895 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
6896 
6897 #define MAP_MAX_ZONES 0x7FFFFFFF
6898 
6903 {
6904 public:
6907  int id;
6908 
6912  {
6915  int x;
6916 
6919  int y;
6920 
6923  int w;
6924 
6927  int h;
6928  } rect;
6929 
6932  int used;
6933 
6937 
6938 private: // Data
6939 
6942  void* tables_struct;
6943 
6944 public:
6945 
6949 
6953 
6954 public: // General
6957  void Init();
6958 
6961  void Free();
6962 
6963 public: // NPC Management
6967  void AddNpChar(NPCHAR* npc);
6968 
6972  void RemoveNpChar(NPCHAR* npc);
6973 
6977 
6980  void ActNpChar();
6981 
6984  void PutNpChar(int frame_x, int frame_y);
6985 
6991  bool HasNpChar(NPCHAR* npc);
6992 
6993 public: // Boss Management
6997  void AddBoss(NPCHAR* npc);
6998 
7002  void RemoveBoss(NPCHAR* npc);
7003 
7007 
7010  void ActBoss();
7011 
7014  void PutBoss(int frame_x, int frame_y);
7015 
7021  bool HasBoss(NPCHAR* npc);
7022 };
7023 
7024 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
7025 
7029 {
7033 
7036  unsigned int tile_offset;
7037 
7041 
7045 
7048  unsigned char rect_count;
7049 
7052  unsigned short wait;
7053 
7054  // **--** RUNTIME CACHE VARIABLES **--**
7055 
7058  unsigned char frame;
7059 
7062  unsigned char timer;
7063 
7067 
7071 
7075 };
7076 
7077 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
7078 
7081 struct MAP_DATA
7082 {
7085  unsigned short* data;
7086 
7089  unsigned short* ngdata;
7090 
7093  unsigned char atrb[0x10001]; //Why is this 257 bytes?
7094 
7097  short width;
7098 
7101  short length;
7102 
7106 
7110 
7114 
7118 
7122 
7126 
7129  unsigned int crc;
7130 
7134 };
7135 
7136 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
7137 
7144 typedef void(*PlayerState_ActFuncType)(BOOL bKey, SafeClientInterface* pInterface, MYCHAR* pMC, const MYCHAR_PHYSICS* pPhysics);
7145 
7153 typedef unsigned int(*PlayerState_AnimFuncType)(BOOL bKey, MYCHAR* pMC, SafeClientInterface* pInterface);
7154 
7161 typedef void(*PlayerState_DrawFuncType)(int iFrameX, int iFrameY, MYCHAR* pMC, SafeClientInterface* pInterface);
7162 
7163 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
7164 
7168 {
7171  bool Used;
7172 
7176 
7180 
7183  unsigned char NetSize;
7184 
7187  bool Ranged;
7188 
7192 
7196 };
7197 
7201 {
7204  char* StateName;
7205 
7213 
7222 
7230 
7234 
7238  unsigned long long int Flags;
7239 
7243  unsigned int TransmitFlags;
7244 
7248 
7252 };
7253 
7257 {
7260  char* name;
7261 
7265 
7268  unsigned int user_ident_hash[5];
7269 
7273 };
7274 
7278 {
7281  char window_title[260];
7282 
7285  char window_guifile[260];
7286 
7289  int margin;
7290 
7294 
7298 
7302 
7306 
7310 
7314 
7318 
7322 
7326 
7330 
7331 #ifdef _DEBUG
7334  unsigned char debug;
7335 #endif
7336 
7340 
7344 };
7345 
7349 {
7353 
7356  char* data;
7357 };
7358 
7359 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
7360 
7369 static RECT RECT_XYWH(int x, int y, int w, int h)
7370 {
7371  RECT ret;
7372  ret.left = x;
7373  ret.top = y;
7374  ret.right = x + w;
7375  ret.bottom = y + h;
7376  return ret;
7377 }
7378 
7379 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
7380 
7388 (
7391 );
7392 
7397 typedef void(*CSM_Weapon_ShootFunc)
7398 (
7399  ShootInfo* sData,
7400  int iLevel
7401 );
7402 
7407 typedef void(*CSM_Bullet_ActFunc)
7408 (
7409  BULLET* pBul,
7410  int iLevel
7411 );
7412 
7416 typedef void(*CSM_Npc_ActFunc)
7417 (
7418  NPCHAR* pNpc
7419 );
7420 
7424 typedef void(*CSM_Caret_ActFunc)
7425 (
7426  CARET* caret
7427 );
7428 
7429 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
7430 
7431 extern CAVESTORY_MOD_API MYCHAR gMC;
7432 extern CAVESTORY_MOD_API MYCHAR gNOT_USED;
7433 extern CAVESTORY_MOD_API NPCHAR gNPC[NPC_MAX];
7434 extern CAVESTORY_MOD_API CARET gCrt[CARET_MAX];
7435 extern CAVESTORY_MOD_API int gKey;
7436 extern CAVESTORY_MOD_API int gKeyTrg;
7437 extern CAVESTORY_MOD_API int gKeyOld;
7438 
7439 extern CAVESTORY_MOD_API int gKeyJump;
7440 extern CAVESTORY_MOD_API int gKeyShot;
7441 extern CAVESTORY_MOD_API int gKeyArms;
7442 extern CAVESTORY_MOD_API int gKeyArmsRev;
7443 extern CAVESTORY_MOD_API int gKeyItem;
7444 extern CAVESTORY_MOD_API int gKeyMap;
7445 extern CAVESTORY_MOD_API int gKeyOk;
7446 extern CAVESTORY_MOD_API int gKeyCancel;
7447 extern CAVESTORY_MOD_API int gKeyLeft;
7448 extern CAVESTORY_MOD_API int gKeyUp;
7449 extern CAVESTORY_MOD_API int gKeyRight;
7450 extern CAVESTORY_MOD_API int gKeyDown;
7451 extern CAVESTORY_MOD_API int gKeyMaxVal;
7452 
7453 extern CAVESTORY_MOD_API int gKey2;
7454 extern CAVESTORY_MOD_API int gKeyTrg2;
7455 extern CAVESTORY_MOD_API int gKeyOld2;
7456 
7457 extern CAVESTORY_MOD_API int gKey_JOY;
7458 extern CAVESTORY_MOD_API int gKeyTrg_JOY;
7459 extern CAVESTORY_MOD_API int gKeyOld_JOY;
7460 
7461 extern CAVESTORY_MOD_API void GetTrg();
7462 
7463 extern CAVESTORY_MOD_API int gStageNo;
7464 extern CAVESTORY_MOD_API int gMusicNo;
7465 extern CAVESTORY_MOD_API int g_GameFlags;
7466 
7467 extern CAVESTORY_MOD_API TEXT_SCRIPT_PTR_DATA default_TextScriptPtrData;
7468 extern CAVESTORY_MOD_API TEXT_SCRIPT_PTR_DATA gCurrentPtrData;
7469 extern CAVESTORY_MOD_API TEXT_SCRIPT gTS;
7470 extern CAVESTORY_MOD_API List<TEXT_SCRIPT_CALLSTACK_DATA>* gTS_CallStack;
7471 
7472 extern CAVESTORY_MOD_API int gCollectableCount;
7473 extern CAVESTORY_MOD_API bool gCollectablesShown;
7474 
7475 extern CAVESTORY_MOD_API MAP_DATA gMap;
7476 
7477 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
7478 
7479 #include "CSMAPI_endcode.h"
CSM_ClientRanks
All possible values for a client's mAdminRank.
Definition: CSMAPI_enums.h:1465
@ SCI_ST_AUTO
Automatically determine which client type to use.
Definition: CSMAPI_enums.h:1015
Surface_Ids
List of surface IDs.
Definition: CSMAPI_enums.h:714
PLAYER_STATE_TRANSMIT_FLAGS
Playerstate transmit flags.
Definition: CSMAPI_enums.h:1133
CSM_KEY_DESC
A table of input descriptors.
Definition: CSMAPI_enums.h:116
@ CSM_KEY_DESC_KEY
Contains input flags from KEYBIND.
Definition: CSMAPI_enums.h:123
TextScriptSkipEventStatus
Cutscene skipping status.
Definition: CSMAPI_enums.h:1045
PlayerStateAnimator_OutputType
A list of output types for a player state's "ANIMATE" function.
Definition: CSMAPI_enums.h:1217
TextScriptTarget
The TextScript's target.
Definition: CSMAPI_enums.h:1059
CSM_RankedClientInfoType
Ranked client type.
Definition: CSMAPI_enums.h:1403
void(* FreeNPCFunc)(NPCHAR *npc)
A custom free function for NPCHAR.
Definition: CSMAPI_types.h:112
BOOL(* CollideNPCFunc)(NPCHAR *npc)
Custom collision detection function.
Definition: CSMAPI_types.h:119
float(* CSM_NetScore_GetScoreModifyAmount)(CaveNet::DataStructures::NetClient *pClient, CaveNet::DataStructures::NetScoreInstance *pInstance)
Determine the amount of score to be modified for a client.
Definition: CSMAPI_types.h:7388
void(* PlayerState_DrawFuncType)(int iFrameX, int iFrameY, MYCHAR *pMC, SafeClientInterface *pInterface)
The draw function for this player state.
Definition: CSMAPI_types.h:7161
void(* PutNPCFunc)(NPCHAR *npc, int fx, int fy)
A custom draw function for NPCHAR.
Definition: CSMAPI_types.h:107
void(* CSM_Npc_ActFunc)(NPCHAR *pNpc)
Called every frame an NPC is active.
Definition: CSMAPI_types.h:7417
void(* PlayerState_ActFuncType)(BOOL bKey, SafeClientInterface *pInterface, MYCHAR *pMC, const MYCHAR_PHYSICS *pPhysics)
The act function for this player state.
Definition: CSMAPI_types.h:7144
void(* CSM_Caret_ActFunc)(CARET *caret)
Called every frame a caret is active.
Definition: CSMAPI_types.h:7425
unsigned int(* PlayerState_AnimFuncType)(BOOL bKey, MYCHAR *pMC, SafeClientInterface *pInterface)
The animation function for this player state.
Definition: CSMAPI_types.h:7153
void(* CSM_Bullet_ActFunc)(BULLET *pBul, int iLevel)
Called every frame a bullet is active.
Definition: CSMAPI_types.h:7408
void(* CSM_Weapon_ShootFunc)(ShootInfo *sData, int iLevel)
Called every frame a weapon is equipped, for every client.
Definition: CSMAPI_types.h:7398
Show a clickable button.
Definition: CSMAPI_types.h:4599
int margin
Text margin.
Definition: CSMAPI_types.h:4658
virtual void calculate()
Re-calculate this element's data.
bool isDisabled
Whether this button is disabled or not.
Definition: CSMAPI_types.h:4666
virtual bool isHovered()
Check hover status.
virtual void setSelected(int value)
Set this GUI element as selected or not.
virtual int process(GUI_POINT mouse)
Process mouse input for this element.
int vmargin
Vertical text margin.
Definition: CSMAPI_types.h:4654
virtual void setHovered(int value)
Set this GUI element as hovered over or not.
ButtonInfo()
Default constructor.
virtual int getHoverableCount()
Get the number of elements that can be hovered over in this element.
Definition: CSMAPI_types.h:4718
virtual int getSelectableCount()
Get the selectable number of elements in this element.
Definition: CSMAPI_types.h:4713
virtual void render()
Render this element.
virtual FontObject * getFont()
Get this element's font.
Definition: CSMAPI_types.h:4730
virtual bool isHoverable()
Check hoverability status.
virtual int processKeys()
Process key input for this element.
~ButtonInfo()
Default deconstructor.
virtual void setFont(FontObject *pFont)
Set this element's font.
Definition: CSMAPI_types.h:4725
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:4683
OnButtonPressedFunc OnClicked
On press callback.
Definition: CSMAPI_types.h:4662
virtual bool isSelected()
Check selection status.
Networking client.
Definition: CaveNet_ExportedTypes.h:1825
A networking player.
Definition: CaveNet_ExportedTypes.h:3560
Definition: CaveNet_ExportedTypes.h:674
Custom draw GUI element.
Definition: CSMAPI_types.h:6131
virtual void setSelected(int value)
Set this GUI element as selected or not.
virtual bool isHoverable()
Check hoverability status.
virtual bool isHovered()
Check hover status.
~CaveStoryDialogBoxInfo()
Default deconstructor.
virtual void setHovered(int value)
Set this GUI element as hovered over or not.
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:6155
virtual void calculate()
Re-calculate this element's data.
CaveStoryDialogBoxInfo()
Default constructor.
virtual bool isSelected()
Check selection status.
virtual GUI_RECT getContentArea(int iMargin=0)
Get the content area for this object.
virtual int process(GUI_POINT mouse)
Process mouse input for this element.
virtual void render()
Render this element.
Draw centered text.
Definition: CSMAPI_types.h:2965
bool mCenterHorizontal
Vertical center align.
Definition: CSMAPI_types.h:3020
unsigned int mTextColor_RGB
Text color RGB.
Definition: CSMAPI_types.h:2971
virtual int process(GUI_POINT mouse)
Process mouse input for this element.
bool mCenterVertical
Vertical center align.
Definition: CSMAPI_types.h:3016
virtual bool isSelected()
Check selection status.
FontObject * mFont
Font for this element.
Definition: CSMAPI_types.h:2976
void getLineText(int index, char *buffer, int buffer_len)
Fetch line text.
int getLineCount()
Get new line count.
GUI_POINT mMinimumSize
Minimum size for this point.
Definition: CSMAPI_types.h:2981
GUI_POINT mTextPoint
Text point for this element.
Definition: CSMAPI_types.h:2993
virtual void render()
Render this element.
virtual void setHovered(int value)
Set this GUI element as hovered over or not.
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:3034
virtual void setFont(FontObject *pFont)
Set this element's font.
Definition: CSMAPI_types.h:3065
int getLineLength(int index)
Check line length.
GUI_POINT mTextSize
The size of the text.
Definition: CSMAPI_types.h:2998
FontObject * getFont()
Get this element's font.
Definition: CSMAPI_types.h:3070
virtual void calculate()
Re-calculate this element's data.
virtual bool isHoverable()
Check hoverability status.
virtual bool isHovered()
Check hover status.
const char * getText()
Get this object's text.
Definition: CSMAPI_types.h:3107
CenteredTextInfo()
Default constructor.
virtual void setSelected(int value)
Set this GUI element as selected or not.
int mNewLineCount
The list size of mNewLines.
Definition: CSMAPI_types.h:3012
GUI_COLOR mTextColor
The text color.
Definition: CSMAPI_types.h:3002
void setText(const char *text)
Set the text of this element.
GUI_POINT getLineSize(int index)
Fetch line graphical size.
Show a toggleable checkbox.
Definition: CSMAPI_types.h:4286
virtual int process(GUI_POINT mouse)
Process mouse input for this element.
bool getValue()
Get the value of this checkbox.
virtual bool isSelected()
Check selection status.
virtual int processKeys()
Process key input for this element.
bool mIsDisabled
Disable.
Definition: CSMAPI_types.h:4310
~CheckBoxInfo()
Default deconstructor.
virtual void setHovered(int value)
Set this GUI element as hovered over or not.
bool mSmall
Use small sprite instead of the big one.
Definition: CSMAPI_types.h:4306
bool mValue
Whether this checkbox is enabled or not.
Definition: CSMAPI_types.h:4298
virtual void render()
Render this element.
int mRadioGroup
Radio group ID.
Definition: CSMAPI_types.h:4302
virtual bool isHovered()
Check hover status.
virtual void setSelected(int value)
Set this GUI element as selected or not.
virtual int getSelectableCount()
Get the selectable number of elements in this element.
Definition: CSMAPI_types.h:4357
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:4327
virtual void calculate()
Re-calculate this element's data.
void setValue(bool val)
Set the value of this checkbox.
virtual bool isHoverable()
Check hoverability status.
virtual int getHoverableCount()
Get the number of elements that can be hovered over in this element.
Definition: CSMAPI_types.h:4362
CheckBoxInfo()
Default constructor.
Several combined GUI elements to form a color picker.
Definition: CSMAPI_types.h:5053
virtual int getSelectableCount()
Get the selectable number of elements in this element.
int margin
Item margin.
Definition: CSMAPI_types.h:5138
virtual bool isHovered()
Check hover status.
virtual GuiBase * getSelectable(int index)
Get a selectable sub-element.
virtual void setFont(FontObject *pFont)
Set this element's font.
virtual void render()
Render this element.
virtual void setSelected(int value)
Set this GUI element as selected or not.
GUI_COLOR color
The current color value.
Definition: CSMAPI_types.h:5134
GUI_POINT spriteSize
The sprite size to accomadate for when calling OnRenderSprite()
Definition: CSMAPI_types.h:5130
ColorPickerInfo()
Default constructor.
SliderIntInfo mSlider_Blue
Blue slider.
Definition: CSMAPI_types.h:5105
void updateColor(bool callback=true)
Update current color.
virtual bool isSelected()
Check selection status.
virtual FontObject * getFont()
Get the font for this GUI element.
Definition: CSMAPI_types.h:5223
SliderIntInfo mSlider_Green
Green slider.
Definition: CSMAPI_types.h:5101
virtual int getHoverableCount()
Get the number of elements that can be hovered over in this element.
virtual GuiBase * getHoverable(int index)
Get a hoverable sub-element.
virtual void calculate()
Re-calculate this element's data.
virtual void importantRender()
Render the important bits of this element.
~ColorPickerInfo()
Default deconstructor.
virtual void setHovered(int value)
Set this GUI element as hovered over or not.
virtual int process(GUI_POINT mouse)
Process mouse input for this element.
TextInputInfo mEdit_Red
Red value textbox.
Definition: CSMAPI_types.h:5109
SliderIntInfo mSlider_Red
Red slider.
Definition: CSMAPI_types.h:5097
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:5155
virtual bool isHoverable()
Check hoverability status.
TextInputInfo mEdit_Green
Green value textbox.
Definition: CSMAPI_types.h:5113
TextInputInfo mEdit_Blue
Blue value textbox.
Definition: CSMAPI_types.h:5117
Custom draw GUI element.
Definition: CSMAPI_types.h:5914
virtual void calculate()
Re-calculate this element's data.
virtual bool isHovered()
Check hover status.
virtual void render()
Render this element.
virtual bool isSelected()
Check selection status.
virtual void setSelected(int value)
Set this GUI element as selected or not.
~CustomDrawInfo()
Default deconstructor.
virtual int process(GUI_POINT mouse)
Process mouse input for this element.
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:5939
CustomDrawInfo()
Default constructor.
virtual void setHovered(int value)
Set this GUI element as hovered over or not.
virtual bool isHoverable()
Check hoverability status.
Show a clickable button.
Definition: CSMAPI_types.h:5251
virtual int processKeys()
Process key input for this element.
void setText(const char *pValue)
Set this element's text.
OnWindowDraggedFunc OnResizeStart
On resize start callback.
Definition: CSMAPI_types.h:5369
GUI_RECT valid_drag_rect
The valid rect that this window can be dragged to.
Definition: CSMAPI_types.h:5433
OnWindowDraggedFunc OnDragStart
On drag start callback.
Definition: CSMAPI_types.h:5361
GUI_RECT getContentArea()
Get the area that content goes in.
bool isCollapsed()
Check to see if this window is collapsed.
Definition: CSMAPI_types.h:5455
GUI_RECT content_rect
The rect at which the window's contents should be at.
Definition: CSMAPI_types.h:5417
bool can_resize_width
Whether the width of this window can be resized.
Definition: CSMAPI_types.h:5405
OnWindowDraggedFunc OnResizeEnd
On resize end callback.
Definition: CSMAPI_types.h:5377
bool can_resize_height
Whether the height of this window can be resized.
Definition: CSMAPI_types.h:5409
GUI_POINT collapse_position
The point at which the window is collapsed at.
Definition: CSMAPI_types.h:5421
OnWindowDraggedFunc OnResizing
On resizing callback.
Definition: CSMAPI_types.h:5373
bool show_button_close
Show the close button.
Definition: CSMAPI_types.h:5393
void setCollapsed(bool bValue)
Set whether this window is collapsed.
Definition: CSMAPI_types.h:5460
OnWindowCollapsedFunc OnCollapse
On collapse callback.
Definition: CSMAPI_types.h:5381
virtual void render()
Render this element.
virtual bool isHoverable()
Check hoverability status.
virtual int process(GUI_POINT mouse)
Process mouse input for this element.
~DraggableWindowInfo()
Default deconstructor.
OnWindowClosedFunc OnClose
On close callback.
Definition: CSMAPI_types.h:5389
virtual void setSelected(int value)
Set this GUI element as selected or not.
GUI_POINT collapse_normal
The normal coordinates at which the element will move when positioning relative to collapse_position.
Definition: CSMAPI_types.h:5425
void setContentSize(GUI_POINT pSize)
Set the content size of this window.
OnWindowExpandedFunc OnExpand
On expand callback.
Definition: CSMAPI_types.h:5385
virtual void setFont(FontObject *pFont)
Set this element's font.
GUI_RECT getStaticAreaSize()
Get the size of the static space that does not change.
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:5450
void calculateTop()
Calculate the top.
bool show_button_minmax
Show the minmax button.
Definition: CSMAPI_types.h:5397
virtual FontObject * getFont()
Get the font for this GUI element.
Definition: CSMAPI_types.h:5524
int margin
The text margin for this object.
Definition: CSMAPI_types.h:5353
virtual void setHovered(int value)
Set this GUI element as hovered over or not.
int resize_hotspot_size
The resize hotspot size.
Definition: CSMAPI_types.h:5413
virtual bool isSelected()
Check selection status.
DraggableWindowInfo()
Default constructor.
virtual bool isHovered()
Check hover status.
OnWindowDraggedFunc OnDragEnd
On drag end callback.
Definition: CSMAPI_types.h:5365
bool is_draggable
Whether this window is draggable or not.
Definition: CSMAPI_types.h:5401
virtual int getSelectableCount()
Get the selectable number of elements in this element.
Definition: CSMAPI_types.h:5495
virtual void calculate()
Re-calculate this element's data.
OnWindowDraggedFunc OnDragged
On drag callback.
Definition: CSMAPI_types.h:5357
virtual int getHoverableCount()
Get the number of elements that can be hovered over in this element.
Definition: CSMAPI_types.h:5500
GUI_POINT min_content_size
The minimum content size this window can have.
Definition: CSMAPI_types.h:5429
Custom draw GUI element.
Definition: CSMAPI_types.h:5988
~DrawBitmapInfo()
Default deconstructor.
bool LoadImage(const char *pImage)
Load an image using a file path.
void SetImageSourceRect(GUI_RECT *pSrcRect)
Set the image's source rect.
virtual bool isHovered()
Check hover status.
virtual void setHovered(int value)
Set this GUI element as hovered over or not.
GUI_RECT m_SrcRect
The source rect that we will be using to draw the image with.
Definition: CSMAPI_types.h:6004
Surface_Ids m_SurfID
The loaded surface's ID.
Definition: CSMAPI_types.h:5999
virtual void setSelected(int value)
Set this GUI element as selected or not.
Surface_Ids GetSurfaceID()
Get the image's surface ID.
Definition: CSMAPI_types.h:6070
void SetColorMod(GUI_COLOR *pColor)
Set the modulation color.
DrawBitmapInfo()
Default constructor.
GUI_COLOR GetColorMod()
Get the modulation color.
Definition: CSMAPI_types.h:6075
virtual bool isHoverable()
Check hoverability status.
virtual void calculate()
Re-calculate this element's data.
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:6082
GUI_RECT GetImageSourceRect()
Get the image's source rect.
Definition: CSMAPI_types.h:6065
virtual void render()
Render this element.
virtual int process(GUI_POINT mouse)
Process mouse input for this element.
bool m_IsSurfAllocated
If this is 'true', then we need to unload m_SrcSurfID when this object gets deleted.
Definition: CSMAPI_types.h:5994
bool m_Stretch
Stretch the image along with this object's rect.
Definition: CSMAPI_types.h:6018
bool LoadImage(Surface_Ids eSurfId)
Load an image using a surface ID.
void Cleanup()
Cleanup this DrawBitmapInfo object.
virtual bool isSelected()
Check selection status.
Show a dropdown box.
Definition: CSMAPI_types.h:4759
virtual bool getIsOpen()
Get whether this dropdown box is opened or not.
virtual void setSelected(int value)
Set this GUI element as selected or not.
virtual void render()
Render this element.
virtual void setHovered(int value)
Set this GUI element as hovered over or not.
virtual int process(GUI_POINT mouse)
Process mouse input for this element.
int mItemMargin
Item margin.
Definition: CSMAPI_types.h:4898
GUI_RECT containing_rect
Containing rect.
Definition: CSMAPI_types.h:4870
virtual bool isSelected()
Check selection status.
virtual bool isHoverable()
Check hoverability status.
const char * getItemText(int index)
Get item text by index.
int mSelected
Whether the dropbox is expanded or not.
Definition: CSMAPI_types.h:4902
DropdownBoxInfo()
Default constructor.
~DropdownBoxInfo()
Default deconstructor.
virtual FontObject * getFont()
Get the font for this GUI element.
Definition: CSMAPI_types.h:4936
void clearItems()
Clear all items.
bool mDisabled
Whether this element is disabled or not.
Definition: CSMAPI_types.h:4890
virtual void setFont(FontObject *pFont)
Set this element's font.
GUI_COLOR mText_ListSelected
The color of the text when the element is selected in the list.
Definition: CSMAPI_types.h:4882
virtual bool isHovered()
Check hover status.
ScrollAreaInfo * getScroll()
Get the scroll object.
virtual void importantRender()
Render the important bits of this element.
int getCount()
Get number of selectable options.
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:4919
GUI_COLOR mText_Normal
The color of the text when the element is normal.
Definition: CSMAPI_types.h:4878
GUI_COLOR mText_NotSelected
The color of the text when the element is not selected.
Definition: CSMAPI_types.h:4886
static int GetDropdownBoxHeight(FontObject *pFont=NULL, int iTextMargin=-1)
Get the height of a normal dropdown box.
void setSelectedItem(int iItemId)
Set the selected item.
virtual int processKeys()
Process key input for this element.
GUI_COLOR mText_Disabled
The color of the text when the element is disabled.
Definition: CSMAPI_types.h:4874
void addItem(const char *text)
Add an item to the list.
int mTextMargin
Text margin.
Definition: CSMAPI_types.h:4894
virtual void calculate()
Re-calculate this element's data.
virtual int getSelectableCount()
Get the selectable number of elements in this element.
Definition: CSMAPI_types.h:5003
virtual void setIsOpen(bool bIsOpen)
Set whether this dropdown box is open or not.
virtual int getHoverableCount()
Get the number of elements that can be hovered over in this element.
Definition: CSMAPI_types.h:5008
An external window to render stuff on.
Definition: ExternalWindow.h:151
A handle for fonts.
Definition: CSMAPI_types.h:357
const char * getName() const
Returns the font's name, if it exists.
Definition: CSMAPI_types.h:469
bool isValid() const
Check to see if this handle is valid.
Definition: CSMAPI_types.h:488
Manages fonts.
Definition: CSMAPI_types.h:255
static void UnloadFont(FontObject *fo)
Unload a font object.
static void ReadyAllFontsForWindowResize()
Ready all loaded font objects for a window resizing.
int mUserCount
How many users this font has If 0, it will be freed.
Definition: CSMAPI_types.h:283
static void LinkFontToTexture(FontObject *fo, VideoTexture *pTexture)
Link a font to a texture.
static FontObject * LoadFont(const char *font_name, int font_width, int font_height, bool bDoNotUse=false, VideoTexture *pTexture=NULL, FontManager **resultingManager=NULL, unsigned int iMagnification=0xFFFFFFFF)
Load a font by name & size.
char mFontName[127]
The name of this font.
Definition: CSMAPI_types.h:274
static void DestroyRendererTextures(void *pTarget)
Destroy all textures related to the given renderer.
static void ResizeAllFonts()
Resize all fonts following a magnification change.
int mWidth
Font width.
Definition: CSMAPI_types.h:287
static FontManager * GetManagerForFont(FontObject *fo)
Fetch the font manager for a font object.
static void UseFont(FontObject *pFont)
Increment the use count for a font.
FontObject * mFont
The font object tied to this manager.
Definition: CSMAPI_types.h:278
int mHeight
Font height.
Definition: CSMAPI_types.h:291
Show a windows-style group box.
Definition: CSMAPI_types.h:5557
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:5619
virtual bool isSelected()
Check selection status.
Definition: CSMAPI_types.h:5610
~GroupBoxInfo()
Default deconstructor.
virtual void setFont(FontObject *pFont)
Set this element's font.
Definition: CSMAPI_types.h:5629
GroupBoxInfo()
Default constructor.
virtual void calculate()
Re-calculate this element's data.
virtual void setSelected(int value)
Set this GUI element as selected or not.
Definition: CSMAPI_types.h:5608
virtual void render()
Render this element.
virtual int getSelectableCount()
Get the selectable number of elements in this element.
Definition: CSMAPI_types.h:5599
virtual int getHoverableCount()
Get the number of elements that can be hovered over in this element.
Definition: CSMAPI_types.h:5604
virtual bool isHoverable()
Check hoverability status.
virtual bool isHovered()
Check hover status.
Definition: CSMAPI_types.h:5611
void fitRect(GUI_RECT content_rect, int margin=0)
Resize this element to fit the given content rect.
virtual FontObject * getFont()
Get the font for this GUI element.
Definition: CSMAPI_types.h:5634
virtual void setHovered(int value)
Set this GUI element as hovered over or not.
Definition: CSMAPI_types.h:5609
virtual int process(GUI_POINT)
Process mouse input for this element.
Definition: CSMAPI_types.h:5612
The base class for GUI elements.
Definition: CSMAPI_types.h:2717
virtual FontObject * getFont()
Get the font for this GUI element.
Definition: CSMAPI_types.h:2917
virtual GuiBase * getHoverable(int index)
Get a hoverable sub-element.
Definition: CSMAPI_types.h:2893
virtual bool SelectOnMouseUp()
Select on mouse up.
Definition: CSMAPI_types.h:2905
virtual bool isHovered()=0
Check hover status.
bool has_special_hotspot_rect
Has special hotspot rect; If true, 'process' will be called everytime the mouse is inside of 'hotspot...
Definition: CSMAPI_types.h:2801
virtual void importantRender()
Render the important bits of this element.
Definition: CSMAPI_types.h:2946
unsigned int customMagnification
The magnification to display this element at.
Definition: CSMAPI_types.h:2783
virtual int processKeys()
Process key input for this element.
Definition: CSMAPI_types.h:2941
GUI_RECT hotspot_rect
The special hotspot rect.
Definition: CSMAPI_types.h:2797
bool has_special_mouse_processing
Has special mouse processing.
Definition: CSMAPI_types.h:2793
virtual void calculate()=0
Re-calculate this element's data.
virtual bool isHoverable()=0
Check hoverability status.
virtual GuiBase * getSelectable(int index)
Get a selectable sub-element.
Definition: CSMAPI_types.h:2900
virtual int getHoverableCount()
Get the number of elements that can be hovered over in this element.
Definition: CSMAPI_types.h:2886
OnHoverChangeCallbackFunc OnHoverChange
Called in specific GuiBase children classes to indicate that the GUI element is being hovered over.
Definition: CSMAPI_types.h:2789
virtual int getSelectableCount()
Get the selectable number of elements in this element.
Definition: CSMAPI_types.h:2881
virtual ~GuiBase()
Default deconstructor.
Definition: CSMAPI_types.h:2825
GuiBase()
Default constructor.
Definition: CSMAPI_types.h:2807
OnValidateChangeCallbackFunc OnValidateChange
Called in specific GuiBase children classes to indicate that a value has been changed.
Definition: CSMAPI_types.h:2767
virtual void setSelected(int value)=0
Set this GUI element as selected or not.
void * userData2
Custom user data.
Definition: CSMAPI_types.h:2779
OnValueChangeCallbackFunc OnValueChange
Called in specific GuiBase children classes to indicate that a value has been changed.
Definition: CSMAPI_types.h:2763
virtual void setFont(FontObject *pFont)
Set the font for this GUI element.
Definition: CSMAPI_types.h:2912
virtual void setHovered(int value)=0
Set this GUI element as hovered over or not.
void * userData
Custom user data.
Definition: CSMAPI_types.h:2775
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:2845
GUI_RECT rect
The display rect this GUI element will use.
Definition: CSMAPI_types.h:2771
ProcessReturnType
Return flags for GuiBase::process and GuiBase::processKeys.
Definition: CSMAPI_types.h:2732
void Unlink()
Unlink ourselves from the global GUI element linkage.
virtual int process(GUI_POINT mouse)=0
Process mouse input for this element.
virtual bool isSelected()=0
Check selection status.
virtual void render()=0
Render this element.
void Link()
Link ourselves to the global GUI element linkage.
Show a text input box.
Definition: CSMAPI_types.h:4047
virtual int getHoverableCount()
Get the number of elements that can be hovered over in this element.
Definition: CSMAPI_types.h:4215
virtual bool isHoverable()
Check hoverability status.
ValidateKeyInputCallbackFunc ValidateInput
Called when text is finalized (by pressing enter, cancel or clicking outside of the input box).
Definition: CSMAPI_types.h:4151
void setValue(int iScancode, bool bUseCallback=true)
Set the value of the keyinput.
void updateDisplayText()
Update the display text for this control.
virtual void setFont(FontObject *pFont)
Set the font for this element.
virtual bool SelectOnMouseUp()
Select on mouse up.
Definition: CSMAPI_types.h:4220
CANCEL_KEY_TYPE mCancelKey
Which cancel key was pressed to lose focus.
Definition: CSMAPI_types.h:4155
virtual int getSelectableCount()
Get the selectable number of elements in this element.
Definition: CSMAPI_types.h:4210
int * m_PtrKeyValue
Pointer key value.
Definition: CSMAPI_types.h:4147
KeyInputInfo()
Default constructor.
virtual bool isSelected()
Check selection status.
virtual int processKeys()
Process key input for this element.
int getValue()
Get the value of the keyinputinfo.
virtual bool isHovered()
Check hover status.
CANCEL_KEY_TYPE
Cancel key types.
Definition: CSMAPI_types.h:4053
@ ESCAPE
Escape button.
Definition: CSMAPI_types.h:4059
@ ENTER
Enter button todo: Make pressing enter call a callback.
Definition: CSMAPI_types.h:4056
~KeyInputInfo()
Default deconstructor.
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:4180
virtual int process(GUI_POINT mouse)
Process mouse input for this element.
int margin
Text margin.
Definition: CSMAPI_types.h:4163
void stopInput(bool bSaveValue=true)
Stop inputting text.
virtual FontObject * getFont()
Get the font for this GUI element.
Definition: CSMAPI_types.h:4244
virtual void setHovered(int value)
Set this GUI element as hovered over or not.
void startInput()
Set this inputbox as 'focused', and start inputting text.
virtual void calculate()
Re-calculate this element's data.
bool is_disabled
Is disabled.
Definition: CSMAPI_types.h:4159
virtual void render()
Render this element.
virtual void setSelected(int value)
Set this GUI element as selected or not.
Text.
Definition: CSMAPI_types.h:3131
virtual void setSelected(int value)
Set this GUI element as selected or not.
int mReJustify
Whether to rejustify on next calulation or not.
Definition: CSMAPI_types.h:3157
virtual void setFont(FontObject *pFont)
Set this element's font.
Definition: CSMAPI_types.h:3220
virtual bool isHoverable()
Check hoverability status.
virtual void setHovered(int value)
Set this GUI element as hovered over or not.
virtual void calculate()
Re-calculate this element's data.
virtual bool isHovered()
Check hover status.
void setText(const char *text)
Set the text of this element.
unsigned int mTextColor_RGB
Text color RGB.
Definition: CSMAPI_types.h:3137
virtual void render()
Render this element.
bool mJustifyRight
Whether to justify this text to the right or not.
Definition: CSMAPI_types.h:3175
virtual FontObject * getFont()
Get the font for this GUI element.
Definition: CSMAPI_types.h:3225
GUI_COLOR mOutlineColor
The outline color.
Definition: CSMAPI_types.h:3167
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:3189
virtual int process(GUI_POINT mouse)
Process mouse input for this element.
unsigned int mOutlineColor_RGB
Text color RGB.
Definition: CSMAPI_types.h:3142
int mOutlineWidth
The outline width.
Definition: CSMAPI_types.h:3171
FontObject * mFont
Font for this element.
Definition: CSMAPI_types.h:3147
virtual bool isSelected()
Check selection status.
const char * getText()
Get the text of this element.
Definition: CSMAPI_types.h:3236
GUI_COLOR mTextColor
The text color.
Definition: CSMAPI_types.h:3163
LabelInfo()
Default constructor.
A map zone to be used for network optimization.
Definition: CSMAPI_types.h:6903
void DeleteAllBoss()
Delete all bosses that are inside of this zone.
bool HasBoss(NPCHAR *npc)
Check if this zone has a boss npc in it.
MAP_ZONE()
Constructor.
void PutNpChar(int frame_x, int frame_y)
Draw npcs.
bool HasNpChar(NPCHAR *npc)
Check if this zone has an npc in it.
int id
The ID for this zone.
Definition: CSMAPI_types.h:6907
void ActBoss()
Think tick all npcs.
int used
'Use' count for this zone
Definition: CSMAPI_types.h:6932
int soft_npc_count
deprectated
Definition: CSMAPI_types.h:6936
void RemoveBoss(NPCHAR *npc)
Remove a boss from the list.
void ActNpChar()
Think tick all npcs.
void AddNpChar(NPCHAR *npc)
Add an NPCHAR to the list.
void AddBoss(NPCHAR *npc)
Add a boss to the list.
void PutBoss(int frame_x, int frame_y)
Draw npcs.
~MAP_ZONE()
Deconstructor.
void Free()
Free all memory associated with this object.
void RemoveNpChar(NPCHAR *npc)
Remove an NPCHAR from the list.
void Init()
Initialize this object.
void DeleteAllNpChar()
Delete all NPCs that are inside of this zone.
A scroll area.
Definition: CSMAPI_types.h:3405
void fitIntoContent(GUI_POINT p)
Fit the point into the content.
bool isScrolling()
Check if this element is being scrolled.
Definition: CSMAPI_types.h:3609
virtual void setSelected(int value)
Set this GUI element as selected or not.
void scrollTo(GUI_RECT r)
Scroll to a rect.
void scrollByPixelAmount(GUI_POINT p)
Scroll by pixel amount.
HoverType hoverScrollY
The current hover state for the vertical bar.
Definition: CSMAPI_types.h:3587
int scrollBarHandleMinSize
Scroll bar handle minimum size (width for horizontal scrollbar, width for vertical scrollbar)
Definition: CSMAPI_types.h:3579
GUI_POINT getOffset()
Get the scroll offsets.
bool drawBorder
Draw scroll border.
Definition: CSMAPI_types.h:3559
GUI_POINT mouseWheelScroll
Amount of scroll on mousewheel movement for both X and Y.
Definition: CSMAPI_types.h:3595
int scrollBarSize
The size of the scrollbar (height for the horizontal scrollbar, width for the vertical scrollbar)
Definition: CSMAPI_types.h:3571
virtual int process(GUI_POINT mouse)
Process mouse input for this element.
virtual bool isSelected()
Check selection status.
virtual bool isHoverable()
Check hoverability status.
ScrollState
State of scrolling.
Definition: CSMAPI_types.h:3477
@ SCROLL_X
User is scrolling the bottom (horizontal) scrollbar.
Definition: CSMAPI_types.h:3482
void fitIntoContent(GUI_RECT r)
Fit the rect into the content.
void begin()
Enforce a clip rect that accomodates the content area.
bool showScrollX
Show the horizontal scrollbar.
Definition: CSMAPI_types.h:3563
GUI_POINT contentSize
Size of the content area.
Definition: CSMAPI_types.h:3591
GUI_RECT getHorizontalScrollBar()
Calculate the rect for the horizontal scroll bar.
GUI_RECT getContentArea()
Calculate the content area for this scroll.
GUI_POINT_F scroll
Normalized scroll amounts (for both x and y)
Definition: CSMAPI_types.h:3551
ScrollAreaInfo()
Default constructor.
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:3619
virtual void calculate()
Re-calculate this element's data.
void end()
Clear the clip rect enforced by begin().
bool drawBackground
Draw scroll background.
Definition: CSMAPI_types.h:3555
virtual bool isHovered()
Check hover status.
int scrollBarHandleMargin
Scroll bar handle margin.
Definition: CSMAPI_types.h:3575
OnScrollCallbackFunc OnScroll
Called when this element's scroll amount changes.
Definition: CSMAPI_types.h:3547
bool showScrollY
Show the vertical scrollbar.
Definition: CSMAPI_types.h:3567
GUI_RECT getVerticalScrollBar()
Calculate the rect for the vertical scroll bar.
HoverType
Scroll hover type.
Definition: CSMAPI_types.h:3460
@ HOVER_BUTTON_1
Left / Up arrow button.
Definition: CSMAPI_types.h:3465
@ HOVER_HANDLE
Scroll handle.
Definition: CSMAPI_types.h:3468
virtual void setHovered(int value)
Set this GUI element as hovered over or not.
GUI_POINT getRelativeOffset()
Get the scroll offsets.
HoverType hoverScrollX
The current hover state for the horizontal bar.
Definition: CSMAPI_types.h:3583
virtual void render()
Render this element.
Text.
Definition: CSMAPI_types.h:3260
virtual void setFont(FontObject *pFont)
Set this element's font.
Definition: CSMAPI_types.h:3365
GUI_COLOR mColor_BG_Normal
The normal background color.
Definition: CSMAPI_types.h:3289
virtual bool SelectOnMouseUp()
Select on mouse up.
Definition: CSMAPI_types.h:3359
void setText(const char *text)
Set the text of this element.
FontObject * mFont
Font for this element.
Definition: CSMAPI_types.h:3266
GUI_COLOR mColor_BG_Hover
The hovered background color.
Definition: CSMAPI_types.h:3293
virtual void calculate()
Re-calculate this element's data.
bool mHovered
If this is being hovered over.
Definition: CSMAPI_types.h:3305
virtual int process(GUI_POINT mouse)
Process mouse input for this element.
GUI_COLOR mColor_Text_Normal
The text color.
Definition: CSMAPI_types.h:3277
virtual bool isHovered()
Check hover status.
GUI_COLOR mColor_Text_Hover
The text color when hovered over.
Definition: CSMAPI_types.h:3281
virtual int getHoverableCount()
Get the number of elements that can be hovered over in this element.
Definition: CSMAPI_types.h:3354
virtual int getSelectableCount()
Get the selectable number of elements in this element.
Definition: CSMAPI_types.h:3349
virtual void setHovered(int value)
Set this GUI element as hovered over or not.
virtual void render()
Render this element.
virtual bool isHoverable()
Check hoverability status.
virtual bool isSelected()
Check selection status.
GUI_COLOR mColor_Text_Selected
The text color when selected.
Definition: CSMAPI_types.h:3285
virtual void setSelected(int value)
Set this GUI element as selected or not.
virtual FontObject * getFont()
Get the font for this GUI element.
Definition: CSMAPI_types.h:3370
SelectableLabelInfo()
Default constructor.
const char * getText()
Get the text of this element.
Definition: CSMAPI_types.h:3381
bool mSelected
The type of selection we're dealing with.
Definition: CSMAPI_types.h:3301
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:3319
GUI_COLOR mColor_BG_Selected
The selected background color.
Definition: CSMAPI_types.h:3297
Text.
Definition: CSMAPI_types.h:6577
int GetSelectedEntry()
Retrieve the selected entry.
virtual bool isSelected()
Check selection status.
int mScrollY
The scroll Y offset.
Definition: CSMAPI_types.h:6630
bool mAllowRightClick
Allow right click selection.
Definition: CSMAPI_types.h:6684
void ClearAllEntries()
Clear all entries.
virtual int getSelectableCount()
Get the selectable number of elements in this element.
Definition: CSMAPI_types.h:6730
List< SEL_LIST_ENTRY * > mEntries
Stores all entries for this element.
Definition: CSMAPI_types.h:6622
GUI_POINT GetContentSze()
Get the entire content size.
int mScrollX
The scroll X offset.
Definition: CSMAPI_types.h:6626
virtual void calculate()
Re-calculate this element's data.
SEL_LIST_ENTRY * mShownLink
A link of shown entries.
Definition: CSMAPI_types.h:6646
virtual int process(GUI_POINT mouse)
Process mouse input for this element.
GUI_RECT GetEntryRectById(int iSelectedId, bool bUseScrolled=false)
Retrieve an entry's rect.
bool mDirty
Our 'dirty' variable.
Definition: CSMAPI_types.h:6642
virtual int getHoverableCount()
Get the number of elements that can be hovered over in this element.
Definition: CSMAPI_types.h:6735
virtual bool isHoverable()
Check hoverability status.
GUI_COLOR mColor_BG_Hover
The hovered background color.
Definition: CSMAPI_types.h:6672
virtual bool isHovered()
Check hover status.
GUI_POINT mContentSize
Content size.
Definition: CSMAPI_types.h:6650
virtual bool SelectOnMouseUp()
Select on mouse up.
Definition: CSMAPI_types.h:6740
int mMargin
Entry margin.
Definition: CSMAPI_types.h:6680
virtual void setSelected(int value)
Set this GUI element as selected or not.
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:6700
void SetScrollOffset(int iOffsetX, int iOffsetY)
Set the scroll offset for all entries.
GUI_COLOR mColor_Text_Normal
The text color.
Definition: CSMAPI_types.h:6656
virtual void render()
Render this element.
bool AddEntry(int iSelectionId, const char *pText)
Add an entry.
virtual void setFont(FontObject *pFont)
Set this element's font.
Definition: CSMAPI_types.h:6746
~SelectableListInfo()
Default deconstructor.
int mSelected
The selected entry.
Definition: CSMAPI_types.h:6638
GUI_COLOR mColor_Text_Selected
The text color when selected.
Definition: CSMAPI_types.h:6664
int mHovered
The highlighted entry.
Definition: CSMAPI_types.h:6634
GUI_COLOR mColor_BG_Normal
The normal background color.
Definition: CSMAPI_types.h:6668
GUI_COLOR mColor_Text_Hover
The text color when hovered over.
Definition: CSMAPI_types.h:6660
FontObject * mFont
Font for this element.
Definition: CSMAPI_types.h:6618
GUI_COLOR mColor_BG_Selected
The selected background color.
Definition: CSMAPI_types.h:6676
SelectableListInfo()
Default constructor.
virtual void setHovered(int value)
Set this GUI element as hovered over or not.
Show a number slider.
Definition: CSMAPI_types.h:4404
int getValue()
Get the value.
virtual int getSelectableCount()
Get the selectable number of elements in this element.
Definition: CSMAPI_types.h:4532
virtual bool SelectOnMouseUp()
Select on mouse up.
Definition: CSMAPI_types.h:4542
virtual int processKeys()
Process key input for this element.
virtual void calculate()
Re-calculate this element's data.
virtual void setSelected(int value)
Set this GUI element as selected or not.
bool mLiveUpdate
Update the value when being dragged.
Definition: CSMAPI_types.h:4485
virtual void importantRender()
Render the important bits of this element.
float mValue
The selected number.
Definition: CSMAPI_types.h:4469
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:4502
virtual void setHovered(int value)
Set this GUI element as hovered over or not.
virtual int process(GUI_POINT mouse)
Process mouse input for this element.
SliderIntInfo()
Default constructor.
virtual bool isHoverable()
Check hoverability status.
virtual void render()
Render this element.
~SliderIntInfo()
Default deconstructor.
bool mIntOnly
Round mValue to nearest value on value change.
Definition: CSMAPI_types.h:4481
void setValue(int val)
Set the value.
virtual void setFont(FontObject *pFont)
Set this element's font.
Definition: CSMAPI_types.h:4560
virtual bool isSelected()
Check selection status.
virtual FontObject * getFont()
Get the font for this GUI element.
Definition: CSMAPI_types.h:4565
float mMin
The minimum value.
Definition: CSMAPI_types.h:4477
float mMax
The maximum value.
Definition: CSMAPI_types.h:4473
virtual bool isHovered()
Check hover status.
virtual int getHoverableCount()
Get the number of elements that can be hovered over in this element.
Definition: CSMAPI_types.h:4537
Show a dropdown box.
Definition: CSMAPI_types.h:6307
virtual bool isSelected()
Check selection status.
unsigned long background
Background color.
Definition: CSMAPI_types.h:6406
virtual void importantRender()
Render the important bits of this element.
int mItemMargin
Item margin.
Definition: CSMAPI_types.h:6411
void ClearItems()
Clear all items.
SystemMenuInfo()
Default constructor.
~SystemMenuInfo()
Default deconstructor.
void closeMenu()
Close this menu.
int processShortcuts()
Process shortcuts.
virtual void calculate()
Re-calculate this element's data.
virtual void setSelected(int value)
Set this GUI element as selected or not.
virtual int getHoverableCount()
Get the number of elements that can be hovered over in this element.
Definition: CSMAPI_types.h:6521
void position_menu_items(SystemMenuItem *pItem)
Position menu items.
virtual int processKeys()
Process key input for this element.
virtual bool isHoverable()
Check hoverability status.
SystemMenuItem * GetItemById(int iItemId)
Get a menu item by its ID.
SystemMenuItem * AddItem(int iItemId, const char *pText, SystemMenuItem *pParent=NULL, Input::KeyShortcut *pShortcut=NULL)
Add an item to the list.
void DumpItems()
Dump items.
SystemMenuItem * GetItemByText(const char *pText)
Get a menu item by text.
void setFont(FontObject *pFont)
Set this element's font.
Definition: CSMAPI_types.h:6441
int GetItemCount()
Gets the total amount of items in this menu.
SystemMenuItem * GetItemByIndex(int iIndex)
Get a menu item by its index number.
SystemMenuItem * AllocateItem()
Allocate a new item.
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:6436
virtual void render()
Render this element.
virtual int getSelectableCount()
Get the selectable number of elements in this element.
Definition: CSMAPI_types.h:6516
unsigned long text_normal
Normal text color.
Definition: CSMAPI_types.h:6394
virtual int process(GUI_POINT mouse)
Process mouse input for this element.
unsigned long submenu_itembg_selected
Item background's color when selected.
Definition: CSMAPI_types.h:6402
unsigned long submenu_itembg_hovered
Item background's color when hovered over.
Definition: CSMAPI_types.h:6398
virtual void setHovered(int value)
Set this GUI element as hovered over or not.
virtual bool isHovered()
Check hover status.
Show a tab selector.
Definition: CSMAPI_types.h:5651
virtual int getHoverableCount()
Get the number of elements that can be hovered over in this element.
bool getHoveredOverCloseButton()
Get whether we've hovered over the close button.
Definition: CSMAPI_types.h:5835
OnTabSelectedFunc OnTabSelectCallback
The 'on tab selection' callback.
Definition: CSMAPI_types.h:5754
virtual void setFont(FontObject *pFont)
Set this element's font.
Definition: CSMAPI_types.h:5796
virtual void setHovered(int value)
Set this GUI element as hovered over or not.
void addTab(const char *pTabText, bool bCanBeClosed=false)
Add an item to the list.
virtual int processKeys()
Process key input for this element.
void clearTabs()
Clear all items.
int mSelectedTab
The selected tab.
Definition: CSMAPI_types.h:5762
virtual bool isHovered()
Check hover status.
virtual int getSelectableCount()
Get the selectable number of elements in this element.
~TabBookInfo()
Default deconstructor.
virtual void render()
Render this element.
TAB * getTab(int tab)
Get a tab by index.
TabBookInfo()
Default constructor.
OnTabCloseFunc OnTabCloseCallback
The 'on tab closed' callback.
Definition: CSMAPI_types.h:5758
GUI_RECT getDrawRect()
Get the draw offset for this control.
Definition: CSMAPI_types.h:5880
int getTabCount()
Get number of selectable options.
virtual int process(GUI_POINT mouse)
Process mouse input for this element.
virtual FontObject * getFont()
Get the font for this GUI element.
Definition: CSMAPI_types.h:5801
void setHoveredOverCloseButton(bool bValue)
Set whether we've hovered over the close button.
Definition: CSMAPI_types.h:5830
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:5791
bool mDrawBorder
Draw the border color.
Definition: CSMAPI_types.h:5770
virtual bool isSelected()
Check selection status.
void setCloseHovered(int value)
Set this GUI element as hovered over or not.
virtual void calculate()
Re-calculate this element's data.
int mMargin
Text margin.
Definition: CSMAPI_types.h:5766
GUI_RECT mTabContentRect
Content Rect.
Definition: CSMAPI_types.h:5750
virtual bool isHoverable()
Check hoverability status.
bool mDrawFill
Draw the fill color.
Definition: CSMAPI_types.h:5774
virtual void setSelected(int value)
Set this GUI element as selected or not.
Show a text input box.
Definition: CSMAPI_types.h:3733
virtual bool SelectOnMouseUp()
Select on mouse up.
Definition: CSMAPI_types.h:3979
virtual void setSelected(int value)
Set this GUI element as selected or not.
virtual bool isHovered()
Check hover status.
virtual int getSelectableCount()
Get the selectable number of elements in this element.
Definition: CSMAPI_types.h:3969
virtual void setFont(FontObject *pFont)
Set the font for this element.
void stopInput()
Stop inputting text.
const char * getValue()
Get the value of the inputbox.
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:3939
int sel_start
Selection start.
Definition: CSMAPI_types.h:3892
virtual int process(GUI_POINT mouse)
Process mouse input for this element.
void resizeTextSize()
Resize the text size.
CANCEL_KEY_TYPE mCancelKey
Which cancel key was pressed to lose focus.
Definition: CSMAPI_types.h:3884
int sel_end
Selection end.
Definition: CSMAPI_types.h:3896
ValidateInputCallbackFunc ValidateInput
Called when text is finalized (by pressing enter, cancel or clicking outside of the input box).
Definition: CSMAPI_types.h:3880
~TextInputInfo()
Default deconstructor.
void startInput(GUI_POINT mouse=GUI_POINT(0, 0))
Set this inputbox as 'focused', and start inputting text.
virtual bool isHoverable()
Check hoverability status.
CANCEL_KEY_TYPE
Cancel key types.
Definition: CSMAPI_types.h:3739
@ ENTER
Enter button todo: Make pressing enter call a callback.
Definition: CSMAPI_types.h:3742
@ ESCAPE
Escape button.
Definition: CSMAPI_types.h:3745
EInputBoxStyle mInputStyle
The style of this input box.
Definition: CSMAPI_types.h:3876
virtual int processKeys()
Process key input for this element.
int max_length
Maximum input length.
Definition: CSMAPI_types.h:3888
virtual bool isSelected()
Check selection status.
int margin
Text margin.
Definition: CSMAPI_types.h:3916
void setValue(const char *value, bool bUseCallback=true)
Set the value of the inputbox.
virtual void setHovered(int value)
Set this GUI element as hovered over or not.
bool is_selecting
Is selecting.
Definition: CSMAPI_types.h:3900
bool is_disabled
Is disabled.
Definition: CSMAPI_types.h:3908
virtual void calculate()
Re-calculate this element's data.
virtual void render()
Render this element.
virtual FontObject * getFont()
Get the font for this GUI element.
Definition: CSMAPI_types.h:4002
TextInputInfo()
Default constructor.
int getStringOffsetByMouse(GUI_POINT mouse)
Get input offset by mouse position.
bool callback_on_change
Call the OnValueChange callback on every keystroke.
Definition: CSMAPI_types.h:3912
virtual int getHoverableCount()
Get the number of elements that can be hovered over in this element.
Definition: CSMAPI_types.h:3974
bool is_password
Is password box.
Definition: CSMAPI_types.h:3904
An editable texture API.
Definition: VideoTexture.h:51
CAVESTORY_MOD_API void ChangeToFirstArms()
Switch to this client's first weapon.
CAVESTORY_MOD_API int CountArmsBullet(int iArmsCode, int iGhostId=-1)
Get the number of bullets matching the given description onscreen.
#define CAVESTORY_MOD_API
Exports / imports Cavestory Mod API functions & classes.
Definition: CSMAPI_begincode.h:31
CAVESTORY_MOD_API int CountBulletNum(int iBulletCode, int iGhostId=-1)
Get the number of bullets matching the given description onscreen.
#define NPC_MAX
How many npcs can be initialized at one time.
Definition: CSMAPI_defines.h:49
CAVESTORY_MOD_API BOOL UseArmsEnergy(long iNum, ARMS *pArmsTable, int iSelectedIdx)
Use some arms energy from the selected arm.
#define MAX(A, B)
Get the maximum value between two values.
Definition: CSMAPI_defines.h:69
#define MIN(A, B)
Get the minimum value between two values.
Definition: CSMAPI_defines.h:68
Definition: CSMAPI_types.h:2299
Weapon object.
Definition: CSMAPI_types.h:1264
int level
Level of the weapon.
Definition: CSMAPI_types.h:1271
int code
ID of this weapon.
Definition: CSMAPI_types.h:1267
int num
Current ammo.
Definition: CSMAPI_types.h:1283
int exp
Current experience points gathered.
Definition: CSMAPI_types.h:1275
int max_num
Maximum ammo.
Definition: CSMAPI_types.h:1279
Bullet object.
Definition: CSMAPI_types.h:1128
int code_arms
The ID of the weapon this bullet belongs to.
Definition: CSMAPI_types.h:1139
int ym
Y Motion (y velocity)
Definition: CSMAPI_types.h:1163
int blockYL
Wall collision height.
Definition: CSMAPI_types.h:1231
int life_count
Bullet range.
Definition: CSMAPI_types.h:1207
int flag
Bullet flags.
Definition: CSMAPI_types.h:1131
int tgt_x
Target X.
Definition: CSMAPI_types.h:1167
int act_wait
Act wait counter.
Definition: CSMAPI_types.h:1179
int enemyXL
Enemy collision width.
Definition: CSMAPI_types.h:1219
RECT rect
Sprite rect.
Definition: CSMAPI_types.h:1195
int x
X Position.
Definition: CSMAPI_types.h:1151
int ani_wait
Animation wait counter.
Definition: CSMAPI_types.h:1183
int team_id
This bullet's Team ID.
Definition: CSMAPI_types.h:1247
int code_bullet
The ID for this bullet.
Definition: CSMAPI_types.h:1135
int count1
Custom counter 1.
Definition: CSMAPI_types.h:1199
int bbits
Bullet bit-flags.
Definition: CSMAPI_types.h:1143
int ghostId
The client's Ghost ID who this belongs to.
Definition: CSMAPI_types.h:1239
int level
Level of the bullet.
Definition: CSMAPI_types.h:1243
int act_no
Act number.
Definition: CSMAPI_types.h:1175
int cond
This bullet's condition.
Definition: CSMAPI_types.h:1147
RECT view
View rect.
Definition: CSMAPI_types.h:1235
int enemyYL
Enemy collision height.
Definition: CSMAPI_types.h:1223
int ani_no
Animation number.
Definition: CSMAPI_types.h:1187
int xm
X Motion (x velocity)
Definition: CSMAPI_types.h:1159
unsigned char direct
Direction.
Definition: CSMAPI_types.h:1191
int blockXL
Wall collision width.
Definition: CSMAPI_types.h:1227
int life
Hits left before the bullet is deleted.
Definition: CSMAPI_types.h:1215
int damage
Bullet damage.
Definition: CSMAPI_types.h:1211
int tgt_y
Target Y.
Definition: CSMAPI_types.h:1171
int count2
Custom counter 2.
Definition: CSMAPI_types.h:1203
int y
Y Position.
Definition: CSMAPI_types.h:1155
Stores particle information.
Definition: CSMAPI_types.h:1298
int cond
The condition of the caret.
Definition: CSMAPI_types.h:1301
int act_wait
The act timer.
Definition: CSMAPI_types.h:1333
RECT rect
The rect to be drawn.
Definition: CSMAPI_types.h:1353
int code
The caret's ID.
Definition: CSMAPI_types.h:1305
int x
Subpixel X position.
Definition: CSMAPI_types.h:1313
int direct
The direction of the caret.
Definition: CSMAPI_types.h:1309
int ani_wait
The current animation timer.
Definition: CSMAPI_types.h:1341
int ym
Subpixel Y velocity.
Definition: CSMAPI_types.h:1325
int xm
Subpixel X velocity.
Definition: CSMAPI_types.h:1321
int act_no
The act number.
Definition: CSMAPI_types.h:1329
int view_top
Subpixel height of the caret (half-size)
Definition: CSMAPI_types.h:1349
int y
Subpixel Y position.
Definition: CSMAPI_types.h:1317
int view_left
Subpixel width of the caret (half-size)
Definition: CSMAPI_types.h:1345
int ani_no
The current animation number.
Definition: CSMAPI_types.h:1337
Point structure.
Definition: CSMAPI_types.h:155
int x
X Position.
Definition: CSMAPI_types.h:158
int y
Y Position.
Definition: CSMAPI_types.h:162
Quick Surface Access data.
Definition: CSMAPI_types.h:7349
GUI_RECT rect
The rect.
Definition: CSMAPI_types.h:7352
char * data
The data.
Definition: CSMAPI_types.h:7356
A client's ranked info.
Definition: CSMAPI_types.h:7257
unsigned int user_ident_hash[5]
The user ident hash this belongs to.
Definition: CSMAPI_types.h:7268
char * name
The name of the client.
Definition: CSMAPI_types.h:7260
CSM_ClientRanks rank
The client's rank.
Definition: CSMAPI_types.h:7272
CSM_RankedClientInfoType type
The type of comparison this info object uses.
Definition: CSMAPI_types.h:7264
Custom frame limit object.
Definition: CSMAPI_types.h:219
bool use
Whether to use or not.
Definition: CSMAPI_types.h:222
int y
Y limit.
Definition: CSMAPI_types.h:230
int x
X limit.
Definition: CSMAPI_types.h:226
int w
W limit.
Definition: CSMAPI_types.h:234
int h
H limit.
Definition: CSMAPI_types.h:238
Custom object structure.
Definition: CSMAPI_types.h:1396
int ym
Y Motion.
Definition: CSMAPI_types.h:1415
int tgt_y
Target Y.
Definition: CSMAPI_types.h:1423
RECT hit
Hitbox.
Definition: CSMAPI_types.h:1399
int x
X Position.
Definition: CSMAPI_types.h:1403
int tgt_x
Target X.
Definition: CSMAPI_types.h:1419
int xm
X Motion.
Definition: CSMAPI_types.h:1411
int y
Y Position.
Definition: CSMAPI_types.h:1407
int flag
Collision flags.
Definition: CSMAPI_types.h:1427
Animation information for CustomPlayerAnimation.
Definition: CSMAPI_types.h:1433
bool is_my_player
Whether or not this is the main character.
Definition: CSMAPI_types.h:1456
void * current_frame_ptr
Current animation frame.
Definition: CSMAPI_types.h:1452
int cycle_count
The number of animation cycles that have completed since this animation started playing.
Definition: CSMAPI_types.h:1460
unsigned int change_time
The last time that the player's animation changed.
Definition: CSMAPI_types.h:1464
int curr_anim
This player's current animation frame.
Definition: CSMAPI_types.h:1440
unsigned int frame_no
Current frame number.
Definition: CSMAPI_types.h:1448
int current_anim_type
The current animation type.
Definition: CSMAPI_types.h:1436
unsigned int delay_expire
The expire point of the current delay that must be passed in order for frame_no to continue ticking.
Definition: CSMAPI_types.h:1444
DynamicWindowMode config struct.
Definition: CSMAPI_types.h:7278
GUI_POINT min_size
The minimum size for this window.
Definition: CSMAPI_types.h:7325
bool allow_undo_redo
Allow undo redo for this mode.
Definition: CSMAPI_types.h:7321
bool use_window
Always draw the window.
Definition: CSMAPI_types.h:7309
int max_undo_steps
The maximum number of undo steps.
Definition: CSMAPI_types.h:7317
char window_title[260]
The title for this window.
Definition: CSMAPI_types.h:7281
bool follow_window_height
Follow base window's height.
Definition: CSMAPI_types.h:7343
bool use_external_window
Use a external window.
Definition: CSMAPI_types.h:7305
ExternalWindow * parent
The parent window.
Definition: CSMAPI_types.h:7301
bool init_content_size
Use the initial window size as the content size.
Definition: CSMAPI_types.h:7313
int margin
The margin for everything.
Definition: CSMAPI_types.h:7289
char window_guifile[260]
The pxgui file name for this mode.
Definition: CSMAPI_types.h:7285
bool follow_window_width
Follow base window's width.
Definition: CSMAPI_types.h:7339
int dirty_count
The number of times this dynamic window has been dirtied & subsequentially re-rendered.
Definition: CSMAPI_types.h:7329
bool can_close
Whether the user can close this window or not.
Definition: CSMAPI_types.h:7293
bool hide_on_close
Set the window to only hide when clicking on the 'X' button.
Definition: CSMAPI_types.h:7297
Dropdown box item struct.
Definition: CSMAPI_types.h:4791
GUI_POINT text_size
The size of this item's text.
Definition: CSMAPI_types.h:4806
GUI_RECT item_rect
This item's rect.
Definition: CSMAPI_types.h:4798
GUI_POINT text_point
The position for this item's text.
Definition: CSMAPI_types.h:4802
Camera struct.
Definition: CSMAPI_types.h:170
int quake
Quake counter.
Definition: CSMAPI_types.h:193
bool focus_center_x
Force the camera to focus on the horizontal center of the map.
Definition: CSMAPI_types.h:201
int x
X offset.
Definition: CSMAPI_types.h:173
int y
Y offset.
Definition: CSMAPI_types.h:177
int * tgt_x
Target X offset.
Definition: CSMAPI_types.h:181
int quake2
Quake 2 counter.
Definition: CSMAPI_types.h:197
int last_tile_x
The last tile X position.
Definition: CSMAPI_types.h:209
int last_tile_y
The last tile Y position.
Definition: CSMAPI_types.h:213
int wait
How fast the camera should be.
Definition: CSMAPI_types.h:189
int * tgt_y
Target Y offset.
Definition: CSMAPI_types.h:185
bool focus_center_y
Force the camera to focus on the vertical center of the map.
Definition: CSMAPI_types.h:205
Manages colors.
Definition: CSMAPI_types.h:497
unsigned char r
Red value.
Definition: CSMAPI_types.h:500
void from_rgb(unsigned long color)
Convert from RGBA to fill r, g, b and a.
Definition: CSMAPI_types.h:525
unsigned long to_rgb()
Convert this color to RGBA.
Definition: CSMAPI_types.h:517
unsigned char g
Green value.
Definition: CSMAPI_types.h:504
unsigned char a
Alpha value.
Definition: CSMAPI_types.h:512
unsigned char b
Blue value.
Definition: CSMAPI_types.h:508
Manages points (float).
Definition: CSMAPI_types.h:713
GUI_POINT_F make_frame_relative()
Divides the points by the current screen magnification.
Definition: CSMAPI_types.h:744
GUI_POINT_F to_screenspace()
Multiplies the points by the current screen magnification.
Definition: CSMAPI_types.h:724
GUI_POINT_F from_screenspace()
Divides the points by the current screen magnification.
Definition: CSMAPI_types.h:734
GUI_POINT_F reset_frame_relativity()
Divides the points by the current screen magnification.
Definition: CSMAPI_types.h:754
Manages points.
Definition: CSMAPI_types.h:546
int y
The Y position.
Definition: CSMAPI_types.h:553
int x
The X position.
Definition: CSMAPI_types.h:549
Definition: CSMAPI_types.h:842
GUI_RECT pad(int amount)
Add padding to the rect.
Definition: CSMAPI_types.h:937
Item object.
Definition: CSMAPI_types.h:1289
int code
Item ID.
Definition: CSMAPI_types.h:1292
Contains an animated map tile's information.
Definition: CSMAPI_types.h:7029
unsigned int tile_offset
The offset of the map tile we're replacing.
Definition: CSMAPI_types.h:7036
MAP_ANIMATED_TILE * draw_next
The next linked to draw.
Definition: CSMAPI_types.h:7070
unsigned char timer
The timer for this tile.
Definition: CSMAPI_types.h:7062
unsigned char frame
The current frame for this tile.
Definition: CSMAPI_types.h:7058
Surface_Ids surf_id
The surface IDs for this tile.
Definition: CSMAPI_types.h:7040
MAP_ANIMATED_TILE * proc_next
The next linked to process.
Definition: CSMAPI_types.h:7074
RECT * rect_list
The rect list for this tile.
Definition: CSMAPI_types.h:7044
bool foreground
Whether this should be drawn in the foreground(TRUE) or background(FALSE).
Definition: CSMAPI_types.h:7032
unsigned char rect_count
The number of rects in this tile.
Definition: CSMAPI_types.h:7048
MAP_ANIMATED_TILE * next
The next linked.
Definition: CSMAPI_types.h:7066
unsigned short wait
The amount of frames that need to pass before the framecounter for this tile is incremented.
Definition: CSMAPI_types.h:7052
Definition: CSMAPI_types.h:6868
Contains the currently loaded stage's map data.
Definition: CSMAPI_types.h:7082
int zone_count
Number of map zones.
Definition: CSMAPI_types.h:7109
unsigned char atrb[0x10001]
Map tileset attribute table.
Definition: CSMAPI_types.h:7093
short length
Height of map.
Definition: CSMAPI_types.h:7101
int anim_count
Number of animated foreground map tiles.
Definition: CSMAPI_types.h:7125
short width
Width of map.
Definition: CSMAPI_types.h:7097
unsigned short * ngdata
Zone tile data.
Definition: CSMAPI_types.h:7089
void * compiled_map_resource
internal use; do not use / set
Definition: CSMAPI_types.h:7133
MAP_ANIMATED_TILE * anim_list
Animated map tiles.
Definition: CSMAPI_types.h:7121
MAP_ZONE * zones
Map zones.
Definition: CSMAPI_types.h:7105
MAP_ANIMATED_TILE * anim_proc_list
Process list.
Definition: CSMAPI_types.h:7117
MAP_ANIMATED_TILE * anim_draw
Drawn animated tiles.
Definition: CSMAPI_types.h:7113
unsigned short * data
Tile indices.
Definition: CSMAPI_types.h:7085
unsigned int crc
The CRC of this map.
Definition: CSMAPI_types.h:7129
The rect for this zone.
Definition: CSMAPI_types.h:6912
int w
Width.
Definition: CSMAPI_types.h:6923
int x
X.
Definition: CSMAPI_types.h:6915
int y
Y.
Definition: CSMAPI_types.h:6919
int h
Height.
Definition: CSMAPI_types.h:6927
Physics specifier for MYCHAR.
Definition: CSMAPI_types.h:1359
int resist
Air resistance.
Definition: CSMAPI_types.h:1386
int max_move
Maximum move speed.
Definition: CSMAPI_types.h:1366
int dash1
Acceleration (1)
Definition: CSMAPI_types.h:1378
int max_dash
Maximum dash amount.
Definition: CSMAPI_types.h:1362
int jump
Jump force.
Definition: CSMAPI_types.h:1390
int gravity1
Normal gravity applied.
Definition: CSMAPI_types.h:1370
int dash2
Acceleration (2)
Definition: CSMAPI_types.h:1382
int gravity2
Gravity applied when holding the jumping key.
Definition: CSMAPI_types.h:1374
Player state argument info.
Definition: CSMAPI_types.h:7168
PLAYER_STATE_TRANSMIT_FLAGS Field
The field this argument info object represents.
Definition: CSMAPI_types.h:7175
bool UseDefaultSize
Use the default size for this field.
Definition: CSMAPI_types.h:7179
bool Ranged
Whether this argument info uses ranges OR just uses traditional size.
Definition: CSMAPI_types.h:7187
bool Used
Whether this is the end of the argument list or not.
Definition: CSMAPI_types.h:7171
int MinValue
The minimum range for this argument.
Definition: CSMAPI_types.h:7191
int MaxValue
The maximum range for this argument.
Definition: CSMAPI_types.h:7195
unsigned char NetSize
Traditional size.
Definition: CSMAPI_types.h:7183
Player state information.
Definition: CSMAPI_types.h:7201
PlayerState_DrawFuncType DrawFunc
The draw function for this player state.
Definition: CSMAPI_types.h:7229
PlayerState_ActFuncType ActFunc
The act function for this player state.
Definition: CSMAPI_types.h:7212
char * StateName
The name of this player state.
Definition: CSMAPI_types.h:7204
unsigned long long int Flags
The flags for this player state.
Definition: CSMAPI_types.h:7238
MYCHAR_STATE_ARG_INFO * ArgList
The custom argument list for this player state.
Definition: CSMAPI_types.h:7247
bool LoadedByMod
Whether this was loaded / overloaded by the currently loaded mod or not.
Definition: CSMAPI_types.h:7251
PlayerStateAnimator_OutputType AnimateRetType
The return type of the animate function.
Definition: CSMAPI_types.h:7233
unsigned int TransmitFlags
The transmit flags for this player state.
Definition: CSMAPI_types.h:7243
PlayerState_AnimFuncType AnimFunc
The animation function for this player state.
Definition: CSMAPI_types.h:7221
Player character object.
Definition: CSMAPI_types.h:1470
int exp_count
HUD stuff.
Definition: CSMAPI_types.h:1626
short life
Current health.
Definition: CSMAPI_types.h:1659
int boost_cnt
Booster amount left.
Definition: CSMAPI_types.h:1705
short max_life
Max health.
Definition: CSMAPI_types.h:1669
unsigned int flag
Flags.
Definition: CSMAPI_types.h:1489
int up
Is facing up?
Definition: CSMAPI_types.h:1506
int xm
X Motion.
Definition: CSMAPI_types.h:1554
int npc_control
NPC Control.
Definition: CSMAPI_types.h:1502
int equip
Current equip flags.
Definition: CSMAPI_types.h:1518
signed char boost_sw
HUD stuff.
Definition: CSMAPI_types.h:1701
int tgt_x
X Target Position.
Definition: CSMAPI_types.h:1530
int lifeBr
HUD stuff.
Definition: CSMAPI_types.h:1677
CaveNet::DataStructures::NetClient * pOtherClient
Other player.
Definition: CSMAPI_types.h:1753
unsigned short cond
Condition.
Definition: CSMAPI_types.h:1477
int draw_offset_x
Draw offset.
Definition: CSMAPI_types.h:1538
int draw_offset_y
Draw offset.
Definition: CSMAPI_types.h:1542
int boost_max
Booster max amount.
Definition: CSMAPI_types.h:1709
unsigned char col_r
Red value for the color of their character.
Definition: CSMAPI_types.h:1713
RECT rect
Sprite rect.
Definition: CSMAPI_types.h:1610
unsigned char rensha
Weapon rensha.
Definition: CSMAPI_types.h:1647
int old_ym
Old Y motion (before HitMyCharMap was called)
Definition: CSMAPI_types.h:1566
bool init_state
Initialize state.
Definition: CSMAPI_types.h:1481
int y
Y Position.
Definition: CSMAPI_types.h:1526
MYCHAR * pOther
Other player.
Definition: CSMAPI_types.h:1761
int count2
Count2.
Definition: CSMAPI_types.h:1590
int x
X Position.
Definition: CSMAPI_types.h:1522
bool use_char_color
Whether to use the custom color or not.
Definition: CSMAPI_types.h:1725
unsigned char bubble
Bubble.
Definition: CSMAPI_types.h:1651
int down
Is facing down?
Definition: CSMAPI_types.h:1510
unsigned char col_g
Green value for the color of their character.
Definition: CSMAPI_types.h:1717
int air_get
How much air we're getting.
Definition: CSMAPI_types.h:1689
int zone
Which zone this character is in.
Definition: CSMAPI_types.h:1729
MYCHAR_PHYSICS physics_underwater
Underwater physics.
Definition: CSMAPI_types.h:1737
bool ignore_water
If set to 'true', then this player cannot drown.
Definition: CSMAPI_types.h:1655
int count3
Count3.
Definition: CSMAPI_types.h:1594
int index_y
Index Y.
Definition: CSMAPI_types.h:1550
RECT hit
Hit rect.
Definition: CSMAPI_types.h:1602
int ani_no
Animation number.
Definition: CSMAPI_types.h:1574
int built_xm
Built xm.
Definition: CSMAPI_types.h:1741
int exp_wait
HUD stuff.
Definition: CSMAPI_types.h:1622
int act_no
Act number.
Definition: CSMAPI_types.h:1578
int count1
Count1.
Definition: CSMAPI_types.h:1586
unsigned int next_flag
Next frame flags.
Definition: CSMAPI_types.h:1493
int act_wait
Act wait.
Definition: CSMAPI_types.h:1582
CaveNet::DataStructures::NetClient * pClient
This client (redundant, used for GameSnapshot system)
Definition: CSMAPI_types.h:1757
int direct
Direction.
Definition: CSMAPI_types.h:1498
CUSTOM_PLAYER_ANIMATION_INFO anim_info
The animation info for this player.
Definition: CSMAPI_types.h:1765
NPCHAR * pNpc
Pointer NPC.
Definition: CSMAPI_types.h:1749
signed char sprash
HUD stuff.
Definition: CSMAPI_types.h:1693
CUSTOM_OBJECT obj
Custom object.
Definition: CSMAPI_types.h:1769
int lifeBr_count
HUD stuff.
Definition: CSMAPI_types.h:1681
int level
HUD stuff.
Definition: CSMAPI_types.h:1618
int index_x
Index X.
Definition: CSMAPI_types.h:1546
int built_ym
Built ym.
Definition: CSMAPI_types.h:1745
short star
How many stars we have revolving around us.
Definition: CSMAPI_types.h:1665
CustomPlayer * character
Custom player character.
Definition: CSMAPI_types.h:1473
unsigned char col_b
Blue value for the color of their character.
Definition: CSMAPI_types.h:1721
unsigned char no_life
?
Definition: CSMAPI_types.h:1643
unsigned char shock
Shock.
Definition: CSMAPI_types.h:1634
short a
a
Definition: CSMAPI_types.h:1673
signed char ques
HUD stuff.
Definition: CSMAPI_types.h:1697
int ym
Y Motion.
Definition: CSMAPI_types.h:1558
int old_xm
Old X motion (before HitMyCharMap was called)
Definition: CSMAPI_types.h:1562
RECT rect_arms
Arms sprite rect.
Definition: CSMAPI_types.h:1614
int ani_wait
Animation wait counter.
Definition: CSMAPI_types.h:1570
RECT view
View rect.
Definition: CSMAPI_types.h:1606
int count4
Count4.
Definition: CSMAPI_types.h:1598
int tgt_y
Y Target Position.
Definition: CSMAPI_types.h:1534
MYCHAR_PHYSICS physics_normal
Normal physics.
Definition: CSMAPI_types.h:1733
bool dont_flash_shock
Flash shock.
Definition: CSMAPI_types.h:1639
int air
How much air we have.
Definition: CSMAPI_types.h:1685
bool free_state
Free state.
Definition: CSMAPI_types.h:1485
int netanim
Animation index.
Definition: CSMAPI_types.h:1514
NPC object.
Definition: CSMAPI_types.h:2021
CaveNet::DataStructures::NetClient * dependent
The client ID of the client we're dependent on.
Definition: CSMAPI_types.h:2260
RECT rect
Sprite rect.
Definition: CSMAPI_types.h:2120
int count1
Custom counter 1.
Definition: CSMAPI_types.h:2132
bool sized
Whether this NPC is custom sized.
Definition: CSMAPI_types.h:2244
unsigned char shock
Shock Set when this NPC gets hurt, and decrements to 0 every frame.
Definition: CSMAPI_types.h:2164
unsigned long long int nodes
Node flags.
Definition: CSMAPI_types.h:2028
unsigned long long int transmit_nodes
Transmit node flags.
Definition: CSMAPI_types.h:2032
int direct
NPC Direction.
Definition: CSMAPI_types.h:2112
int xm2
X Motion 2.
Definition: CSMAPI_types.h:2060
void * data
Custom user data.
Definition: CSMAPI_types.h:2252
Surface_Ids surf
Surface ID – Reserved for CaveEditor – Do not change unless you know what you're doing.
Definition: CSMAPI_types.h:2088
bool should_call_free
Should call free function.
Definition: CSMAPI_types.h:2193
CollideNPCFunc collideFunc
Custom collide function.
Definition: CSMAPI_types.h:2189
int x
X Position.
Definition: CSMAPI_types.h:2044
int code_char
ID of this NPC.
Definition: CSMAPI_types.h:2076
CaveNet::DataStructures::NetClient * client
Client pointer – Do not change this variable.
Definition: CSMAPI_types.h:2213
int count2
Custom counter 2.
Definition: CSMAPI_types.h:2136
MYCHAR * dfocus
Display focus – Do not change this variable.
Definition: CSMAPI_types.h:2221
int count3
Custom counter 3.
Definition: CSMAPI_types.h:2140
FreeNPCFunc freeFunc
Custom free function.
Definition: CSMAPI_types.h:2185
unsigned char cond
NPC Condition flags.
Definition: CSMAPI_types.h:2036
CAVESTORY_MOD_API unsigned int GetHash(bool bForce=false)
Get this NPC's hash.
int exp
How much experience points this NPC drops on death.
Definition: CSMAPI_types.h:2104
int xm
X Motion.
Definition: CSMAPI_types.h:2052
int scalar
Scalar for this NPC.
Definition: CSMAPI_types.h:2248
unsigned int last_update_time
A timestamp of when this NPC was last updated.
Definition: CSMAPI_types.h:2024
int ani_no
Animation number.
Definition: CSMAPI_types.h:2128
int updateTicks
Counter for updating focus – Do not change this variable.
Definition: CSMAPI_types.h:2240
MYCHAR * focus2
Focus 2 – Do not change this variable.
Definition: CSMAPI_types.h:2236
int count4
Custom counter 4.
Definition: CSMAPI_types.h:2144
int tgt_y
Target Y.
Definition: CSMAPI_types.h:2072
int damage_view
Damage view.
Definition: CSMAPI_types.h:2168
int ym2
Y Motion 2.
Definition: CSMAPI_types.h:2064
int old_y
cache – do not use
Definition: CSMAPI_types.h:2201
CaveNet::DataStructures::NetClient * damage_target
Will only damage this specific client if not set to NULL.
Definition: CSMAPI_types.h:2264
int ani_wait
Animation wait counter.
Definition: CSMAPI_types.h:2124
int damage
How much damage this NPC deals to the player.
Definition: CSMAPI_types.h:2172
PutNPCFunc putFunc
Custom draw function.
Definition: CSMAPI_types.h:2181
int hit_voice
Hit voice – Reserved for CaveEditor – Do not change unless you know what you're doing.
Definition: CSMAPI_types.h:2092
int old_ani_no
cache – do not use
Definition: CSMAPI_types.h:2205
MYCHAR * focus
A pointer to the character that this NPC is focusing.
Definition: CSMAPI_types.h:2232
int code_event
The event this NPC should call.
Definition: CSMAPI_types.h:2084
CaveNet::DataStructures::NetClient * client2
Client pointer – Do not change this variable.
Definition: CSMAPI_types.h:2217
int act_no
Act number.
Definition: CSMAPI_types.h:2148
unsigned int bits
Map flags for this NPC.
Definition: CSMAPI_types.h:2116
int size
NPC Scale.
Definition: CSMAPI_types.h:2108
int act_wait
Act wait counter.
Definition: CSMAPI_types.h:2152
NPCHAR * pNpc
NPC Pointer If you use this, you should specify "pNpc" in both Node flags & Transmit node flags in Ca...
Definition: CSMAPI_types.h:2177
int ym
Y Motion.
Definition: CSMAPI_types.h:2056
int zone
Which zone this NPC is currently in – Do not change this variable.
Definition: CSMAPI_types.h:2209
int tgt_x
Target X.
Definition: CSMAPI_types.h:2068
RECT hit
Hit rect – Reserved for CaveEditor – Do not change unless you know what you're doing.
Definition: CSMAPI_types.h:2156
RECT view
View rect – Reserved for CaveEditor – Do not change unless you know what you're doing.
Definition: CSMAPI_types.h:2160
int old_x
cache – do not use
Definition: CSMAPI_types.h:2197
int code_flag
NPC Flag ID Details which NPC flag to test when first spawning this NPC.
Definition: CSMAPI_types.h:2080
int destroy_voice
Destroy voice – Reserved for CaveEditor – Do not change unless you know what you're doing.
Definition: CSMAPI_types.h:2096
int entity_init_index
The initial index of this NPC.
Definition: CSMAPI_types.h:2256
int life
NPC Health.
Definition: CSMAPI_types.h:2100
int flag
Internal flags.
Definition: CSMAPI_types.h:2040
int y
Y Position.
Definition: CSMAPI_types.h:2048
CAVESTORY_MOD_API GUI_POINT GetDrawPosition(int fx=-1, int fy=-1)
Get this NPC's draw position.
Permit stage object.
Definition: CSMAPI_types.h:1253
int event
The event # to call.
Definition: CSMAPI_types.h:1258
int index
Index in gPermitStage.
Definition: CSMAPI_types.h:1255
Stores information for save files.
Definition: CSMAPI_types.h:2404
int stage
Stage index.
Definition: CSMAPI_types.h:2411
int unused2
Unused.
Definition: CSMAPI_types.h:2495
short max_life
Player max life.
Definition: CSMAPI_types.h:2431
int direct
Player direction.
Definition: CSMAPI_types.h:2427
int music
Music index.
Definition: CSMAPI_types.h:2415
int x
Player X position.
Definition: CSMAPI_types.h:2419
short a
Player A.
Definition: CSMAPI_types.h:2443
bool collectables_shown
Collectables shown.
Definition: CSMAPI_types.h:2515
int collectables
Collectables.
Definition: CSMAPI_types.h:2507
ITEM items[32]
Item table.
Definition: CSMAPI_types.h:2471
char CharName[256]
Preferred character name.
Definition: CSMAPI_types.h:2499
int booster_max
Maximum booster fuel.
Definition: CSMAPI_types.h:2511
PERMIT_STAGE permitstage[8]
Permit stage table.
Definition: CSMAPI_types.h:2475
int select_item
Selected item.
Definition: CSMAPI_types.h:2451
PERMIT_STAGE permitstage2[16]
Extra permit stages.
Definition: CSMAPI_types.h:2519
long long int frame_count
How many frames have been processed and rendered since the start of this playthrough.
Definition: CSMAPI_types.h:2503
char FLAG[4]
FLAG.
Definition: CSMAPI_types.h:2483
int counter
Nikamaru Counter.
Definition: CSMAPI_types.h:2463
int unit
Universe number.
Definition: CSMAPI_types.h:2459
int unused1
Unused.
Definition: CSMAPI_types.h:2491
int select_arms
Select arms.
Definition: CSMAPI_types.h:2447
ARMS arms[8]
Arms table.
Definition: CSMAPI_types.h:2467
int equip
Equip flags.
Definition: CSMAPI_types.h:2455
short life
Player life.
Definition: CSMAPI_types.h:2439
short star
Player stars.
Definition: CSMAPI_types.h:2435
char code[8]
Magic code.
Definition: CSMAPI_types.h:2407
unsigned char flags[1000]
NPC & skip flags.
Definition: CSMAPI_types.h:2487
int y
Player Y position.
Definition: CSMAPI_types.h:2423
signed char permit_mapping[0x80]
Permit mapping.
Definition: CSMAPI_types.h:2479
Stores information from CSM_CastRay().
Definition: CSMAPI_types.h:6805
RAYCAST_QUERY()
Constructor!
Definition: CSMAPI_types.h:6857
GUI_POINT_F mNormal
The normal of the face that we hit.
Definition: CSMAPI_types.h:6816
GUI_POINT m_HitPos
The hit position (subpixel coordinates).
Definition: CSMAPI_types.h:6808
bool hit_entities
Whether to allow hitting entities or not.
Definition: CSMAPI_types.h:6848
bool hit_slopes
Whether to allow hitting slopes or not.
Definition: CSMAPI_types.h:6852
NPCHAR * mHitNPC
The hit NPC.
Definition: CSMAPI_types.h:6824
unsigned char mDirect
This stores which way we pushed the point out of the hit face.
Definition: CSMAPI_types.h:6836
bool mOutOfBounds
Whether the ray went out of bounds or not.
Definition: CSMAPI_types.h:6820
bool mHitEndBlock
Whether the ray hit the end block.
Definition: CSMAPI_types.h:6832
struct RAYCAST_QUERY::@17 mConfig
Options.
bool mHitStartBlock
Whether the ray hit the start block.
Definition: CSMAPI_types.h:6828
unsigned int ent_bits_mask
Bits that the entities we hit MUST have to be a valid hit target.
Definition: CSMAPI_types.h:6844
GUI_POINT tileHitPos
The hit map tile's map coordinates.
Definition: CSMAPI_types.h:6812
Rect structure.
Definition: CSMAPI_types.h:125
int bottom
Bottom position (Y + H)
Definition: CSMAPI_types.h:148
int top
Top position (Y)
Definition: CSMAPI_types.h:136
Definition: CSMAPI_types.h:51
SafeClientInterface.
Definition: CSMAPI_types.h:1775
int * mKeyOld
This client's gameKeyOld variable.
Definition: CSMAPI_types.h:1818
SafeClientInterface()
constructor
Definition: CSMAPI_types.h:1838
int * mKeyTrg
This client's gameKeyTrg variable.
Definition: CSMAPI_types.h:1814
bool * mSpurMax
Whether this client's spur charge is at maximum.
Definition: CSMAPI_types.h:1826
PERMIT_STAGE * mPermitStages
Permitted stages list.
Definition: CSMAPI_types.h:1834
CaveNet::DataStructures::NetClient * mClient
The client we're interfacing with.
Definition: CSMAPI_types.h:1778
SafeClientInterface(CaveNet::DataStructures::NetClient *pClient, unsigned int iSetType=SCI_SetType::SCI_ST_AUTO)
Constructor 2.
Definition: CSMAPI_types.h:1845
int * mGameFlags
This client's game flags.
Definition: CSMAPI_types.h:1830
int mGhostId
The ghost ID of this user.
Definition: CSMAPI_types.h:1786
int * mKey
This client's gameKey variable.
Definition: CSMAPI_types.h:1810
ARMS * mArms
This client's arms table.
Definition: CSMAPI_types.h:1798
bool mIsOurUser
Whether this is our user.
Definition: CSMAPI_types.h:1790
int * mSelectedArms
A pointer to this client's selected arms.
Definition: CSMAPI_types.h:1794
ITEM * mItems
This client's items table.
Definition: CSMAPI_types.h:1802
int * mSpurCharge
This client's spur charge.
Definition: CSMAPI_types.h:1822
bool mClientSide
Whether this interface is client-sided or not.
Definition: CSMAPI_types.h:1782
MYCHAR * mMC
This client's player.
Definition: CSMAPI_types.h:1806
Stores info for an entry.
Definition: CSMAPI_types.h:6583
char * text
The text to display here.
Definition: CSMAPI_types.h:6606
GUI_POINT pnt_text
The text offset for this entry.
Definition: CSMAPI_types.h:6598
int id
This entry's ID.
Definition: CSMAPI_types.h:6602
int index
The index for this entry (only set correctly for entries in the 'shown' linkage.)
Definition: CSMAPI_types.h:6586
GUI_RECT rct_scrolled
The rect after scroll for this entry.
Definition: CSMAPI_types.h:6590
GUI_RECT rct_absolute
The containing rect for this entry.
Definition: CSMAPI_types.h:6594
SEL_LIST_ENTRY * next
The next shown entry.
Definition: CSMAPI_types.h:6610
ShootInfo structure.
Definition: CSMAPI_types.h:1968
int keyTrg
The key-Trg input state.
Definition: CSMAPI_types.h:1983
int arms_code
Which weapon ID was shot.
Definition: CSMAPI_types.h:2003
MYCHAR * ourC
The character tied to this shoot event.
Definition: CSMAPI_types.h:1975
int arms_level
The level at which the weapon was shot at.
Definition: CSMAPI_types.h:2007
CaveNet::DataStructures::NetClient * client
The client tied to this shoot event.
Definition: CSMAPI_types.h:1971
ARMS * arms
The shooter's current weapon list.
Definition: CSMAPI_types.h:1987
int key
The key input state.
Definition: CSMAPI_types.h:1979
int ghostId
The shooter's Ghost ID.
Definition: CSMAPI_types.h:1995
int selectedArm
The shooter's selected weapon index.
Definition: CSMAPI_types.h:1991
int bullet_ids[3]
Ease-of-use: List of bullet IDs defined in CaveEditor for each weapon level.
Definition: CSMAPI_types.h:2011
SafeClientInterface sClient
A safe interface for the client who shot the gun.
Definition: CSMAPI_types.h:2015
bool IsOurClient
Whether this client is our user.
Definition: CSMAPI_types.h:1999
System menu info struct.
Definition: CSMAPI_types.h:6218
bool Disabled
Whether this item is disabled or not.
Definition: CSMAPI_types.h:6285
bool Checked
Checked.
Definition: CSMAPI_types.h:6289
SystemMenuItem * Previous
The previous item.
Definition: CSMAPI_types.h:6241
int SubItemCount
The number of subitems this item contains.
Definition: CSMAPI_types.h:6253
SystemMenuItem ** SubItemList
The items for this menu.
Definition: CSMAPI_types.h:6249
GUI_POINT ShortcutPoint
The position for this item's shortcut text.
Definition: CSMAPI_types.h:6269
bool Seperator
Seperator.
Definition: CSMAPI_types.h:6281
unsigned int TotalItemIndex
This item's index in TotalItemList.
Definition: CSMAPI_types.h:6225
GUI_RECT ItemRect
This item's rect.
Definition: CSMAPI_types.h:6261
GUI_POINT TextPoint
The position for this item's text.
Definition: CSMAPI_types.h:6265
unsigned int ItemIndex
This item's index in the parent item's SubItemList.
Definition: CSMAPI_types.h:6229
unsigned int ItemId
The ID for this item.
Definition: CSMAPI_types.h:6221
SystemMenuItem * BaseParent
The base parent for this item.
Definition: CSMAPI_types.h:6237
int LongestSubWidth
Longest subitem width.
Definition: CSMAPI_types.h:6277
char ShortcutText[64]
The shortcut text for this item.
Definition: CSMAPI_types.h:6301
Input::KeyShortcut * Shortcut
The shortcut for this item.
Definition: CSMAPI_types.h:6297
GUI_RECT SubMenuRect
This item's submenu rect.
Definition: CSMAPI_types.h:6273
SystemMenuItem * Parent
The parent for this item.
Definition: CSMAPI_types.h:6233
char Text[270]
The text for this menu.
Definition: CSMAPI_types.h:6257
SystemMenuInfo_OnItemClickFunc OnClicked
On Clicked Callback.
Definition: CSMAPI_types.h:6293
SystemMenuItem * Next
The next item.
Definition: CSMAPI_types.h:6245
Callstack data for text script.
Definition: CSMAPI_types.h:2698
unsigned short p_read
The p_read value of where we left off at this point in the callstack.
Definition: CSMAPI_types.h:2701
unsigned short event_number
The event number we were originally running.
Definition: CSMAPI_types.h:2705
Text script pointer data.
Definition: CSMAPI_types.h:2528
CaveNet::DataStructures::NetClient * Client
Their client.
Definition: CSMAPI_types.h:2547
CaveNet::DataStructures::NetPlayer * Player
Their player.
Definition: CSMAPI_types.h:2551
int * Key
Their input flags.
Definition: CSMAPI_types.h:2539
int * GameFlags
Their game flags.
Definition: CSMAPI_types.h:2535
MYCHAR * Char
Their character.
Definition: CSMAPI_types.h:2531
int * KeyTrg
Their trg input flags.
Definition: CSMAPI_types.h:2543
Text script state object.
Definition: CSMAPI_types.h:2557
int next_event
Next event.
Definition: CSMAPI_types.h:2611
int current_event
The event that is currently being ran.
Definition: CSMAPI_types.h:2660
int wait_next
Wait Next.
Definition: CSMAPI_types.h:2607
char * data
Script buffer size.
Definition: CSMAPI_types.h:2568
int face
Current face.
Definition: CSMAPI_types.h:2627
int p_write
Current write position in text.
Definition: CSMAPI_types.h:2587
char lock_mode
Lock mode.
Definition: CSMAPI_types.h:2656
int line
Current line to write to.
Definition: CSMAPI_types.h:2595
NPCHAR * source_npc
The NPC that was used to start the event.
Definition: CSMAPI_types.h:2688
int face_x
Face X offset.
Definition: CSMAPI_types.h:2631
int size
Script buffer size.
Definition: CSMAPI_types.h:2564
int focus_wait
Focusing: Camera speed.
Definition: CSMAPI_types.h:2672
int wait
Event wait.
Definition: CSMAPI_types.h:2603
int item_y
Item Y offset.
Definition: CSMAPI_types.h:2639
signed char flags
Flags.
Definition: CSMAPI_types.h:2579
TextScriptSkipEventStatus skip_status
The current event skipping status.
Definition: CSMAPI_types.h:2692
int offsetY
..?
Definition: CSMAPI_types.h:2647
int * old_focus_y
Focusing: Old focus Y ptr.
Definition: CSMAPI_types.h:2680
int wait_npc
Wait NPC.
Definition: CSMAPI_types.h:2615
signed char mode
Mode (ex.
Definition: CSMAPI_types.h:2572
int * old_focus_x
Focusing: Old focus X ptr.
Definition: CSMAPI_types.h:2676
bool transmit
Whether to transmit this to everyone on the server.
Definition: CSMAPI_types.h:2664
int item
Current item.
Definition: CSMAPI_types.h:2635
bool focus_on_plr
Whether to focus on the player who has context control.
Definition: CSMAPI_types.h:2651
unsigned char wait_beam
NOD cursor blink.
Definition: CSMAPI_types.h:2684
int ypos_line[4]
Line y positions.
Definition: CSMAPI_types.h:2599
int focus_npc
Focusing: gNPC Index.
Definition: CSMAPI_types.h:2668
char path[PATH_LENGTH]
Path (reload when exit teleporter menu/inventory)
Definition: CSMAPI_types.h:2560
int wait_npc_act
Wait NPC act.
Definition: CSMAPI_types.h:2619
unsigned int p_read
Current positions (read position in buffer, x position in line)
Definition: CSMAPI_types.h:2583
int p_tur_x
When in instant text display mode, this stores how far along the pen's X offset is.
Definition: CSMAPI_types.h:2591
signed char select
Yes/no selected.
Definition: CSMAPI_types.h:2623
RECT rcText
Text rect.
Definition: CSMAPI_types.h:2643
Dropdown box item struct.
Definition: CSMAPI_types.h:5689
GUI_RECT close_rect
This item's close button rect.
Definition: CSMAPI_types.h:5712
GUI_POINT text_point
The position for this item's text.
Definition: CSMAPI_types.h:5704
GUI_POINT text_size
The size of this item's text.
Definition: CSMAPI_types.h:5708
bool is_closable
Whether this tab has a close button or not.
Definition: CSMAPI_types.h:5716
GUI_RECT item_rect
This item's rect.
Definition: CSMAPI_types.h:5696
GUI_RECT draw_rect
This item's draw rect.
Definition: CSMAPI_types.h:5700
Whimsical star object.
Definition: CSMAPI_types.h:2282
CUSTOM_PLAYER_ANIMATION_INFO anim_info
The animation information for this whimsical star.
Definition: CSMAPI_types.h:2291