Planeshift
pawsglyphwindow.h
Go to the documentation of this file.
1
/*
2
* pawsglyphwindow.h - Author: Anders Reggestad
3
*
4
* Copyright (C) 2003 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5
*
6
*
7
* This program is free software; you can redistribute it and/or
8
* modify it under the terms of the GNU General Public License
9
* as published by the Free Software Foundation (version 2 of the License)
10
* This program is distributed in the hope that it will be useful,
11
* but WITHOUT ANY WARRANTY; without even the implied warranty of
12
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13
* GNU General Public License for more details.
14
* You should have received a copy of the GNU General Public License
15
* along with this program; if not, write to the Free Software
16
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17
*
18
*/
19
20
#ifndef PAWS_GLYPH_WINDOW
21
#define PAWS_GLYPH_WINDOW
22
23
// CS INCLUDES
24
#include <csutil/array.h>
25
#include <imap/loader.h>
26
27
#include "
paws/pawswidget.h
"
28
#include "
paws/pawsbutton.h
"
29
#include "
paws/pawstextbox.h
"
30
#include "
pawsslot.h
"
31
#include "
inventorywindow.h
"
32
#include "
util/psconst.h
"
33
#include "
net/messages.h
"
34
35
#define FLOATING_SLOT GLYPH_LIST_MAX_SLOTS
36
37
struct
iEngine;
38
39
40
class
pawsGlyphSlot
:
public
pawsSlot
41
{
42
public
:
43
pawsGlyphSlot
()
44
{
45
dragDrop
=
false
;
46
emptyOnZeroCount
=
true
;
47
Clear
();
48
}
49
int
GetStatID
()
50
{
51
return
statID
;
52
}
53
void
SetStatID
(
int
statID
)
54
{
55
this->statID =
statID
;
56
}
57
void
Clear
()
58
{
59
statID
= 0;
60
61
pawsSlot::Clear
();
62
}
63
int
Way
()
64
{
65
return
wayID
;
66
}
67
void
SetWay
(
int
way)
68
{
69
wayID
= way;
70
}
71
protected
:
72
int
statID
;
73
int
wayID
;
74
};
75
76
CREATE_PAWS_FACTORY
(
pawsGlyphSlot
);
77
78
82
class
pawsGlyphWindow
:
public
pawsWidget
,
public
psClientNetSubscriber
83
{
84
public
:
85
86
pawsGlyphWindow
();
87
virtual
~
pawsGlyphWindow
();
88
91
void
HandleMessage(
MsgEntry
* message );
92
93
bool
PostSetup
();
94
void
Show
();
95
void
Hide
();
96
bool
OnMouseDown
(
int
button,
int
modifiers,
int
x,
int
y);
97
bool
OnButtonPressed
(
int
mouseButton,
int
keyModifier,
pawsWidget
* widget );
98
99
protected
:
100
void
HandleAssemble(
MsgEntry
* me );
101
void
HandleGlyphList(
MsgEntry
* me );
102
104
void
NewGlyphSlotRow(
int
wayNum);
105
107
pawsGlyphSlot
* FindFreeSlot(
int
wayNum);
108
110
void
StartDrag(
pawsGlyphSlot
*sourceSlot);
111
void
StopDrag(
pawsGlyphSlot
*sourceSlot);
112
114
void
SendAssembler(
bool
infoRequest =
false
);
115
116
/*** Clears the Spell name and Description fields. ***/
117
void
ClearSpell();
118
119
pawsMessageTextBox
*
description
;
120
pawsTextBox
*
spellName
;
121
pawsWidget
*
spellImage
;
122
pawsButton
*
helpButton
;
123
pawsWidget
*
helpWindow
;
124
csArray <pawsListBox*>
ways
;
125
126
pawsGlyphSlot
* assembler[
GLYPH_ASSEMBLER_SLOTS
];
127
};
128
129
130
CREATE_PAWS_FACTORY
(
pawsGlyphWindow
);
131
132
133
134
#endif
135
pawsGlyphSlot::statID
int statID
Definition:
pawsglyphwindow.h:72
pawsGlyphSlot::SetStatID
void SetStatID(int statID)
Definition:
pawsglyphwindow.h:53
pawsGlyphSlot::Way
int Way()
Definition:
pawsglyphwindow.h:63
pawsGlyphSlot
Definition:
pawsglyphwindow.h:40
pawsWidget
The main base widget that all other widgets should inherit from.
Definition:
pawswidget.h:116
pawsbutton.h
pawsSlot::emptyOnZeroCount
bool emptyOnZeroCount
should the slot clear itself when the stackcount hits 0 ?
Definition:
pawsslot.h:114
messages.h
pawsSlot
A slot which may contain one item, with icon, and stack count.
Definition:
pawsslot.h:22
pawsGlyphWindow::description
pawsMessageTextBox * description
Definition:
pawsglyphwindow.h:119
pawsGlyphSlot::wayID
int wayID
Definition:
pawsglyphwindow.h:73
pawsGlyphWindow::ways
csArray< pawsListBox * > ways
Definition:
pawsglyphwindow.h:124
pawsWidget::PostSetup
virtual bool PostSetup()
This is called after the widget and all of it's children have been created.
Definition:
pawswidget.h:709
CREATE_PAWS_FACTORY
CREATE_PAWS_FACTORY(pawsGlyphSlot)
MsgEntry
The structure of 1 queue entry (pointer to a message)
Definition:
message.h:143
inventorywindow.h
GLYPH_ASSEMBLER_SLOTS
#define GLYPH_ASSEMBLER_SLOTS
Definition:
psconst.h:74
pawsGlyphWindow::spellName
pawsTextBox * spellName
Definition:
pawsglyphwindow.h:120
pawsGlyphSlot::GetStatID
int GetStatID()
Definition:
pawsglyphwindow.h:49
pawsSlot::Clear
virtual void Clear()
pawsslot.h
pawswidget.h
pawsSlot::OnMouseDown
bool OnMouseDown(int button, int modifiers, int x, int y)
Manage mouse down event to test for and apply window changes.
psconst.h
pawsSlot::dragDrop
bool dragDrop
Definition:
pawsslot.h:105
pawsMessageTextBox
This is a special type of text box that is used for messages.
Definition:
pawstextbox.h:285
pawsButton
A simple button widget.
Definition:
pawsbutton.h:43
pawsWidget::Show
virtual void Show()
Makes widget visible and brings it to the front.
pawsGlyphSlot::Clear
void Clear()
Definition:
pawsglyphwindow.h:57
pawstextbox.h
pawsGlyphWindow::helpWindow
pawsWidget * helpWindow
Definition:
pawsglyphwindow.h:123
pawsGlyphSlot::SetWay
void SetWay(int way)
Definition:
pawsglyphwindow.h:67
pawsGlyphWindow
Window opened from the spell book, when you want to see your glyphs and research new spells...
Definition:
pawsglyphwindow.h:82
pawsGlyphSlot::pawsGlyphSlot
pawsGlyphSlot()
Definition:
pawsglyphwindow.h:43
pawsWidget::OnButtonPressed
virtual bool OnButtonPressed(int button, int keyModifier, pawsWidget *widget)
Called whenever a button is pressed.
Definition:
pawswidget.h:1190
pawsWidget::Hide
virtual void Hide()
Makes widget invisible and removes focus if widget has current focus.
psClientNetSubscriber
Definition:
cmdbase.h:67
pawsTextBox
A basic text box widget.
Definition:
pawstextbox.h:42
pawsGlyphWindow::spellImage
pawsWidget * spellImage
Definition:
pawsglyphwindow.h:121
pawsGlyphWindow::helpButton
pawsButton * helpButton
Definition:
pawsglyphwindow.h:122
client
gui
pawsglyphwindow.h
Generated on Sat Jun 19 2021 05:00:22 for Planeshift by
1.8.11