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 };
2690 
2694 {
2697  unsigned short p_read;
2698 
2701  unsigned short event_number;
2702 };
2703 
2704 //------------------------------------------------------------------------------------------------------------
2705 
2709 
2713 {
2714 public: // Magnification
2715 
2716  static unsigned int defaultCustomMagnification;
2717 
2718 public: // Linkage
2719 
2720  static GuiBase* gFirst;
2721  GuiBase* pNext;
2722  GuiBase* pPrev;
2723 
2724 public: // Enum / data
2728  {
2730  PRT_DIRTY = 0b000001,
2732  PRT_IGNORE_MOUSE = 0b000010,
2734  PRT_IGNORE_KEYS = 0b000100,
2736  PRT_SELECTED = 0b001000,
2738  PRT_DISABLE_MOUSE_ON_MOVE = 0b010000,
2740  PRT_CHANGED = 0b100000
2741  };
2742 
2745  typedef void(*OnHoverChangeCallbackFunc)(GuiBase*, int value);
2746 
2749  typedef void(*OnValueChangeCallbackFunc)(GuiBase*, const char*& newValue);
2750 
2753  typedef bool(*OnValidateChangeCallbackFunc)(GuiBase*, const char* oldValue, char* newValue);
2754 
2755 public: // Cache
2756 
2759  OnValueChangeCallbackFunc OnValueChange;
2760 
2763  OnValidateChangeCallbackFunc OnValidateChange;
2764 
2768 
2771  void* userData;
2772 
2775  void* userData2;
2776 
2779  unsigned int customMagnification;
2780 
2781 public: // Configuration
2782 
2785  OnHoverChangeCallbackFunc OnHoverChange;
2786 
2790 
2794 
2798 
2799 public: // Basic constructor
2800 
2804  {
2805  customMagnification = defaultCustomMagnification;
2806  rect = GUI_RECT(0, 0, 0, 0);
2807  hotspot_rect = GUI_RECT(0, 0, 0, 0);
2808  OnHoverChange = nullptr;
2809  OnValueChange = nullptr;
2810  OnValidateChange = nullptr;
2811  pNext = nullptr;
2812  pPrev = nullptr;
2813 
2814  // Ready the config
2815  has_special_mouse_processing = false;
2816  has_special_hotspot_rect = false;
2817  }
2818 
2821  virtual ~GuiBase()
2822  {
2823  }
2824 
2825 protected: // Linkage
2826 
2829  void Link();
2830 
2833  void Unlink();
2834 
2835 public: // Virtual sets & gets
2836 
2841  virtual const char* getClassName() { return "GuiBase"; }
2842 
2847  virtual void setSelected(int value) = 0;
2848 
2853  virtual void setHovered(int value) = 0;
2854 
2859  virtual bool isSelected() = 0;
2860 
2865  virtual bool isHovered() = 0;
2866 
2871  virtual bool isHoverable() = 0;
2872 
2877  virtual int getSelectableCount() { return 0; }
2878 
2882  virtual int getHoverableCount() { return 0; }
2883 
2889  virtual GuiBase* getHoverable(int index) { return (!index ? this : NULL); }
2890 
2896  virtual GuiBase* getSelectable(int index) { return (!index ? this : NULL); }
2897 
2901  virtual bool SelectOnMouseUp() { return true; }
2902 
2903 public: // Virtual methods
2904 
2908  virtual void setFont(FontObject* pFont) {}
2909 
2913  virtual FontObject* getFont() { return NULL; }
2914 
2920  virtual int process(GUI_POINT mouse) = 0;
2921 
2926  virtual void calculate() = 0;
2927 
2931  virtual void render() = 0;
2932 
2937  virtual int processKeys() { return 0; }
2938 
2942  virtual void importantRender() {}
2943 
2944 public: // Inlined functions
2945 
2946  virtual int getMagnification();
2947 
2948 public: // Crucial for managing linkage
2949 
2950  GuiBase(const GuiBase&) = delete;
2951  GuiBase& operator=(const GuiBase&) = delete;
2952  GuiBase(GuiBase&&) = delete;
2953  GuiBase& operator=(GuiBase&&) = delete;
2954 };
2955 
2956 //------------------------------------------------------------------------------------------------------------
2957 
2961 {
2962 protected: // Cache variables
2963 
2967  unsigned int mTextColor_RGB;
2968 
2972  FontObject* mFont;
2973 
2978 
2982  char mText[256];
2983 
2984 public: // Configuration
2985 
2990 
2995 
2999 
3003  char* mNewLines[8];
3004 
3009 
3013 
3017 
3018 public:
3019 
3023  ~CenteredTextInfo();
3024 
3025 public:
3026 
3030  virtual const char* getClassName() { return "CenteredTextInfo"; }
3031 
3035  virtual void setSelected(int value);
3036 
3040  virtual void setHovered(int value);
3041 
3045  virtual bool isSelected();
3046 
3050  virtual bool isHovered();
3051 
3055  virtual bool isHoverable();
3056 
3057 public:
3061  virtual void setFont(FontObject* pFont) { mFont = pFont; }
3062 
3066  inline FontObject* getFont() { return mFont; }
3067 
3068 public:
3073 
3079  int getLineLength(int index);
3080 
3086  void getLineText(int index, char* buffer, int buffer_len);
3087 
3094 
3098  void setText(const char* text);
3099 
3103  inline const char* getText() { return mText; }
3104 
3105 public:
3110  virtual int process(GUI_POINT mouse);
3111 
3115  virtual void calculate();
3116 
3119  virtual void render();
3120 };
3121 
3122 //------------------------------------------------------------------------------------------------------------
3123 
3127 {
3128 protected: // Cache variables
3129 
3133  unsigned int mTextColor_RGB;
3134 
3138  unsigned int mOutlineColor_RGB;
3139 
3143  FontObject* mFont;
3144 
3148  char mText[256];
3149 
3154 
3155 public: // Configuration
3156 
3160 
3164 
3168 
3172 
3173 public:
3174 
3178  ~LabelInfo();
3179 
3180 public:
3181 
3185  virtual const char* getClassName() { return "LabelInfo"; }
3186 
3190  virtual void setSelected(int value);
3191 
3195  virtual void setHovered(int value);
3196 
3200  virtual bool isSelected();
3201 
3205  virtual bool isHovered();
3206 
3210  virtual bool isHoverable();
3211 
3212 public:
3216  virtual void setFont(FontObject* pFont) { mFont = pFont; }
3217 
3221  virtual FontObject* getFont() { return mFont; }
3222 
3223 public:
3227  void setText(const char* text);
3228 
3232  inline const char* getText() { return mText;}
3233 
3234 public:
3239  virtual int process(GUI_POINT mouse);
3240 
3244  virtual void calculate();
3245 
3248  virtual void render();
3249 };
3250 
3251 //------------------------------------------------------------------------------------------------------------
3252 
3256 {
3257 protected: // Cache variables
3258 
3262  FontObject* mFont;
3263 
3267  char mText[256];
3268 
3269 public: // Configuration
3270 
3274 
3278 
3282 
3286 
3290 
3294 
3298 
3301  bool mHovered;
3302 
3303 public:
3304 
3309 
3310 public:
3311 
3315  virtual const char* getClassName() { return "SelectableLabelInfo"; }
3316 
3320  virtual void setSelected(int value);
3321 
3325  virtual void setHovered(int value);
3326 
3330  virtual bool isSelected();
3331 
3335  virtual bool isHovered();
3336 
3340  virtual bool isHoverable();
3341 
3345  virtual int getSelectableCount() { return 1; }
3346 
3350  virtual int getHoverableCount() { return 1; }
3351 
3355  virtual bool SelectOnMouseUp() { return false; }
3356 
3357 public:
3361  virtual void setFont(FontObject* pFont) { mFont = pFont; }
3362 
3366  virtual FontObject* getFont() { return mFont; }
3367 
3368 public:
3372  void setText(const char* text);
3373 
3377  inline const char* getText() { return mText;}
3378 
3379 public:
3384  virtual int process(GUI_POINT mouse);
3385 
3389  virtual void calculate();
3390 
3393  virtual void render();
3394 };
3395 
3396 //------------------------------------------------------------------------------------------------------------
3397 
3401 {
3402 private:
3405  static GUI_RECT srcScrollBarX_BG[3];
3406 
3409  static GUI_RECT srcScrollBarX_LeftBtn[2];
3410 
3413  static GUI_RECT srcScrollBarX_RightBtn[2];
3414 
3417  static GUI_RECT srcScrollBarX_Handle[3];
3418 
3421  static GUI_RECT srcScrollBarX_HandleSel[3];
3422 
3425  static GUI_RECT srcScrollBarY_BG[3];
3426 
3429  static GUI_RECT srcScrollBarY_UpBtn[2];
3430 
3433  static GUI_RECT srcScrollBarY_DownBtn[2];
3434 
3437  static GUI_RECT srcScrollBarY_Handle[3];
3438 
3441  static GUI_RECT srcScrollBarY_HandleSel[3];
3442 
3445  static unsigned int srcBackgroundColor;
3446 
3449  static unsigned int srcOutlineColor;
3450 
3451 public:
3452 
3455  enum HoverType : unsigned char
3456  {
3458  HOVER_NONE = 0,
3459 
3462 
3465 
3467  HOVER_BUTTON_2
3468  };
3469 
3473  {
3475  SCROLL_NONE = 0,
3476 
3479 
3481  SCROLL_Y
3482  };
3483 
3488  typedef void(*OnScrollCallbackFunc)(ScrollAreaInfo* pGui, GUI_POINT_F scrollAmt);
3489 
3490 protected: // Cache variables
3491 
3494  ScrollState scrollState;
3495 
3498  GUI_RECT scrollBarXBtn_Left;
3499 
3502  GUI_RECT scrollBarXBtn_Right;
3503 
3506  GUI_RECT scrollBarYBtn_Up;
3507 
3510  GUI_RECT scrollBarYBtn_Down;
3511 
3514  GUI_RECT scrollBarHandleY;
3515 
3518  GUI_RECT scrollBarY;
3519 
3522  GUI_RECT scrollBarHandleX;
3523 
3526  GUI_RECT scrollBarX;
3527 
3530  GUI_POINT offsetPoint;
3531 
3534  bool showingHandleX;
3535 
3538  bool showingHandleY;
3539 
3540 public: // Public configuration
3541 
3543  OnScrollCallbackFunc OnScroll;
3544 
3548 
3552 
3556 
3560 
3564 
3568 
3572 
3576 
3580 
3584 
3588 
3592 
3593 public:
3594 
3598  ~ScrollAreaInfo();
3599 
3600 public:
3601 
3605  inline bool isScrolling()
3606  {
3607  return (scrollState != ScrollState::SCROLL_NONE);
3608  }
3609 
3610 public: // Configuration
3611 
3615  virtual const char* getClassName() { return "ScrollAreaInfo"; }
3616 
3620  virtual void setSelected(int value);
3621 
3625  virtual void setHovered(int value);
3626 
3630  virtual bool isSelected();
3631 
3635  virtual bool isHovered();
3636 
3640  virtual bool isHoverable();
3641 
3642 public:
3649 
3656 
3663 
3668 
3669 public:
3676 
3681 
3686 
3691 
3696 
3701  virtual int process(GUI_POINT mouse);
3702 
3706  virtual void calculate();
3707 
3710  virtual void render();
3711 
3715  void begin();
3716 
3721  void end();
3722 };
3723 
3724 //------------------------------------------------------------------------------------------------------------
3725 
3729 {
3730 public:
3731 
3735  {
3739 
3742 
3744  MOUSE_BUTTON
3745  };
3746 
3747  enum EInputBoxStyle
3748  {
3749  STYLE_NORMAL,
3750  STYLE_WHITE_BG
3751  };
3752 
3753 private:
3754 
3757  static GUI_RECT srcInputBox[9];
3758 
3761  static GUI_RECT srcInputBoxSel[9];
3762 
3765  static GUI_RECT srcInputBox_Style_1[9];
3766 
3769  static GUI_RECT srcInputBoxSel_Style_1[9];
3770 
3773  static GUI_RECT srcInputBox_Disabled[9];
3774 
3777  static GUI_RECT srcInputBoxSel_Disabled[9];
3778 
3781  static unsigned int srcSelBgColor;
3782 
3785  static unsigned int srcCursorColor;
3786 
3789  static unsigned int srcTextColor;
3790 
3793  static unsigned int srcTextColorStyle2;
3794 
3797  static unsigned int srcTextColorDisabled;
3798 
3801  static unsigned int srcTextColorCensored;
3802 
3803 public: // Data
3804 
3812  typedef bool(*ValidateInputCallbackFunc)(TextInputInfo* pTextInput, const char* pValue, char pValidateOutput[1024]);
3813 
3814 private: // Cache variables
3815 
3818  unsigned int textColor;
3819 
3822  FontObject* font;
3823 
3826  char value[1024];
3827 
3830  char* censoredvalue;
3831 
3834  bool isHovering;
3835 
3838  bool isTyping;
3839 
3842  GUI_POINT textSize;
3843 
3846  GUI_RECT textRect;
3847 
3850  GUI_RECT selectionRect;
3851 
3854  GUI_RECT cursorRect;
3855 
3858  int fontHeight;
3859 
3862  int textXOffset;
3863 
3866  int cursorBlink;
3867 
3868 public: // Public configuration
3869 
3872  EInputBoxStyle mInputStyle;
3873 
3876  ValidateInputCallbackFunc ValidateInput;
3877 
3881 
3885 
3889 
3892  int sel_end;
3893 
3897 
3901 
3905 
3909 
3912  int margin;
3913 
3914 public: // Methods
3915 
3919 
3923 
3924 protected:
3925 
3929 
3930 public:
3931 
3935  virtual const char* getClassName() { return "TextInputInfo"; }
3936 
3940  virtual void setSelected(int value);
3941 
3945  virtual void setHovered(int value);
3946 
3950  virtual bool isSelected();
3951 
3955  virtual bool isHovered();
3956 
3960  virtual bool isHoverable();
3961 
3965  virtual int getSelectableCount() { return 1; }
3966 
3970  virtual int getHoverableCount() { return 1; }
3971 
3975  virtual bool SelectOnMouseUp() { return false; }
3976 
3977 public:
3983  void setValue(const char* value, bool bUseCallback = true);
3984 
3988  const char* getValue();
3989 
3993  virtual void setFont(FontObject* pFont);
3994 
3998  virtual FontObject* getFont() { return font; }
3999 
4003  void startInput(GUI_POINT mouse = GUI_POINT(0, 0));
4004 
4007  void stopInput();
4008 
4015 
4020  virtual int processKeys();
4021 
4026  virtual int process(GUI_POINT mouse);
4027 
4031  virtual void calculate();
4032 
4035  virtual void render();
4036 };
4037 
4038 //------------------------------------------------------------------------------------------------------------
4039 
4043 {
4044 public:
4045 
4049  {
4053 
4056 
4058  MOUSE_BUTTON
4059  };
4060 
4061 private:
4062 
4065  static GUI_RECT srcInputBox[9];
4066 
4069  static GUI_RECT srcInputBoxSel[9];
4070 
4073  static GUI_RECT srcInputBox_Disabled[9];
4074 
4077  static GUI_RECT srcInputBoxSel_Disabled[9];
4078 
4081  static unsigned int srcSelBgColor;
4082 
4085  static unsigned int srcCursorColor;
4086 
4089  static unsigned int srcTextColor;
4090 
4093  static unsigned int srcTextColorDisabled;
4094 
4097  static unsigned int srcTextColorCensored;
4098 
4099 public: // Data
4100 
4107  typedef bool(*ValidateKeyInputCallbackFunc)(KeyInputInfo* pKeyInput, int iKeyValue);
4108 
4109 private: // Cache variables
4110 
4113  FontObject* font;
4114 
4117  int m_KeyValue;
4118 
4121  bool isHovering;
4122 
4125  bool isTyping;
4126 
4129  GUI_RECT textRect;
4130 
4133  int fontHeight;
4134 
4137  char disp_text[256];
4138 
4139 public: // Public configuration
4140 
4144 
4147  ValidateKeyInputCallbackFunc ValidateInput;
4148 
4152 
4156 
4159  int margin;
4160 
4161 public: // Methods
4162 
4166 
4170 
4171 public:
4172 
4176  virtual const char* getClassName() { return "KeyInputInfo"; }
4177 
4181  virtual void setSelected(int value);
4182 
4186  virtual void setHovered(int value);
4187 
4191  virtual bool isSelected();
4192 
4196  virtual bool isHovered();
4197 
4201  virtual bool isHoverable();
4202 
4206  virtual int getSelectableCount() { return 1; }
4207 
4211  virtual int getHoverableCount() { return 1; }
4212 
4216  virtual bool SelectOnMouseUp() { return false; }
4217 
4218 public:
4225  void setValue(int iScancode, bool bUseCallback = true);
4226 
4230  int getValue();
4231 
4235  virtual void setFont(FontObject* pFont);
4236 
4240  virtual FontObject* getFont() { return font; }
4241 
4245 
4248  void startInput();
4249 
4253  void stopInput(bool bSaveValue = true);
4254 
4259  virtual int processKeys();
4260 
4265  virtual int process(GUI_POINT mouse);
4266 
4270  virtual void calculate();
4271 
4274  virtual void render();
4275 };
4276 
4277 //------------------------------------------------------------------------------------------------------------
4278 
4282 {
4283 
4284 private: // Cache variables
4285 
4288  bool mIsHovering;
4289 
4290 public: // Public configuration
4291 
4294  bool mValue;
4295 
4299 
4302  bool mSmall;
4303 
4307 
4308 public:
4309 
4313 
4317 
4318 public:
4319 
4323  virtual const char* getClassName() { return "CheckBoxInfo"; }
4324 
4328  virtual void setSelected(int value);
4329 
4333  virtual void setHovered(int value);
4334 
4338  virtual bool isSelected();
4339 
4343  virtual bool isHovered();
4344 
4348  virtual bool isHoverable();
4349 
4353  virtual int getSelectableCount() { return 1; }
4354 
4358  virtual int getHoverableCount() { return 1; }
4359 
4360 public:
4364  void setValue(bool val);
4365 
4369  bool getValue();
4370 
4371 public:
4372 
4377  virtual int processKeys();
4378 
4383  virtual int process(GUI_POINT mouse);
4384 
4388  virtual void calculate();
4389 
4392  virtual void render();
4393 };
4394 
4395 //------------------------------------------------------------------------------------------------------------
4396 
4400 {
4401 private:
4402 
4405  static GUI_RECT srcHeadButton[2];
4406 
4409  static GUI_RECT srcTimeline[3];
4410 
4413  static unsigned int srcTooltipTextColor;
4414 
4415 private:
4416 
4419  char mText[32];
4420 
4423  FontObject* font;
4424 
4427  bool mIsHovering;
4428 
4431  bool mIsDragging;
4432 
4435  char mKeyWait;
4436 
4439  int mKeyHeld;
4440 
4443  int mKeyHeldOld;
4444 
4447  GUI_POINT mButton;
4448 
4451  GUI_RECT mTooltip;
4452 
4455  GUI_POINT mTextPoint;
4456 
4459  GUI_POINT mTooltipArrow;
4460 
4461 public: // Public configuration
4462 
4465  float mValue;
4466 
4469  float mMax;
4470 
4473  float mMin;
4474 
4477  bool mIntOnly;
4478 
4482 
4483 public:
4484 
4488 
4492 
4493 public:
4494 
4498  virtual const char* getClassName() { return "SliderIntInfo"; }
4499 
4503  virtual void setSelected(int value);
4504 
4508  virtual void setHovered(int value);
4509 
4513  virtual bool isSelected();
4514 
4518  virtual bool isHovered();
4519 
4523  virtual bool isHoverable();
4524 
4528  virtual int getSelectableCount() { return 1; }
4529 
4533  virtual int getHoverableCount() { return 1; }
4534 
4538  virtual bool SelectOnMouseUp() { return false; }
4539 
4540 public:
4541 
4545  void setValue(int val);
4546 
4550  int getValue();
4551 
4552 public:
4556  virtual void setFont(FontObject* pFont) { font = pFont; }
4557 
4561  virtual FontObject* getFont() { return font; }
4562 
4567  virtual int processKeys();
4568 
4573  virtual int process(GUI_POINT mouse);
4574 
4578  virtual void calculate();
4579 
4582  virtual void render();
4583 
4587  virtual void importantRender();
4588 };
4589 
4590 //------------------------------------------------------------------------------------------------------------
4591 
4595 {
4596 public:
4597 
4600  typedef void(*OnButtonPressedFunc)(ButtonInfo*, void*);
4601 
4602 private:
4603 
4606  static GUI_RECT srcButton[9];
4607 
4610  static GUI_RECT srcButtonSel[9];
4611 
4614  static GUI_RECT srcButtonDis[9];
4615 
4618  static GUI_RECT srcButtonDisSel[9];
4619 
4622  static unsigned int srcTextColor;
4623 
4626  static unsigned int srcDisabledTextColor;
4627 
4628 private: // Cache variables
4629 
4632  FontObject* font;
4633 
4636  GUI_POINT textPoint;
4637 
4640  bool isHovering;
4641 
4642 public: // Public configuration
4643 
4646  char text[256];
4647 
4650  int vmargin;
4651 
4654  int margin;
4655 
4658  OnButtonPressedFunc OnClicked;
4659 
4663 
4664 public: // Methods
4665 
4669 
4673 
4674 public:
4675 
4679  virtual const char* getClassName() { return "ButtonInfo"; }
4680 
4684  virtual void setSelected(int value);
4685 
4689  virtual void setHovered(int value);
4690 
4694  virtual bool isSelected();
4695 
4699  virtual bool isHovered();
4700 
4704  virtual bool isHoverable();
4705 
4709  virtual int getSelectableCount() { return 1; }
4710 
4714  virtual int getHoverableCount() { return 1; }
4715 
4716 public:
4717 
4721  virtual void setFont(FontObject* pFont) { font = pFont; }
4722 
4726  virtual FontObject* getFont() { return font; }
4727 
4732  virtual int processKeys();
4733 
4738  virtual int process(GUI_POINT mouse);
4739 
4743  virtual void calculate();
4744 
4747  virtual void render();
4748 };
4749 
4750 //------------------------------------------------------------------------------------------------------------
4751 
4755 {
4756 private:
4757 
4760  static GUI_RECT srcDropdownBoxBG_Sel[3];
4761 
4764  static GUI_RECT srcDropdownBoxBG_Off[3];
4765 
4768  static GUI_RECT srcDropdownBoxBG_OffSel[3];
4769 
4772  static GUI_RECT srcDropdownBoxBG[3];
4773 
4776  static GUI_RECT srcContentBG[9];
4777 
4780  static GUI_RECT srcPointer;
4781 
4782 public:
4783 
4786  struct DBI_Item
4787  {
4790  char text[256];
4791 
4795 
4799 
4803  };
4804 
4805 public: // Public data
4806 
4809  DBI_Item* mItems;
4810 
4813  int mItemCount;
4814 
4817  int mItemsSize;
4818 
4819 private: // Cache variables
4820 
4823  GUI_POINT mTextPoint;
4824 
4827  GUI_POINT mTextSize;
4828 
4831  GUI_POINT mPointerPos;
4832 
4835  GUI_RECT mTextRect;
4836 
4839  GUI_RECT mContentBG;
4840 
4843  FontObject* mFont;
4844 
4847  bool mIsOpen;
4848 
4851  bool mHovered;
4852 
4855  int mHoverId;
4856 
4859  ScrollAreaInfo mScroll;
4860 
4861 
4862 public: // Public configuration
4863 
4867 
4871 
4875 
4879 
4883 
4887 
4891 
4895 
4899 
4900 public: // Methods
4901 
4905 
4909 
4910 public:
4911 
4915  virtual const char* getClassName() { return "DropdownBoxInfo"; }
4916 
4922  const char* getItemText(int index);
4923 
4927  virtual void setFont(FontObject* pFont);
4928 
4932  virtual FontObject* getFont() { return mFont; }
4933 
4937  void addItem(const char* text);
4938 
4941  void clearItems();
4942 
4946  int getCount();
4947 
4950  void setSelectedItem(int iItemId);
4951 
4952 public:
4953 
4958 
4959 public:
4960 
4964  virtual void setIsOpen(bool bIsOpen);
4965 
4969  virtual bool getIsOpen();
4970 
4974  virtual void setSelected(int value);
4975 
4979  virtual void setHovered(int value);
4980 
4984  virtual bool isSelected();
4985 
4989  virtual bool isHovered();
4990 
4994  virtual bool isHoverable();
4995 
4999  virtual int getSelectableCount() { return 1; }
5000 
5004  virtual int getHoverableCount() { return 1; }
5005 
5006 public:
5011  virtual int processKeys();
5012 
5017  virtual int process(GUI_POINT mouse);
5018 
5022  virtual void calculate();
5023 
5026  virtual void render();
5027 
5031  virtual void importantRender();
5032 
5033 public: // Helper methods
5034 
5041  static int GetDropdownBoxHeight(FontObject* pFont = NULL, int iTextMargin = -1);
5042 };
5043 
5044 //------------------------------------------------------------------------------------------------------------
5045 
5049 {
5050 private:
5053  static GUI_RECT srcPanelLeft[9];
5054 
5057  static GUI_RECT srcPanelRight[9];
5058 
5059 private: // Cache variables
5060 
5063  FontObject* mFont;
5064 
5067  GUI_RECT mSpriteRect;
5068 
5071  GUI_RECT mLeftPanel;
5072 
5075  GUI_RECT mRightPanel;
5076 
5079  GUI_RECT mOldClipRect;
5080 
5083  bool isHovering;
5084 
5087  GuiBase* mGuiBaseList[6];
5088 
5089 public:
5090 
5094 
5098 
5102 
5106 
5110 
5114 
5115 public: // Public configuration
5116 
5122  void(*OnRenderSprite)(ColorPickerInfo* pGui, GUI_RECT pRect, GUI_COLOR pColor);
5123 
5127 
5131 
5134  int margin;
5135 
5136 public: // Methods
5137 
5141 
5145 
5146 public:
5147 
5151  virtual const char* getClassName() { return "ColorPickerInfo"; }
5152 
5156  virtual void setSelected(int value);
5157 
5161  virtual void setHovered(int value);
5162 
5166  virtual bool isSelected();
5167 
5171  virtual bool isHovered();
5172 
5176  virtual bool isHoverable();
5177 
5181  virtual int getSelectableCount();
5182 
5186  virtual int getHoverableCount();
5187 
5193  virtual GuiBase* getHoverable(int index);
5194 
5200  virtual GuiBase* getSelectable(int index);
5201 
5202 public:
5203 
5207  void updateColor(bool callback = true);
5208 
5209 public:
5210 
5214  virtual void setFont(FontObject* pFont);
5215 
5219  virtual FontObject* getFont() { return mFont; }
5220 
5225  virtual int process(GUI_POINT mouse);
5226 
5230  virtual void calculate();
5231 
5234  virtual void render();
5235 
5239  virtual void importantRender();
5240 };
5241 
5242 //------------------------------------------------------------------------------------------------------------
5243 
5247 {
5248 public:
5249 
5252  typedef void(*OnWindowDraggedFunc)(DraggableWindowInfo*);
5253 
5256  typedef void(*OnWindowCollapsedFunc)(DraggableWindowInfo*);
5257 
5260  typedef void(*OnWindowExpandedFunc)(DraggableWindowInfo*);
5261 
5264  typedef void(*OnWindowClosedFunc)(DraggableWindowInfo*);
5265 
5266 public:
5267 
5268  enum ActionType
5269  {
5270  ACTION_NONE,
5271  ACTION_HOVER_CLOSE,
5272  ACTION_HOVER_MINMAX,
5273  ACTION_CLICK_CLOSE,
5274  ACTION_CLICK_MINMAX,
5275  ACTION_DRAG,
5276  ACTION_RESIZE_LEFT,
5277  ACTION_RESIZE_TOP,
5278  ACTION_RESIZE_RIGHT,
5279  ACTION_RESIZE_BOTTOM,
5280  ACTION_RESIZE_BOTTOMLEFT,
5281  ACTION_RESIZE_BOTTOMRIGHT,
5282  ACTION_RESIZE_TOPLEFT
5283  };
5284 
5285 private:
5286 
5289  static unsigned int srcTextColor;
5290 
5291 private: // Cache variables
5292 
5295  GUI_POINT last_mouse_pos;
5296 
5299  GUI_RECT last_rect;
5300 
5303  bool using_lmb;
5304 
5305 public: // Draggable stuff
5306 
5309  CenteredTextInfo text;
5310 
5313  GUI_RECT rect_resize_width[2];
5314 
5317  GUI_RECT rect_resize_height[2];
5318 
5319 public: //
5320 
5323  GUI_RECT topRect;
5324 
5327  GUI_RECT bottomRect;
5328 
5331  GUI_RECT Button_Close;
5332 
5335  GUI_RECT Button_MinMax;
5336 
5339  bool is_collapsed;
5340 
5343  ActionType current_action;
5344 
5345 public: // Public configuration
5346 
5349  int margin;
5350 
5353  OnWindowDraggedFunc OnDragged;
5354 
5357  OnWindowDraggedFunc OnDragStart;
5358 
5361  OnWindowDraggedFunc OnDragEnd;
5362 
5365  OnWindowDraggedFunc OnResizeStart;
5366 
5369  OnWindowDraggedFunc OnResizing;
5370 
5373  OnWindowDraggedFunc OnResizeEnd;
5374 
5377  OnWindowCollapsedFunc OnCollapse;
5378 
5381  OnWindowExpandedFunc OnExpand;
5382 
5385  OnWindowClosedFunc OnClose;
5386 
5390 
5394 
5398 
5402 
5406 
5410 
5414 
5418 
5422 
5426 
5430 
5431 public: // Methods
5432 
5436 
5440 
5441 public:
5442 
5446  virtual const char* getClassName() { return "DraggableWindowInfo"; }
5447 
5451  inline bool isCollapsed() { return is_collapsed; }
5452 
5456  inline void setCollapsed(bool bValue) { is_collapsed = bValue; }
5457 
5461  void setText(const char* pValue);
5462 
5466  virtual void setSelected(int value);
5467 
5471  virtual void setHovered(int value);
5472 
5476  virtual bool isSelected();
5477 
5481  virtual bool isHovered();
5482 
5486  virtual bool isHoverable();
5487 
5491  virtual int getSelectableCount() { return 1; }
5492 
5496  virtual int getHoverableCount() { return 1; }
5497 
5498 public:
5499 
5503 
5507 
5511 
5515  virtual void setFont(FontObject* pFont);
5516 
5520  virtual FontObject* getFont() { return text.getFont(); }
5521 
5526  virtual int processKeys();
5527 
5532  virtual int process(GUI_POINT mouse);
5533 
5537 
5541  virtual void calculate();
5542 
5545  virtual void render();
5546 };
5547 
5548 //------------------------------------------------------------------------------------------------------------
5549 
5553 {
5554 private:
5555 
5558  FontObject* mFont;
5559 
5560 public:
5561 
5564  char text[128];
5565 
5566  GUI_POINT mTextPoint;
5567  GUI_POINT mTextSize;
5568  GUI_RECT mContentRect;
5569  GUI_POINT mLine_Top_1[2];
5570  GUI_POINT mLine_Top_2[2];
5571  GUI_POINT mLine_Left[2];
5572  GUI_POINT mLine_Right[2];
5573  GUI_POINT mLine_Bottom[2];
5574 
5575 public: // Methods
5576 
5580 
5584 
5585 public:
5586 
5590  virtual bool isHoverable();
5591 
5595  virtual int getSelectableCount() { return 0; }
5596 
5600  virtual int getHoverableCount() { return 0; }
5601 
5602 public:
5603 
5604  virtual void setSelected(int value) {}
5605  virtual void setHovered(int value) { }
5606  virtual bool isSelected() { return false; }
5607  virtual bool isHovered() { return false; }
5608  virtual int process(GUI_POINT) { return 0; }
5609 
5610 public:
5611 
5615  virtual const char* getClassName() { return "GroupBoxInfo"; }
5616 
5620  void fitRect(GUI_RECT content_rect, int margin = 0);
5621 
5625  virtual void setFont(FontObject* pFont) { mFont = pFont; }
5626 
5630  virtual FontObject* getFont() { return mFont; }
5631 
5635  virtual void calculate();
5636 
5639  virtual void render();
5640 };
5641 
5642 //------------------------------------------------------------------------------------------------------------
5643 
5647 {
5648 public:
5649 
5652  typedef void(*OnTabSelectedFunc)(TabBookInfo*, int);
5653 
5656  typedef void(*OnTabCloseFunc)(TabBookInfo*, int);
5657 
5658 private:
5659 
5662  static GUI_RECT srcSelectedTabButton_Normal[9];
5663 
5666  static GUI_RECT srcSelectedTabButton_Pressed[9];
5667 
5670  static GUI_RECT srcTabButton_Normal[9];
5671 
5674  static GUI_RECT srcTabButton_Pressed[9];
5675 
5678  static GUI_RECT srcTabButton_CloseButton[3];
5679 
5680 public:
5681 
5684  struct TAB
5685  {
5688  char text[64];
5689 
5693 
5697 
5701 
5705 
5709 
5713  };
5714 
5715 private: // Cache variables
5716 
5719  TAB* mItems;
5720 
5723  int mItemCount;
5724 
5727  FontObject* mFont;
5728 
5731  int mHoveredTab;
5732 
5735  bool mHoveredTab_Close;
5736 
5737 
5740  int mLargestTabHeight;
5741 
5742 public: // Public configuration
5743 
5747 
5750  OnTabSelectedFunc OnTabSelectCallback;
5751 
5754  OnTabCloseFunc OnTabCloseCallback;
5755 
5759 
5762  int mMargin;
5763 
5767 
5771 
5772 public: // Methods
5773 
5777 
5781 
5782 public:
5783 
5787  virtual const char* getClassName() { return "TabBookInfo"; }
5788 
5792  virtual void setFont(FontObject* pFont) { mFont = pFont; }
5793 
5797  virtual FontObject* getFont() { return mFont; }
5798 
5803  void addTab(const char* pTabText, bool bCanBeClosed = false);
5804 
5807  void clearTabs();
5808 
5813 
5819  TAB* getTab(int tab);
5820 
5821 public:
5822 
5826  inline void setHoveredOverCloseButton(bool bValue) { mHoveredTab_Close = bValue; }
5827 
5831  inline bool getHoveredOverCloseButton() { return mHoveredTab_Close; }
5832 
5836  virtual void setSelected(int value);
5837 
5841  virtual void setHovered(int value);
5842 
5846  void setCloseHovered(int value);
5847 
5851  virtual bool isSelected();
5852 
5856  virtual bool isHovered();
5857 
5861  virtual bool isHoverable();
5862 
5866  virtual int getSelectableCount();
5867 
5871  virtual int getHoverableCount();
5872 
5876  inline GUI_RECT getDrawRect() { return mTabContentRect; }
5877 
5878 public:
5879 
5884  virtual int processKeys();
5885 
5890  virtual int process(GUI_POINT mouse);
5891 
5895  virtual void calculate();
5896 
5899  virtual void render();
5900 };
5901 
5904 
5905 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
5906 
5910 {
5911 public:
5912 
5913  void* mUserData1;
5914  void* mUserData2;
5915  void* mUserData3;
5916  void(*mOnDrawFunc)(CustomDrawInfo* pUs, void* pUserData1, void* pUserData2, void* pUserData3);
5917  int mMinWidth;
5918  int mMinHeight;
5919 
5920 public:
5921 
5925 
5929 
5930 public:
5931 
5935  virtual const char* getClassName() { return "CustomDrawInfo"; }
5936 
5940  virtual void setSelected(int value);
5941 
5945  virtual void setHovered(int value);
5946 
5950  virtual bool isSelected();
5951 
5955  virtual bool isHovered();
5956 
5960  virtual bool isHoverable();
5961 
5962 public:
5967  virtual int process(GUI_POINT mouse);
5968 
5972  virtual void calculate();
5973 
5976  virtual void render();
5977 };
5978 
5979 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
5980 
5984 {
5985 private: // Private variables
5986 
5991 
5996 
6001 
6004  GUI_COLOR m_ColorMod;
6005 
6008  bool m_UseColorMod;
6009 
6010 public: // Public variables
6011 
6015 
6016 public:
6017 
6021 
6025 
6026 public:
6027 
6030  void Cleanup();
6031 
6038  bool LoadImage(const char* pImage);
6039 
6046  bool LoadImage(Surface_Ids eSurfId);
6047 
6051  void SetImageSourceRect(GUI_RECT* pSrcRect);
6052 
6056  void SetColorMod(GUI_COLOR* pColor);
6057 
6061  GUI_RECT GetImageSourceRect() { return m_SrcRect; }
6062 
6066  Surface_Ids GetSurfaceID() { return m_SurfID; }
6067 
6071  GUI_COLOR GetColorMod() { return m_ColorMod; }
6072 
6073 public:
6074 
6078  virtual const char* getClassName() { return "DrawBitmapInfo"; }
6079 
6083  virtual void setSelected(int value);
6084 
6088  virtual void setHovered(int value);
6089 
6093  virtual bool isSelected();
6094 
6098  virtual bool isHovered();
6099 
6103  virtual bool isHoverable();
6104 
6105 public:
6110  virtual int process(GUI_POINT mouse);
6111 
6115  virtual void calculate();
6116 
6119  virtual void render();
6120 };
6121 
6122 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
6123 
6127 {
6128 protected:
6129  static GUI_RECT m_TileRect;
6130 
6131 public:
6132  GUI_COLOR m_FillColor;
6133  GUI_COLOR m_BorderColor;
6134  GUI_RECT m_ContentRect;
6135 
6136 public:
6137 
6141 
6145 
6146 public:
6147 
6151  virtual const char* getClassName() { return "CaveStoryDialogBoxInfo"; }
6152 
6156  virtual void setSelected(int value);
6157 
6161  virtual void setHovered(int value);
6162 
6166  virtual bool isSelected();
6167 
6171  virtual bool isHovered();
6172 
6176  virtual bool isHoverable();
6177 
6178 public:
6179 
6185  virtual GUI_RECT getContentArea(int iMargin = 0);
6186 
6187 public:
6192  virtual int process(GUI_POINT mouse);
6193 
6197  virtual void calculate();
6198 
6201  virtual void render();
6202 };
6203 
6204 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
6205 
6207 struct SystemMenuItem;
6208 
6209 typedef void(*SystemMenuInfo_OnItemClickFunc)(SystemMenuInfo* pSMI, SystemMenuItem* pItem);
6210 
6214 {
6217  unsigned int ItemId;
6218 
6221  unsigned int TotalItemIndex;
6222 
6225  unsigned int ItemIndex;
6226 
6230 
6234 
6238 
6242 
6246 
6250 
6253  char Text[270];
6254 
6258 
6262 
6266 
6270 
6274 
6278 
6281  bool Disabled;
6282 
6285  bool Checked;
6286 
6289  SystemMenuInfo_OnItemClickFunc OnClicked;
6290 
6293  Input::KeyShortcut* Shortcut;
6294 
6297  char ShortcutText[64];
6298 };
6299 
6303 {
6304 private:
6305 
6308  static GUI_RECT srcDropdownBoxBG_Sel[3];
6309 
6312  static GUI_RECT srcDropdownBoxBG_Off[3];
6313 
6316  static GUI_RECT srcDropdownBoxBG_OffSel[3];
6317 
6320  static GUI_RECT srcDropdownBoxBG[3];
6321 
6324  static GUI_RECT srcContentBG[9];
6325 
6326 private: // Cache variables
6327 
6330  SystemMenuItem** mItemList;
6331 
6334  int mItemCount;
6335 
6338  SystemMenuItem** mTotalItemList;
6339 
6342  int mTotalItemCount;
6343 
6346  SystemMenuItem** mItemShortcutList;
6347 
6350  int mItemShortcutCount;
6351 
6354  FontObject* mFont;
6355 
6358  bool mHovered;
6359 
6362  bool mUsedKeyboard;
6363 
6366  unsigned int mTimeHovered;
6367 
6370  SystemMenuItem* mCurrentlyOpen;
6371 
6374  SystemMenuItem* mCurrentlyHovered;
6375 
6378  SystemMenuItem* mLastHovered;
6379 
6382  bool mRecentlyCleared;
6383 
6384 public: // Public configuration
6385 
6386  struct
6387  {
6390  unsigned long text_normal;
6391 
6394  unsigned long submenu_itembg_hovered;
6395 
6399 
6402  unsigned long background;
6403  } mColors;
6404 
6408 
6409 public: // Methods
6410 
6414 
6418 
6419 protected: // Memory methods
6420 
6426 
6427 public:
6428 
6432  virtual const char* getClassName() { return "SystemMenuInfo"; }
6433 
6437  inline void setFont(FontObject* pFont) { mFont = pFont; }
6438 
6446  SystemMenuItem* AddItem(int iItemId, const char* pText, SystemMenuItem* pParent = NULL, Input::KeyShortcut* pShortcut = NULL);
6447 
6453  SystemMenuItem* GetItemByText(const char* pText);
6454 
6461 
6468 
6473 
6476  void ClearItems();
6477 
6480  void DumpItems();
6481 
6482 public:
6483 
6487  virtual void setSelected(int value);
6488 
6492  virtual void setHovered(int value);
6493 
6497  virtual bool isSelected();
6498 
6502  virtual bool isHovered();
6503 
6507  virtual bool isHoverable();
6508 
6512  virtual int getSelectableCount() { return 1; }
6513 
6517  virtual int getHoverableCount() { return 1; }
6518 
6519 public:
6520 
6524 
6529  virtual int processKeys();
6530 
6535  virtual int process(GUI_POINT mouse);
6536 
6537 protected:
6538 
6544 
6545 public:
6546 
6549  void closeMenu();
6550 
6551 public:
6552 
6556  virtual void calculate();
6557 
6560  virtual void render();
6561 
6565  virtual void importantRender();
6566 };
6567 
6568 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
6569 
6573 {
6574 public: // Structs
6575 
6579  {
6582  int index;
6583 
6587 
6591 
6595 
6598  int id;
6599 
6602  char* text;
6603 
6607  };
6608 
6609 protected: // Cache variables
6610 
6614  FontObject* mFont;
6615 
6618  List<SEL_LIST_ENTRY*> mEntries;
6619 
6623 
6627 
6631 
6635 
6638  bool mDirty;
6639 
6643 
6647 
6648 public: // Configuration
6649 
6653 
6657 
6661 
6665 
6669 
6673 
6676  int mMargin;
6677 
6681 
6682 public:
6683 
6687 
6690 
6691 public:
6692 
6696  virtual const char* getClassName() { return "SelectableListInfo"; }
6697 
6701  virtual void setSelected(int value);
6702 
6706  virtual void setHovered(int value);
6707 
6711  virtual bool isSelected();
6712 
6716  virtual bool isHovered();
6717 
6721  virtual bool isHoverable();
6722 
6726  virtual int getSelectableCount() { return 1; }
6727 
6731  virtual int getHoverableCount() { return 1; }
6732 
6736  virtual bool SelectOnMouseUp() { return false; }
6737 
6738 public:
6742  virtual void setFont(FontObject* pFont) { mFont = pFont; }
6743 
6744 public:
6745 
6752  bool AddEntry(int iSelectionId, const char* pText);
6753 
6757 
6762 
6766  GUI_RECT GetEntryRectById(int iSelectedId, bool bUseScrolled = false);
6767 
6772  void SetScrollOffset(int iOffsetX, int iOffsetY);
6773 
6778 
6779 public:
6784  virtual int process(GUI_POINT mouse);
6785 
6789  virtual void calculate();
6790 
6793  virtual void render();
6794 };
6795 
6796 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
6797 
6801 {
6805 
6809 
6813 
6817 
6821 
6825 
6829 
6832  unsigned char mDirect;
6833 
6836  struct
6837  {
6840  unsigned int ent_bits_mask;
6841 
6845 
6850 
6854  {
6855  mConfig.ent_bits_mask = 0;
6856  mConfig.hit_slopes = true;
6857  mConfig.hit_entities = false;
6858  }
6859 };
6860 
6861 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
6862 
6864 {
6865  int tile_index;
6866  unsigned short new_tile_id;
6867  unsigned short old_tile_id;
6868 
6869  inline bool operator==(const MAP_CHANGED_TILE& other) const { return tile_index == other.tile_index; }
6870  inline bool operator!=(const MAP_CHANGED_TILE& other) const { return tile_index != other.tile_index; }
6871  inline bool operator< (const MAP_CHANGED_TILE& other) const { return tile_index < other.tile_index; }
6872  inline bool operator<=(const MAP_CHANGED_TILE& other) const { return tile_index <= other.tile_index; }
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 
6877  {
6878  tile_index = 0;
6879  new_tile_id = 0;
6880  old_tile_id = 0;
6881  }
6882 
6883  MAP_CHANGED_TILE(int index)
6884  {
6885  MAP_CHANGED_TILE();
6886 
6887  tile_index = index;
6888  }
6889 };
6890 
6891 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
6892 
6893 #define MAP_MAX_ZONES 0x7FFFFFFF
6894 
6899 {
6900 public:
6903  int id;
6904 
6908  {
6911  int x;
6912 
6915  int y;
6916 
6919  int w;
6920 
6923  int h;
6924  } rect;
6925 
6928  int used;
6929 
6933 
6934 private: // Data
6935 
6938  void* tables_struct;
6939 
6940 public:
6941 
6945 
6949 
6950 public: // General
6953  void Init();
6954 
6957  void Free();
6958 
6959 public: // NPC Management
6963  void AddNpChar(NPCHAR* npc);
6964 
6968  void RemoveNpChar(NPCHAR* npc);
6969 
6973 
6976  void ActNpChar();
6977 
6980  void PutNpChar(int frame_x, int frame_y);
6981 
6987  bool HasNpChar(NPCHAR* npc);
6988 
6989 public: // Boss Management
6993  void AddBoss(NPCHAR* npc);
6994 
6998  void RemoveBoss(NPCHAR* npc);
6999 
7003 
7006  void ActBoss();
7007 
7010  void PutBoss(int frame_x, int frame_y);
7011 
7017  bool HasBoss(NPCHAR* npc);
7018 };
7019 
7020 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
7021 
7025 {
7029 
7032  unsigned int tile_offset;
7033 
7037 
7041 
7044  unsigned char rect_count;
7045 
7048  unsigned short wait;
7049 
7050  // **--** RUNTIME CACHE VARIABLES **--**
7051 
7054  unsigned char frame;
7055 
7058  unsigned char timer;
7059 
7063 
7067 
7071 };
7072 
7073 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
7074 
7077 struct MAP_DATA
7078 {
7081  unsigned short* data;
7082 
7085  unsigned short* ngdata;
7086 
7089  unsigned char atrb[0x10001]; //Why is this 257 bytes?
7090 
7093  short width;
7094 
7097  short length;
7098 
7102 
7106 
7110 
7114 
7118 
7122 
7125  unsigned int crc;
7126 
7130 };
7131 
7132 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
7133 
7140 typedef void(*PlayerState_ActFuncType)(BOOL bKey, SafeClientInterface* pInterface, MYCHAR* pMC, const MYCHAR_PHYSICS* pPhysics);
7141 
7149 typedef unsigned int(*PlayerState_AnimFuncType)(BOOL bKey, MYCHAR* pMC, SafeClientInterface* pInterface);
7150 
7157 typedef void(*PlayerState_DrawFuncType)(int iFrameX, int iFrameY, MYCHAR* pMC, SafeClientInterface* pInterface);
7158 
7159 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
7160 
7164 {
7167  bool Used;
7168 
7172 
7176 
7179  unsigned char NetSize;
7180 
7183  bool Ranged;
7184 
7188 
7192 };
7193 
7197 {
7200  char* StateName;
7201 
7209 
7218 
7226 
7230 
7234  unsigned long long int Flags;
7235 
7239  unsigned int TransmitFlags;
7240 
7244 
7248 };
7249 
7253 {
7256  char* name;
7257 
7261 
7264  unsigned int user_ident_hash[5];
7265 
7269 };
7270 
7274 {
7277  char window_title[260];
7278 
7281  char window_guifile[260];
7282 
7285  int margin;
7286 
7290 
7294 
7298 
7302 
7306 
7310 
7314 
7318 
7322 
7326 
7327 #ifdef _DEBUG
7330  unsigned char debug;
7331 #endif
7332 
7336 
7340 };
7341 
7345 {
7349 
7352  char* data;
7353 };
7354 
7355 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
7356 
7365 static RECT RECT_XYWH(int x, int y, int w, int h)
7366 {
7367  RECT ret;
7368  ret.left = x;
7369  ret.top = y;
7370  ret.right = x + w;
7371  ret.bottom = y + h;
7372  return ret;
7373 }
7374 
7375 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
7376 
7384 (
7387 );
7388 
7393 typedef void(*CSM_Weapon_ShootFunc)
7394 (
7395  ShootInfo* sData,
7396  int iLevel
7397 );
7398 
7403 typedef void(*CSM_Bullet_ActFunc)
7404 (
7405  BULLET* pBul,
7406  int iLevel
7407 );
7408 
7412 typedef void(*CSM_Npc_ActFunc)
7413 (
7414  NPCHAR* pNpc
7415 );
7416 
7420 typedef void(*CSM_Caret_ActFunc)
7421 (
7422  CARET* caret
7423 );
7424 
7425 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
7426 
7427 extern CAVESTORY_MOD_API MYCHAR gMC;
7428 extern CAVESTORY_MOD_API MYCHAR gNOT_USED;
7429 extern CAVESTORY_MOD_API NPCHAR gNPC[NPC_MAX];
7430 extern CAVESTORY_MOD_API CARET gCrt[CARET_MAX];
7431 extern CAVESTORY_MOD_API int gKey;
7432 extern CAVESTORY_MOD_API int gKeyTrg;
7433 extern CAVESTORY_MOD_API int gKeyOld;
7434 
7435 extern CAVESTORY_MOD_API int gKeyJump;
7436 extern CAVESTORY_MOD_API int gKeyShot;
7437 extern CAVESTORY_MOD_API int gKeyArms;
7438 extern CAVESTORY_MOD_API int gKeyArmsRev;
7439 extern CAVESTORY_MOD_API int gKeyItem;
7440 extern CAVESTORY_MOD_API int gKeyMap;
7441 extern CAVESTORY_MOD_API int gKeyOk;
7442 extern CAVESTORY_MOD_API int gKeyCancel;
7443 extern CAVESTORY_MOD_API int gKeyLeft;
7444 extern CAVESTORY_MOD_API int gKeyUp;
7445 extern CAVESTORY_MOD_API int gKeyRight;
7446 extern CAVESTORY_MOD_API int gKeyDown;
7447 extern CAVESTORY_MOD_API int gKeyMaxVal;
7448 
7449 extern CAVESTORY_MOD_API int gKey2;
7450 extern CAVESTORY_MOD_API int gKeyTrg2;
7451 extern CAVESTORY_MOD_API int gKeyOld2;
7452 
7453 extern CAVESTORY_MOD_API int gKey_JOY;
7454 extern CAVESTORY_MOD_API int gKeyTrg_JOY;
7455 extern CAVESTORY_MOD_API int gKeyOld_JOY;
7456 
7457 extern CAVESTORY_MOD_API void GetTrg();
7458 
7459 extern CAVESTORY_MOD_API int gStageNo;
7460 extern CAVESTORY_MOD_API int gMusicNo;
7461 extern CAVESTORY_MOD_API int g_GameFlags;
7462 
7463 extern CAVESTORY_MOD_API TEXT_SCRIPT_PTR_DATA default_TextScriptPtrData;
7464 extern CAVESTORY_MOD_API TEXT_SCRIPT_PTR_DATA gCurrentPtrData;
7465 extern CAVESTORY_MOD_API TEXT_SCRIPT gTS;
7466 extern CAVESTORY_MOD_API List<TEXT_SCRIPT_CALLSTACK_DATA>* gTS_CallStack;
7467 
7468 extern CAVESTORY_MOD_API int gCollectableCount;
7469 extern CAVESTORY_MOD_API bool gCollectablesShown;
7470 
7471 extern CAVESTORY_MOD_API MAP_DATA gMap;
7472 
7473 //----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------//
7474 
7475 #include "CSMAPI_endcode.h"
CSM_ClientRanks
All possible values for a client's mAdminRank.
Definition: CSMAPI_enums.h:1451
@ 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:1119
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
PlayerStateAnimator_OutputType
A list of output types for a player state's "ANIMATE" function.
Definition: CSMAPI_enums.h:1203
TextScriptTarget
The TextScript's target.
Definition: CSMAPI_enums.h:1045
CSM_RankedClientInfoType
Ranked client type.
Definition: CSMAPI_enums.h:1389
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:7384
void(* PlayerState_DrawFuncType)(int iFrameX, int iFrameY, MYCHAR *pMC, SafeClientInterface *pInterface)
The draw function for this player state.
Definition: CSMAPI_types.h:7157
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:7413
void(* PlayerState_ActFuncType)(BOOL bKey, SafeClientInterface *pInterface, MYCHAR *pMC, const MYCHAR_PHYSICS *pPhysics)
The act function for this player state.
Definition: CSMAPI_types.h:7140
void(* CSM_Caret_ActFunc)(CARET *caret)
Called every frame a caret is active.
Definition: CSMAPI_types.h:7421
unsigned int(* PlayerState_AnimFuncType)(BOOL bKey, MYCHAR *pMC, SafeClientInterface *pInterface)
The animation function for this player state.
Definition: CSMAPI_types.h:7149
void(* CSM_Bullet_ActFunc)(BULLET *pBul, int iLevel)
Called every frame a bullet is active.
Definition: CSMAPI_types.h:7404
void(* CSM_Weapon_ShootFunc)(ShootInfo *sData, int iLevel)
Called every frame a weapon is equipped, for every client.
Definition: CSMAPI_types.h:7394
Show a clickable button.
Definition: CSMAPI_types.h:4595
int margin
Text margin.
Definition: CSMAPI_types.h:4654
virtual void calculate()
Re-calculate this element's data.
bool isDisabled
Whether this button is disabled or not.
Definition: CSMAPI_types.h:4662
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:4650
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:4714
virtual int getSelectableCount()
Get the selectable number of elements in this element.
Definition: CSMAPI_types.h:4709
virtual void render()
Render this element.
virtual FontObject * getFont()
Get this element's font.
Definition: CSMAPI_types.h:4726
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:4721
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:4679
OnButtonPressedFunc OnClicked
On press callback.
Definition: CSMAPI_types.h:4658
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:6127
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:6151
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:2961
bool mCenterHorizontal
Vertical center align.
Definition: CSMAPI_types.h:3016
unsigned int mTextColor_RGB
Text color RGB.
Definition: CSMAPI_types.h:2967
virtual int process(GUI_POINT mouse)
Process mouse input for this element.
bool mCenterVertical
Vertical center align.
Definition: CSMAPI_types.h:3012
virtual bool isSelected()
Check selection status.
FontObject * mFont
Font for this element.
Definition: CSMAPI_types.h:2972
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:2977
GUI_POINT mTextPoint
Text point for this element.
Definition: CSMAPI_types.h:2989
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:3030
virtual void setFont(FontObject *pFont)
Set this element's font.
Definition: CSMAPI_types.h:3061
int getLineLength(int index)
Check line length.
GUI_POINT mTextSize
The size of the text.
Definition: CSMAPI_types.h:2994
FontObject * getFont()
Get this element's font.
Definition: CSMAPI_types.h:3066
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:3103
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:3008
GUI_COLOR mTextColor
The text color.
Definition: CSMAPI_types.h:2998
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:4282
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:4306
~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:4302
bool mValue
Whether this checkbox is enabled or not.
Definition: CSMAPI_types.h:4294
virtual void render()
Render this element.
int mRadioGroup
Radio group ID.
Definition: CSMAPI_types.h:4298
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:4353
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:4323
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:4358
CheckBoxInfo()
Default constructor.
Several combined GUI elements to form a color picker.
Definition: CSMAPI_types.h:5049
virtual int getSelectableCount()
Get the selectable number of elements in this element.
int margin
Item margin.
Definition: CSMAPI_types.h:5134
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:5130
GUI_POINT spriteSize
The sprite size to accomadate for when calling OnRenderSprite()
Definition: CSMAPI_types.h:5126
ColorPickerInfo()
Default constructor.
SliderIntInfo mSlider_Blue
Blue slider.
Definition: CSMAPI_types.h:5101
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:5219
SliderIntInfo mSlider_Green
Green slider.
Definition: CSMAPI_types.h:5097
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:5105
SliderIntInfo mSlider_Red
Red slider.
Definition: CSMAPI_types.h:5093
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:5151
virtual bool isHoverable()
Check hoverability status.
TextInputInfo mEdit_Green
Green value textbox.
Definition: CSMAPI_types.h:5109
TextInputInfo mEdit_Blue
Blue value textbox.
Definition: CSMAPI_types.h:5113
Custom draw GUI element.
Definition: CSMAPI_types.h:5910
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:5935
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:5247
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:5365
GUI_RECT valid_drag_rect
The valid rect that this window can be dragged to.
Definition: CSMAPI_types.h:5429
OnWindowDraggedFunc OnDragStart
On drag start callback.
Definition: CSMAPI_types.h:5357
GUI_RECT getContentArea()
Get the area that content goes in.
bool isCollapsed()
Check to see if this window is collapsed.
Definition: CSMAPI_types.h:5451
GUI_RECT content_rect
The rect at which the window's contents should be at.
Definition: CSMAPI_types.h:5413
bool can_resize_width
Whether the width of this window can be resized.
Definition: CSMAPI_types.h:5401
OnWindowDraggedFunc OnResizeEnd
On resize end callback.
Definition: CSMAPI_types.h:5373
bool can_resize_height
Whether the height of this window can be resized.
Definition: CSMAPI_types.h:5405
GUI_POINT collapse_position
The point at which the window is collapsed at.
Definition: CSMAPI_types.h:5417
OnWindowDraggedFunc OnResizing
On resizing callback.
Definition: CSMAPI_types.h:5369
bool show_button_close
Show the close button.
Definition: CSMAPI_types.h:5389
void setCollapsed(bool bValue)
Set whether this window is collapsed.
Definition: CSMAPI_types.h:5456
OnWindowCollapsedFunc OnCollapse
On collapse callback.
Definition: CSMAPI_types.h:5377
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:5385
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:5421
void setContentSize(GUI_POINT pSize)
Set the content size of this window.
OnWindowExpandedFunc OnExpand
On expand callback.
Definition: CSMAPI_types.h:5381
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:5446
void calculateTop()
Calculate the top.
bool show_button_minmax
Show the minmax button.
Definition: CSMAPI_types.h:5393
virtual FontObject * getFont()
Get the font for this GUI element.
Definition: CSMAPI_types.h:5520
int margin
The text margin for this object.
Definition: CSMAPI_types.h:5349
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:5409
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:5361
bool is_draggable
Whether this window is draggable or not.
Definition: CSMAPI_types.h:5397
virtual int getSelectableCount()
Get the selectable number of elements in this element.
Definition: CSMAPI_types.h:5491
virtual void calculate()
Re-calculate this element's data.
OnWindowDraggedFunc OnDragged
On drag callback.
Definition: CSMAPI_types.h:5353
virtual int getHoverableCount()
Get the number of elements that can be hovered over in this element.
Definition: CSMAPI_types.h:5496
GUI_POINT min_content_size
The minimum content size this window can have.
Definition: CSMAPI_types.h:5425
Custom draw GUI element.
Definition: CSMAPI_types.h:5984
~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:6000
Surface_Ids m_SurfID
The loaded surface's ID.
Definition: CSMAPI_types.h:5995
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:6066
void SetColorMod(GUI_COLOR *pColor)
Set the modulation color.
DrawBitmapInfo()
Default constructor.
GUI_COLOR GetColorMod()
Get the modulation color.
Definition: CSMAPI_types.h:6071
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:6078
GUI_RECT GetImageSourceRect()
Get the image's source rect.
Definition: CSMAPI_types.h:6061
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:5990
bool m_Stretch
Stretch the image along with this object's rect.
Definition: CSMAPI_types.h:6014
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:4755
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:4894
GUI_RECT containing_rect
Containing rect.
Definition: CSMAPI_types.h:4866
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:4898
DropdownBoxInfo()
Default constructor.
~DropdownBoxInfo()
Default deconstructor.
virtual FontObject * getFont()
Get the font for this GUI element.
Definition: CSMAPI_types.h:4932
void clearItems()
Clear all items.
bool mDisabled
Whether this element is disabled or not.
Definition: CSMAPI_types.h:4886
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:4878
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:4915
GUI_COLOR mText_Normal
The color of the text when the element is normal.
Definition: CSMAPI_types.h:4874
GUI_COLOR mText_NotSelected
The color of the text when the element is not selected.
Definition: CSMAPI_types.h:4882
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:4870
void addItem(const char *text)
Add an item to the list.
int mTextMargin
Text margin.
Definition: CSMAPI_types.h:4890
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:4999
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:5004
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:5553
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:5615
virtual bool isSelected()
Check selection status.
Definition: CSMAPI_types.h:5606
~GroupBoxInfo()
Default deconstructor.
virtual void setFont(FontObject *pFont)
Set this element's font.
Definition: CSMAPI_types.h:5625
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:5604
virtual void render()
Render this element.
virtual int getSelectableCount()
Get the selectable number of elements in this element.
Definition: CSMAPI_types.h:5595
virtual int getHoverableCount()
Get the number of elements that can be hovered over in this element.
Definition: CSMAPI_types.h:5600
virtual bool isHoverable()
Check hoverability status.
virtual bool isHovered()
Check hover status.
Definition: CSMAPI_types.h:5607
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:5630
virtual void setHovered(int value)
Set this GUI element as hovered over or not.
Definition: CSMAPI_types.h:5605
virtual int process(GUI_POINT)
Process mouse input for this element.
Definition: CSMAPI_types.h:5608
The base class for GUI elements.
Definition: CSMAPI_types.h:2713
virtual FontObject * getFont()
Get the font for this GUI element.
Definition: CSMAPI_types.h:2913
virtual GuiBase * getHoverable(int index)
Get a hoverable sub-element.
Definition: CSMAPI_types.h:2889
virtual bool SelectOnMouseUp()
Select on mouse up.
Definition: CSMAPI_types.h:2901
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:2797
virtual void importantRender()
Render the important bits of this element.
Definition: CSMAPI_types.h:2942
unsigned int customMagnification
The magnification to display this element at.
Definition: CSMAPI_types.h:2779
virtual int processKeys()
Process key input for this element.
Definition: CSMAPI_types.h:2937
GUI_RECT hotspot_rect
The special hotspot rect.
Definition: CSMAPI_types.h:2793
bool has_special_mouse_processing
Has special mouse processing.
Definition: CSMAPI_types.h:2789
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:2896
virtual int getHoverableCount()
Get the number of elements that can be hovered over in this element.
Definition: CSMAPI_types.h:2882
OnHoverChangeCallbackFunc OnHoverChange
Called in specific GuiBase children classes to indicate that the GUI element is being hovered over.
Definition: CSMAPI_types.h:2785
virtual int getSelectableCount()
Get the selectable number of elements in this element.
Definition: CSMAPI_types.h:2877
virtual ~GuiBase()
Default deconstructor.
Definition: CSMAPI_types.h:2821
GuiBase()
Default constructor.
Definition: CSMAPI_types.h:2803
OnValidateChangeCallbackFunc OnValidateChange
Called in specific GuiBase children classes to indicate that a value has been changed.
Definition: CSMAPI_types.h:2763
virtual void setSelected(int value)=0
Set this GUI element as selected or not.
void * userData2
Custom user data.
Definition: CSMAPI_types.h:2775
OnValueChangeCallbackFunc OnValueChange
Called in specific GuiBase children classes to indicate that a value has been changed.
Definition: CSMAPI_types.h:2759
virtual void setFont(FontObject *pFont)
Set the font for this GUI element.
Definition: CSMAPI_types.h:2908
virtual void setHovered(int value)=0
Set this GUI element as hovered over or not.
void * userData
Custom user data.
Definition: CSMAPI_types.h:2771
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:2841
GUI_RECT rect
The display rect this GUI element will use.
Definition: CSMAPI_types.h:2767
ProcessReturnType
Return flags for GuiBase::process and GuiBase::processKeys.
Definition: CSMAPI_types.h:2728
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:4043
virtual int getHoverableCount()
Get the number of elements that can be hovered over in this element.
Definition: CSMAPI_types.h:4211
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:4147
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:4216
CANCEL_KEY_TYPE mCancelKey
Which cancel key was pressed to lose focus.
Definition: CSMAPI_types.h:4151
virtual int getSelectableCount()
Get the selectable number of elements in this element.
Definition: CSMAPI_types.h:4206
int * m_PtrKeyValue
Pointer key value.
Definition: CSMAPI_types.h:4143
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:4049
@ ESCAPE
Escape button.
Definition: CSMAPI_types.h:4055
@ ENTER
Enter button todo: Make pressing enter call a callback.
Definition: CSMAPI_types.h:4052
~KeyInputInfo()
Default deconstructor.
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:4176
virtual int process(GUI_POINT mouse)
Process mouse input for this element.
int margin
Text margin.
Definition: CSMAPI_types.h:4159
void stopInput(bool bSaveValue=true)
Stop inputting text.
virtual FontObject * getFont()
Get the font for this GUI element.
Definition: CSMAPI_types.h:4240
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:4155
virtual void render()
Render this element.
virtual void setSelected(int value)
Set this GUI element as selected or not.
Text.
Definition: CSMAPI_types.h:3127
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:3153
virtual void setFont(FontObject *pFont)
Set this element's font.
Definition: CSMAPI_types.h:3216
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:3133
virtual void render()
Render this element.
bool mJustifyRight
Whether to justify this text to the right or not.
Definition: CSMAPI_types.h:3171
virtual FontObject * getFont()
Get the font for this GUI element.
Definition: CSMAPI_types.h:3221
GUI_COLOR mOutlineColor
The outline color.
Definition: CSMAPI_types.h:3163
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:3185
virtual int process(GUI_POINT mouse)
Process mouse input for this element.
unsigned int mOutlineColor_RGB
Text color RGB.
Definition: CSMAPI_types.h:3138
int mOutlineWidth
The outline width.
Definition: CSMAPI_types.h:3167
FontObject * mFont
Font for this element.
Definition: CSMAPI_types.h:3143
virtual bool isSelected()
Check selection status.
const char * getText()
Get the text of this element.
Definition: CSMAPI_types.h:3232
GUI_COLOR mTextColor
The text color.
Definition: CSMAPI_types.h:3159
LabelInfo()
Default constructor.
A map zone to be used for network optimization.
Definition: CSMAPI_types.h:6899
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:6903
void ActBoss()
Think tick all npcs.
int used
'Use' count for this zone
Definition: CSMAPI_types.h:6928
int soft_npc_count
deprectated
Definition: CSMAPI_types.h:6932
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:3401
void fitIntoContent(GUI_POINT p)
Fit the point into the content.
bool isScrolling()
Check if this element is being scrolled.
Definition: CSMAPI_types.h:3605
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:3583
int scrollBarHandleMinSize
Scroll bar handle minimum size (width for horizontal scrollbar, width for vertical scrollbar)
Definition: CSMAPI_types.h:3575
GUI_POINT getOffset()
Get the scroll offsets.
bool drawBorder
Draw scroll border.
Definition: CSMAPI_types.h:3555
GUI_POINT mouseWheelScroll
Amount of scroll on mousewheel movement for both X and Y.
Definition: CSMAPI_types.h:3591
int scrollBarSize
The size of the scrollbar (height for the horizontal scrollbar, width for the vertical scrollbar)
Definition: CSMAPI_types.h:3567
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:3473
@ SCROLL_X
User is scrolling the bottom (horizontal) scrollbar.
Definition: CSMAPI_types.h:3478
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:3559
GUI_POINT contentSize
Size of the content area.
Definition: CSMAPI_types.h:3587
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:3547
ScrollAreaInfo()
Default constructor.
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:3615
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:3551
virtual bool isHovered()
Check hover status.
int scrollBarHandleMargin
Scroll bar handle margin.
Definition: CSMAPI_types.h:3571
OnScrollCallbackFunc OnScroll
Called when this element's scroll amount changes.
Definition: CSMAPI_types.h:3543
bool showScrollY
Show the vertical scrollbar.
Definition: CSMAPI_types.h:3563
GUI_RECT getVerticalScrollBar()
Calculate the rect for the vertical scroll bar.
HoverType
Scroll hover type.
Definition: CSMAPI_types.h:3456
@ HOVER_BUTTON_1
Left / Up arrow button.
Definition: CSMAPI_types.h:3461
@ HOVER_HANDLE
Scroll handle.
Definition: CSMAPI_types.h:3464
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:3579
virtual void render()
Render this element.
Text.
Definition: CSMAPI_types.h:3256
virtual void setFont(FontObject *pFont)
Set this element's font.
Definition: CSMAPI_types.h:3361
GUI_COLOR mColor_BG_Normal
The normal background color.
Definition: CSMAPI_types.h:3285
virtual bool SelectOnMouseUp()
Select on mouse up.
Definition: CSMAPI_types.h:3355
void setText(const char *text)
Set the text of this element.
FontObject * mFont
Font for this element.
Definition: CSMAPI_types.h:3262
GUI_COLOR mColor_BG_Hover
The hovered background color.
Definition: CSMAPI_types.h:3289
virtual void calculate()
Re-calculate this element's data.
bool mHovered
If this is being hovered over.
Definition: CSMAPI_types.h:3301
virtual int process(GUI_POINT mouse)
Process mouse input for this element.
GUI_COLOR mColor_Text_Normal
The text color.
Definition: CSMAPI_types.h:3273
virtual bool isHovered()
Check hover status.
GUI_COLOR mColor_Text_Hover
The text color when hovered over.
Definition: CSMAPI_types.h:3277
virtual int getHoverableCount()
Get the number of elements that can be hovered over in this element.
Definition: CSMAPI_types.h:3350
virtual int getSelectableCount()
Get the selectable number of elements in this element.
Definition: CSMAPI_types.h:3345
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:3281
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:3366
SelectableLabelInfo()
Default constructor.
const char * getText()
Get the text of this element.
Definition: CSMAPI_types.h:3377
bool mSelected
The type of selection we're dealing with.
Definition: CSMAPI_types.h:3297
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:3315
GUI_COLOR mColor_BG_Selected
The selected background color.
Definition: CSMAPI_types.h:3293
Text.
Definition: CSMAPI_types.h:6573
int GetSelectedEntry()
Retrieve the selected entry.
virtual bool isSelected()
Check selection status.
int mScrollY
The scroll Y offset.
Definition: CSMAPI_types.h:6626
bool mAllowRightClick
Allow right click selection.
Definition: CSMAPI_types.h:6680
void ClearAllEntries()
Clear all entries.
virtual int getSelectableCount()
Get the selectable number of elements in this element.
Definition: CSMAPI_types.h:6726
List< SEL_LIST_ENTRY * > mEntries
Stores all entries for this element.
Definition: CSMAPI_types.h:6618
GUI_POINT GetContentSze()
Get the entire content size.
int mScrollX
The scroll X offset.
Definition: CSMAPI_types.h:6622
virtual void calculate()
Re-calculate this element's data.
SEL_LIST_ENTRY * mShownLink
A link of shown entries.
Definition: CSMAPI_types.h:6642
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:6638
virtual int getHoverableCount()
Get the number of elements that can be hovered over in this element.
Definition: CSMAPI_types.h:6731
virtual bool isHoverable()
Check hoverability status.
GUI_COLOR mColor_BG_Hover
The hovered background color.
Definition: CSMAPI_types.h:6668
virtual bool isHovered()
Check hover status.
GUI_POINT mContentSize
Content size.
Definition: CSMAPI_types.h:6646
virtual bool SelectOnMouseUp()
Select on mouse up.
Definition: CSMAPI_types.h:6736
int mMargin
Entry margin.
Definition: CSMAPI_types.h:6676
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:6696
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:6652
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:6742
~SelectableListInfo()
Default deconstructor.
int mSelected
The selected entry.
Definition: CSMAPI_types.h:6634
GUI_COLOR mColor_Text_Selected
The text color when selected.
Definition: CSMAPI_types.h:6660
int mHovered
The highlighted entry.
Definition: CSMAPI_types.h:6630
GUI_COLOR mColor_BG_Normal
The normal background color.
Definition: CSMAPI_types.h:6664
GUI_COLOR mColor_Text_Hover
The text color when hovered over.
Definition: CSMAPI_types.h:6656
FontObject * mFont
Font for this element.
Definition: CSMAPI_types.h:6614
GUI_COLOR mColor_BG_Selected
The selected background color.
Definition: CSMAPI_types.h:6672
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:4400
int getValue()
Get the value.
virtual int getSelectableCount()
Get the selectable number of elements in this element.
Definition: CSMAPI_types.h:4528
virtual bool SelectOnMouseUp()
Select on mouse up.
Definition: CSMAPI_types.h:4538
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:4481
virtual void importantRender()
Render the important bits of this element.
float mValue
The selected number.
Definition: CSMAPI_types.h:4465
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:4498
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:4477
void setValue(int val)
Set the value.
virtual void setFont(FontObject *pFont)
Set this element's font.
Definition: CSMAPI_types.h:4556
virtual bool isSelected()
Check selection status.
virtual FontObject * getFont()
Get the font for this GUI element.
Definition: CSMAPI_types.h:4561
float mMin
The minimum value.
Definition: CSMAPI_types.h:4473
float mMax
The maximum value.
Definition: CSMAPI_types.h:4469
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:4533
Show a dropdown box.
Definition: CSMAPI_types.h:6303
virtual bool isSelected()
Check selection status.
unsigned long background
Background color.
Definition: CSMAPI_types.h:6402
virtual void importantRender()
Render the important bits of this element.
int mItemMargin
Item margin.
Definition: CSMAPI_types.h:6407
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:6517
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:6437
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:6432
virtual void render()
Render this element.
virtual int getSelectableCount()
Get the selectable number of elements in this element.
Definition: CSMAPI_types.h:6512
unsigned long text_normal
Normal text color.
Definition: CSMAPI_types.h:6390
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:6398
unsigned long submenu_itembg_hovered
Item background's color when hovered over.
Definition: CSMAPI_types.h:6394
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:5647
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:5831
OnTabSelectedFunc OnTabSelectCallback
The 'on tab selection' callback.
Definition: CSMAPI_types.h:5750
virtual void setFont(FontObject *pFont)
Set this element's font.
Definition: CSMAPI_types.h:5792
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:5758
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:5754
GUI_RECT getDrawRect()
Get the draw offset for this control.
Definition: CSMAPI_types.h:5876
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:5797
void setHoveredOverCloseButton(bool bValue)
Set whether we've hovered over the close button.
Definition: CSMAPI_types.h:5826
virtual const char * getClassName()
Get this class' name.
Definition: CSMAPI_types.h:5787
bool mDrawBorder
Draw the border color.
Definition: CSMAPI_types.h:5766
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:5762
GUI_RECT mTabContentRect
Content Rect.
Definition: CSMAPI_types.h:5746
virtual bool isHoverable()
Check hoverability status.
bool mDrawFill
Draw the fill color.
Definition: CSMAPI_types.h:5770
virtual void setSelected(int value)
Set this GUI element as selected or not.
Show a text input box.
Definition: CSMAPI_types.h:3729
virtual bool SelectOnMouseUp()
Select on mouse up.
Definition: CSMAPI_types.h:3975
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:3965
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:3935
int sel_start
Selection start.
Definition: CSMAPI_types.h:3888
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:3880
int sel_end
Selection end.
Definition: CSMAPI_types.h:3892
ValidateInputCallbackFunc ValidateInput
Called when text is finalized (by pressing enter, cancel or clicking outside of the input box).
Definition: CSMAPI_types.h:3876
~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:3735
@ ENTER
Enter button todo: Make pressing enter call a callback.
Definition: CSMAPI_types.h:3738
@ ESCAPE
Escape button.
Definition: CSMAPI_types.h:3741
EInputBoxStyle mInputStyle
The style of this input box.
Definition: CSMAPI_types.h:3872
virtual int processKeys()
Process key input for this element.
int max_length
Maximum input length.
Definition: CSMAPI_types.h:3884
virtual bool isSelected()
Check selection status.
int margin
Text margin.
Definition: CSMAPI_types.h:3912
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:3896
bool is_disabled
Is disabled.
Definition: CSMAPI_types.h:3904
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:3998
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:3908
virtual int getHoverableCount()
Get the number of elements that can be hovered over in this element.
Definition: CSMAPI_types.h:3970
bool is_password
Is password box.
Definition: CSMAPI_types.h:3900
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:30
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:7345
GUI_RECT rect
The rect.
Definition: CSMAPI_types.h:7348
char * data
The data.
Definition: CSMAPI_types.h:7352
A client's ranked info.
Definition: CSMAPI_types.h:7253
unsigned int user_ident_hash[5]
The user ident hash this belongs to.
Definition: CSMAPI_types.h:7264
char * name
The name of the client.
Definition: CSMAPI_types.h:7256
CSM_ClientRanks rank
The client's rank.
Definition: CSMAPI_types.h:7268
CSM_RankedClientInfoType type
The type of comparison this info object uses.
Definition: CSMAPI_types.h:7260
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:7274
GUI_POINT min_size
The minimum size for this window.
Definition: CSMAPI_types.h:7321
bool allow_undo_redo
Allow undo redo for this mode.
Definition: CSMAPI_types.h:7317
bool use_window
Always draw the window.
Definition: CSMAPI_types.h:7305
int max_undo_steps
The maximum number of undo steps.
Definition: CSMAPI_types.h:7313
char window_title[260]
The title for this window.
Definition: CSMAPI_types.h:7277
bool follow_window_height
Follow base window's height.
Definition: CSMAPI_types.h:7339
bool use_external_window
Use a external window.
Definition: CSMAPI_types.h:7301
ExternalWindow * parent
The parent window.
Definition: CSMAPI_types.h:7297
bool init_content_size
Use the initial window size as the content size.
Definition: CSMAPI_types.h:7309
int margin
The margin for everything.
Definition: CSMAPI_types.h:7285
char window_guifile[260]
The pxgui file name for this mode.
Definition: CSMAPI_types.h:7281
bool follow_window_width
Follow base window's width.
Definition: CSMAPI_types.h:7335
int dirty_count
The number of times this dynamic window has been dirtied & subsequentially re-rendered.
Definition: CSMAPI_types.h:7325
bool can_close
Whether the user can close this window or not.
Definition: CSMAPI_types.h:7289
bool hide_on_close
Set the window to only hide when clicking on the 'X' button.
Definition: CSMAPI_types.h:7293
Dropdown box item struct.
Definition: CSMAPI_types.h:4787
GUI_POINT text_size
The size of this item's text.
Definition: CSMAPI_types.h:4802
GUI_RECT item_rect
This item's rect.
Definition: CSMAPI_types.h:4794
GUI_POINT text_point
The position for this item's text.
Definition: CSMAPI_types.h:4798
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:7025
unsigned int tile_offset
The offset of the map tile we're replacing.
Definition: CSMAPI_types.h:7032
MAP_ANIMATED_TILE * draw_next
The next linked to draw.
Definition: CSMAPI_types.h:7066
unsigned char timer
The timer for this tile.
Definition: CSMAPI_types.h:7058
unsigned char frame
The current frame for this tile.
Definition: CSMAPI_types.h:7054
Surface_Ids surf_id
The surface IDs for this tile.
Definition: CSMAPI_types.h:7036
MAP_ANIMATED_TILE * proc_next
The next linked to process.
Definition: CSMAPI_types.h:7070
RECT * rect_list
The rect list for this tile.
Definition: CSMAPI_types.h:7040
bool foreground
Whether this should be drawn in the foreground(TRUE) or background(FALSE).
Definition: CSMAPI_types.h:7028
unsigned char rect_count
The number of rects in this tile.
Definition: CSMAPI_types.h:7044
MAP_ANIMATED_TILE * next
The next linked.
Definition: CSMAPI_types.h:7062
unsigned short wait
The amount of frames that need to pass before the framecounter for this tile is incremented.
Definition: CSMAPI_types.h:7048
Definition: CSMAPI_types.h:6864
Contains the currently loaded stage's map data.
Definition: CSMAPI_types.h:7078
int zone_count
Number of map zones.
Definition: CSMAPI_types.h:7105
unsigned char atrb[0x10001]
Map tileset attribute table.
Definition: CSMAPI_types.h:7089
short length
Height of map.
Definition: CSMAPI_types.h:7097
int anim_count
Number of animated foreground map tiles.
Definition: CSMAPI_types.h:7121
short width
Width of map.
Definition: CSMAPI_types.h:7093
unsigned short * ngdata
Zone tile data.
Definition: CSMAPI_types.h:7085
void * compiled_map_resource
internal use; do not use / set
Definition: CSMAPI_types.h:7129
MAP_ANIMATED_TILE * anim_list
Animated map tiles.
Definition: CSMAPI_types.h:7117
MAP_ZONE * zones
Map zones.
Definition: CSMAPI_types.h:7101
MAP_ANIMATED_TILE * anim_proc_list
Process list.
Definition: CSMAPI_types.h:7113
MAP_ANIMATED_TILE * anim_draw
Drawn animated tiles.
Definition: CSMAPI_types.h:7109
unsigned short * data
Tile indices.
Definition: CSMAPI_types.h:7081
unsigned int crc
The CRC of this map.
Definition: CSMAPI_types.h:7125
The rect for this zone.
Definition: CSMAPI_types.h:6908
int w
Width.
Definition: CSMAPI_types.h:6919
int x
X.
Definition: CSMAPI_types.h:6911
int y
Y.
Definition: CSMAPI_types.h:6915
int h
Height.
Definition: CSMAPI_types.h:6923
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:7164
PLAYER_STATE_TRANSMIT_FLAGS Field
The field this argument info object represents.
Definition: CSMAPI_types.h:7171
bool UseDefaultSize
Use the default size for this field.
Definition: CSMAPI_types.h:7175
bool Ranged
Whether this argument info uses ranges OR just uses traditional size.
Definition: CSMAPI_types.h:7183
bool Used
Whether this is the end of the argument list or not.
Definition: CSMAPI_types.h:7167
int MinValue
The minimum range for this argument.
Definition: CSMAPI_types.h:7187
int MaxValue
The maximum range for this argument.
Definition: CSMAPI_types.h:7191
unsigned char NetSize
Traditional size.
Definition: CSMAPI_types.h:7179
Player state information.
Definition: CSMAPI_types.h:7197
PlayerState_DrawFuncType DrawFunc
The draw function for this player state.
Definition: CSMAPI_types.h:7225
PlayerState_ActFuncType ActFunc
The act function for this player state.
Definition: CSMAPI_types.h:7208
char * StateName
The name of this player state.
Definition: CSMAPI_types.h:7200
unsigned long long int Flags
The flags for this player state.
Definition: CSMAPI_types.h:7234
MYCHAR_STATE_ARG_INFO * ArgList
The custom argument list for this player state.
Definition: CSMAPI_types.h:7243
bool LoadedByMod
Whether this was loaded / overloaded by the currently loaded mod or not.
Definition: CSMAPI_types.h:7247
PlayerStateAnimator_OutputType AnimateRetType
The return type of the animate function.
Definition: CSMAPI_types.h:7229
unsigned int TransmitFlags
The transmit flags for this player state.
Definition: CSMAPI_types.h:7239
PlayerState_AnimFuncType AnimFunc
The animation function for this player state.
Definition: CSMAPI_types.h:7217
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:6801
RAYCAST_QUERY()
Constructor!
Definition: CSMAPI_types.h:6853
GUI_POINT_F mNormal
The normal of the face that we hit.
Definition: CSMAPI_types.h:6812
GUI_POINT m_HitPos
The hit position (subpixel coordinates).
Definition: CSMAPI_types.h:6804
bool hit_entities
Whether to allow hitting entities or not.
Definition: CSMAPI_types.h:6844
bool hit_slopes
Whether to allow hitting slopes or not.
Definition: CSMAPI_types.h:6848
NPCHAR * mHitNPC
The hit NPC.
Definition: CSMAPI_types.h:6820
unsigned char mDirect
This stores which way we pushed the point out of the hit face.
Definition: CSMAPI_types.h:6832
bool mOutOfBounds
Whether the ray went out of bounds or not.
Definition: CSMAPI_types.h:6816
bool mHitEndBlock
Whether the ray hit the end block.
Definition: CSMAPI_types.h:6828
struct RAYCAST_QUERY::@17 mConfig
Options.
bool mHitStartBlock
Whether the ray hit the start block.
Definition: CSMAPI_types.h:6824
unsigned int ent_bits_mask
Bits that the entities we hit MUST have to be a valid hit target.
Definition: CSMAPI_types.h:6840
GUI_POINT tileHitPos
The hit map tile's map coordinates.
Definition: CSMAPI_types.h:6808
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:6579
char * text
The text to display here.
Definition: CSMAPI_types.h:6602
GUI_POINT pnt_text
The text offset for this entry.
Definition: CSMAPI_types.h:6594
int id
This entry's ID.
Definition: CSMAPI_types.h:6598
int index
The index for this entry (only set correctly for entries in the 'shown' linkage.)
Definition: CSMAPI_types.h:6582
GUI_RECT rct_scrolled
The rect after scroll for this entry.
Definition: CSMAPI_types.h:6586
GUI_RECT rct_absolute
The containing rect for this entry.
Definition: CSMAPI_types.h:6590
SEL_LIST_ENTRY * next
The next shown entry.
Definition: CSMAPI_types.h:6606
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:6214
bool Disabled
Whether this item is disabled or not.
Definition: CSMAPI_types.h:6281
bool Checked
Checked.
Definition: CSMAPI_types.h:6285
SystemMenuItem * Previous
The previous item.
Definition: CSMAPI_types.h:6237
int SubItemCount
The number of subitems this item contains.
Definition: CSMAPI_types.h:6249
SystemMenuItem ** SubItemList
The items for this menu.
Definition: CSMAPI_types.h:6245
GUI_POINT ShortcutPoint
The position for this item's shortcut text.
Definition: CSMAPI_types.h:6265
bool Seperator
Seperator.
Definition: CSMAPI_types.h:6277
unsigned int TotalItemIndex
This item's index in TotalItemList.
Definition: CSMAPI_types.h:6221
GUI_RECT ItemRect
This item's rect.
Definition: CSMAPI_types.h:6257
GUI_POINT TextPoint
The position for this item's text.
Definition: CSMAPI_types.h:6261
unsigned int ItemIndex
This item's index in the parent item's SubItemList.
Definition: CSMAPI_types.h:6225
unsigned int ItemId
The ID for this item.
Definition: CSMAPI_types.h:6217
SystemMenuItem * BaseParent
The base parent for this item.
Definition: CSMAPI_types.h:6233
int LongestSubWidth
Longest subitem width.
Definition: CSMAPI_types.h:6273
char ShortcutText[64]
The shortcut text for this item.
Definition: CSMAPI_types.h:6297
Input::KeyShortcut * Shortcut
The shortcut for this item.
Definition: CSMAPI_types.h:6293
GUI_RECT SubMenuRect
This item's submenu rect.
Definition: CSMAPI_types.h:6269
SystemMenuItem * Parent
The parent for this item.
Definition: CSMAPI_types.h:6229
char Text[270]
The text for this menu.
Definition: CSMAPI_types.h:6253
SystemMenuInfo_OnItemClickFunc OnClicked
On Clicked Callback.
Definition: CSMAPI_types.h:6289
SystemMenuItem * Next
The next item.
Definition: CSMAPI_types.h:6241
Callstack data for text script.
Definition: CSMAPI_types.h:2694
unsigned short p_read
The p_read value of where we left off at this point in the callstack.
Definition: CSMAPI_types.h:2697
unsigned short event_number
The event number we were originally running.
Definition: CSMAPI_types.h:2701
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
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:5685
GUI_RECT close_rect
This item's close button rect.
Definition: CSMAPI_types.h:5708
GUI_POINT text_point
The position for this item's text.
Definition: CSMAPI_types.h:5700
GUI_POINT text_size
The size of this item's text.
Definition: CSMAPI_types.h:5704
bool is_closable
Whether this tab has a close button or not.
Definition: CSMAPI_types.h:5712
GUI_RECT item_rect
This item's rect.
Definition: CSMAPI_types.h:5692
GUI_RECT draw_rect
This item's draw rect.
Definition: CSMAPI_types.h:5696
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