OpenMoHAA 0.82.0
Loading...
Searching...
No Matches
cl_invrender.h
1/*
2===========================================================================
3Copyright (C) 2023 the OpenMoHAA team
4
5This file is part of OpenMoHAA source code.
6
7OpenMoHAA source code is free software; you can redistribute it
8and/or modify it under the terms of the GNU General Public License as
9published by the Free Software Foundation; either version 2 of the License,
10or (at your option) any later version.
11
12OpenMoHAA source code is distributed in the hope that it will be
13useful, but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with OpenMoHAA source code; if not, write to the Free Software
19Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20===========================================================================
21*/
22
23#pragma once
24
25class FakkInventory;
26
27typedef enum {
28 selectsound,
29 rejectsound,
30 changesound
31} invsound_t;
32
33class FakkItemList : public UIWidget
34{
35protected:
36 inventory_type_t *type;
37 uipopup_describe m_describe[10];
38 inventory_item_t *m_hoveritem;
39 inventory_item_t *m_lastmenuitem;
40 FakkInventory *m_parent;
41 float m_hovertop;
42
43public:
44 CLASS_PROTOTYPE(FakkItemList);
45
46 FakkItemList();
47 ~FakkItemList();
48
49 void VerifyItemUp(inventory_item_t *item, qboolean warpmouse);
50 void setType(inventory_type_t *t);
51 void Create(float x, float y, FakkInventory *parent);
52 bool HasAnyItems(void);
53 void Draw(void) override;
54 void OnLeftMouseDown(Event *ev);
55 void OnRightMouseDown(Event *ev);
56 void OnLeftMouseUp(Event *ev);
57 void OnRightMouseUp(Event *ev);
58 void OnMouseMove(Event *ev);
59 void OnMouseEnter(Event *ev);
60 void OnMouseLeave(Event *ev);
61 void OnMenuKilled(Event *ev);
62 void EquipItem(Event *ev);
63
64 inventory_item_t *getHoverItem() const;
65};
66
67class FakkInventory : public UIWidget
68{
69protected:
70 inventory_t *m_inv;
71 SafePtr<FakkItemList> m_currentlist;
72 inventory_type_t *m_currenttype;
73 int m_currentitemnum;
74
75public:
76 CLASS_PROTOTYPE(FakkInventory);
77
78public:
79 qboolean m_mouse_active;
80
81protected:
82 void VerifyTypeUp(inventory_type_t *t, qboolean warpmouse);
83
84public:
85 FakkInventory();
86 ~FakkInventory();
87
88 void setInventory(inventory_t *i);
89 void Draw(void) override;
90 void OnMouseMove(Event *ev);
91 void OnMouseLeave(Event *ev);
92 void OnMouseEnter(Event *ev);
93 void OnMouseDown(Event *ev);
94 void WarpTo(const char *name);
95 void WarpTo(int slotnum);
96 void NextItem(void);
97 void PrevItem(void);
98 qboolean isDying(void);
99 qboolean KeyEvent(int key, unsigned int time) override;
100 void PlaySound(invsound_t type);
101 void Timeout(Event *ev);
102 void ChangeItem(int sign);
103 int FindFirstItem(int itemindex, int sign);
104};
105
106void CL_Draw3DModel(
107 float x,
108 float y,
109 float w,
110 float h,
111 qhandle_t model,
112 vec3_t origin,
113 vec3_t rotateoffset,
114 vec3_t offset,
115 vec3_t angle,
116 vec3_t color,
117 str anim
118);
119
120void UI_DoInventory(qboolean activate_mouse);
121qboolean UI_CloseInventory(void);
Definition listener.h:246
Definition cl_invrender.h:68
Definition safeptr.h:160
Definition cl_inv.h:62
Definition cl_inv.h:114
Definition cl_inv.h:89
Definition uiconsole.h:27
Definition str.h:77
Definition uipopupmenu.h:28