uibattle.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152
  1. //
  2. // Copyright (c) 2009, Wei Mingzhi <whistler_wmz@users.sf.net>.
  3. // All rights reserved.
  4. //
  5. // This file is part of SDLPAL.
  6. //
  7. // SDLPAL is free software: you can redistribute it and/or modify
  8. // it under the terms of the GNU General Public License as published by
  9. // the Free Software Foundation, either version 3 of the License, or
  10. // (at your option) any later version.
  11. //
  12. // This program is distributed in the hope that it will be useful,
  13. // but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. // GNU General Public License for more details.
  16. //
  17. // You should have received a copy of the GNU General Public License
  18. // along with this program. If not, see <http://www.gnu.org/licenses/>.
  19. //
  20. #ifndef UIBATTLE_H
  21. #define UIBATTLE_H
  22. #ifdef __cplusplus
  23. extern "C"
  24. {
  25. #endif
  26. #include "ui.h"
  27. typedef enum tagBATTLEUISTATE
  28. {
  29. kBattleUIWait,
  30. kBattleUISelectMove,
  31. kBattleUISelectTargetEnemy,
  32. kBattleUISelectTargetPlayer,
  33. kBattleUISelectTargetEnemyAll,
  34. kBattleUISelectTargetPlayerAll,
  35. } BATTLEUISTATE;
  36. typedef enum tagBATTLEMENUSTATE
  37. {
  38. kBattleMenuMain,
  39. kBattleMenuMagicSelect,
  40. kBattleMenuUseItemSelect,
  41. kBattleMenuThrowItemSelect,
  42. kBattleMenuMisc,
  43. kBattleMenuMiscItemSubMenu,
  44. } BATTLEMENUSTATE;
  45. typedef enum tagBATTLEUIACTION
  46. {
  47. kBattleUIActionAttack,
  48. kBattleUIActionMagic,
  49. kBattleUIActionCoopMagic,
  50. kBattleUIActionMisc,
  51. } BATTLEUIACTION;
  52. #define SPRITENUM_BATTLEICON_ATTACK 40
  53. #define SPRITENUM_BATTLEICON_MAGIC 41
  54. #define SPRITENUM_BATTLEICON_COOPMAGIC 42
  55. #define SPRITENUM_BATTLEICON_MISCMENU 43
  56. #define SPRITENUM_BATTLE_ARROW_CURRENTPLAYER 69
  57. #define SPRITENUM_BATTLE_ARROW_CURRENTPLAYER_RED 68
  58. #define SPRITENUM_BATTLE_ARROW_SELECTEDPLAYER 67
  59. #define SPRITENUM_BATTLE_ARROW_SELECTEDPLAYER_RED 66
  60. #define BATTLEUI_LABEL_ITEM 5
  61. #define BATTLEUI_LABEL_DEFEND 58
  62. #define BATTLEUI_LABEL_AUTO 56
  63. #define BATTLEUI_LABEL_INVENTORY 57
  64. #define BATTLEUI_LABEL_FLEE 59
  65. #define BATTLEUI_LABEL_STATUS 60
  66. #define BATTLEUI_LABEL_USEITEM 23
  67. #define BATTLEUI_LABEL_THROWITEM 24
  68. #define TIMEMETER_COLOR_DEFAULT 0x1B
  69. #define TIMEMETER_COLOR_SLOW 0x5B
  70. #define TIMEMETER_COLOR_HASTE 0x2A
  71. #define BATTLEUI_MAX_SHOWNUM 16
  72. typedef struct tagSHOWNUM
  73. {
  74. WORD wNum;
  75. PAL_POS pos;
  76. DWORD dwTime;
  77. NUMCOLOR color;
  78. } SHOWNUM;
  79. typedef struct tagBATTLEUI
  80. {
  81. BATTLEUISTATE state;
  82. BATTLEMENUSTATE MenuState;
  83. CHAR szMsg[256]; // message to be shown on the screen
  84. CHAR szNextMsg[256]; // next message to be shown on the screen
  85. DWORD dwMsgShowTime; // the end time of showing the message
  86. WORD wNextMsgDuration; // duration of the next message
  87. WORD wCurPlayerIndex; // index of the current player
  88. WORD wSelectedAction; // current selected action
  89. WORD wSelectedIndex; // current selected index of player or enemy
  90. WORD wPrevEnemyTarget; // previous enemy target
  91. WORD wActionType; // type of action to be performed
  92. WORD wObjectID; // object ID of the item or magic to use
  93. BOOL fAutoAttack; // TRUE if auto attack
  94. SHOWNUM rgShowNum[BATTLEUI_MAX_SHOWNUM];
  95. } BATTLEUI;
  96. VOID
  97. PAL_PlayerInfoBox(
  98. PAL_POS pos,
  99. WORD wPlayerRole,
  100. INT iTimeMeter,
  101. BYTE bTimeMeterColor,
  102. BOOL fUpdate
  103. );
  104. VOID
  105. PAL_BattleUIShowText(
  106. LPCSTR lpszText,
  107. WORD wDuration
  108. );
  109. VOID
  110. PAL_BattleUIPlayerReady(
  111. WORD wPlayerIndex
  112. );
  113. VOID
  114. PAL_BattleUIUpdate(
  115. VOID
  116. );
  117. VOID
  118. PAL_BattleUIShowNum(
  119. WORD wNum,
  120. PAL_POS pos,
  121. NUMCOLOR color
  122. );
  123. #ifdef __cplusplus
  124. }
  125. #endif
  126. #endif