JNR
cubicObj_TerminalInterface.h
1 /*
2 
3 Jump'n'Run Engine
4 http://www.atanaslaskov.com/jnr/
5 
6 BSD LICENSE
7 Copyright (c) 2007-2013, Atanas Laskov
8 All rights reserved.
9 
10 Redistribution and use in source and binary forms, with or without
11 modification, are permitted provided that the following conditions are met:
12 1. Redistributions of source code must retain the above copyright notice,
13 this list of conditions and the following disclaimer.
14 2. Redistributions in binary form must reproduce the above copyright notice,
15 this list of conditions and the following disclaimer in the documentation
16 and/or other materials provided with the distribution.
17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 DISCLAIMED. IN NO EVENT SHALL ATANAS LASKOV BE LIABLE FOR ANY
21 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 
28 */
29 
31 
32 
33 class uiContainer_SkillInfo: public uiContainer
34 {
35  unsigned _col;
36  unsigned _row;
37  double ang;
38  M_BOOL bSelected;
39 
40  rpgSkill *_pSkill;
41  uiIcon3D *_pIcon;
42 
43 public:
44  uiContainer_SkillInfo(void);
45  ~uiContainer_SkillInfo(void);
46 
47  void load(rpgSkill *pSkill, unsigned col, unsigned row);
48  void draw();
49  void reply();
50 
51  void select(M_BOOL on) { bSelected=on; }
52  rpgSkill *getSkill() {return _pSkill;}
53 };
54 
55 //#define M_N_SKILLS 12
56 
57 class laObj_TerminalInterface :
58  public laObject
59 {
60  uiDialogBaloon _baloon;
61  std::vector<uiContainer_SkillInfo*> _vSkillWindows;
62 
63  class laPlayer* pPlayer;
64  class laActiveObject* pAO;
65 
66  fxAnimatedText* pText;
67 
68  unsigned nPoints;
69 
70  M_BOOL _bProceed;
71  M_BOOL _bCompleted;
72 
73 
74  int nSel, nRow, nCol;
75  int nRow_Max, nCol_Max, nRow_Min;
76  laMultiKey mkL, mkR, mkU, mkD;
77 
78  laMultiKey mkEnter;
79 
80  rpgSheet_PlayableChar* _player_sheet();
81  rpgSkillsInventory *_skills_inventory();
82  void _init_skills();
83  void _upgrade_skill(rpgSkill *pSkill);
84  void _update_sel();
85 
86 public:
87 
88  M_BOOL isCompleted() { return _bCompleted; }
89 
90  // COnstructor
91  laObj_TerminalInterface(laPlayer* pp, laActiveObject* pao, fxAnimatedText* pt, unsigned npt);
92  virtual ~laObj_TerminalInterface(void);
93 
94  // Load the object from file
95  //
96  virtual void load(class laFileParser *fp) {}
97 
98  // Dynamicly create a new object
99  //
100  virtual void create(laPoint3 pos) {}
101 
102  // Respawn. Revert object to its original state
103  //
104  virtual void respawn() {}
105 
106  // Draw the object
107  //
108  virtual void drawGeometry(laRenderer *r, laPoint3 ptBasePos);
109  virtual void drawFx(laRenderer *r, laPoint3 ptBasePos);
110  virtual void drawInterface(laRenderer *r, laPoint3 ptBasePos);
111 
112  // Animate the object
113  //
114  virtual void animate(laTimer &t);
115 };
GUI Container Window.
Definition: uiContainer.h:42
Playable Character.
Definition: laPlayer.h:46
virtual void draw()
Display the window.
Player RPG Properties.
Object that can be activated by the player.
Virtual interface for the Engine graphics renderer.
Definition: laRenderer.h:98
virtual void reply()
Handle input message.
GUI icon object that can siplay 3D models as icons.
Definition: uiIcon3D.h:52
Base Class for Level Objects.
Definition: laObject.h:43
Handling Multiple Key Presses.
Definition: laMultiKey.h:49
File Parser.
Definition: laFileParser.h:41