uibattle.h 4.1 KB

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