uibattle.h 4.2 KB

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