aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/floaterao.h
blob: 465f32e5da4cc43d8ca366ebd6287c372ad9741d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132

#ifndef LL_LLFLOATERAO_H
#define LL_LLFLOATERAO_H

#include "llfloater.h"
#include "llviewercontrol.h"
#include "llagent.h"


class AONoteCardDropTarget;

const int STATE_AGENT_IDLE = 0;
const int STATE_AGENT_WALK = 1;
const int STATE_AGENT_RUN = 2;
const int STATE_AGENT_STAND = 3;

const int STATE_AGENT_PRE_JUMP = 4;
const int STATE_AGENT_JUMP = 5;
const int STATE_AGENT_TURNLEFT = 6;
const int STATE_AGENT_TURNRIGHT = 7;

const int STATE_AGENT_SIT = 8;
const int STATE_AGENT_GROUNDSIT = 9;

const int STATE_AGENT_HOVER = 10;
const int STATE_AGENT_HOVER_DOWN = 11;
const int STATE_AGENT_HOVER_UP = 12;

const int STATE_AGENT_CROUCH = 13;
const int STATE_AGENT_CROUCHWALK = 14;
const int STATE_AGENT_FALLDOWN = 15;
const int STATE_AGENT_STANDUP = 16;
const int STATE_AGENT_LAND = 17;

const int STATE_AGENT_FLY = 18;
const int STATE_AGENT_FLYSLOW = 19;





class AOStandTimer : public LLEventTimer
{
public:
    AOStandTimer();
    ~AOStandTimer();
    virtual BOOL tick();
	virtual void reset();
};

class AOInvTimer : public LLEventTimer
{
public:
	static BOOL fullfetch;
	AOInvTimer();
	~AOInvTimer();
	BOOL tick();
};

class LLFloaterAO : public LLFloater
{
public:

    LLFloaterAO();
	virtual	BOOL	postBuild();
    virtual ~LLFloaterAO();

	static void show(void*);
	static void init();

	static void onClickToggleAO(LLUICtrl *, void*);
	static void onClickToggleSits(LLUICtrl *, void*);
	static void run();
	static void updateLayout(LLFloaterAO* floater);

	static BOOL loadAnims();

	static int getAnimationState();
	static void setAnimationState(int state);
	static void setStates(const LLUUID& id, BOOL start);

	static LLUUID getCurrentStandId();
	static void setCurrentStandId(const LLUUID& id);
	static int stand_iterator;
	static BOOL ChangeStand();

	static BOOL startMotion(const LLUUID& id, F32 time_offset = 0.f, BOOL stand = FALSE);
	static BOOL stopMotion(const LLUUID& id, BOOL stop_immediate, BOOL stand = FALSE);

	static LLUUID GetAnimID(const LLUUID& id);

	static int GetStateFromAnimID(const LLUUID& id);
	static LLUUID GetAnimIDFromState(const int state);
	static int GetStateFromToken(std::string strtoken);

	static void onClickLess(void* data) ;
	static void onClickMore(void* data) ;

	static void onClickPrevStand(void* userdata);
	static void onClickNextStand(void* userdata);
	static void onClickReloadCard(void* userdata);
	static void onClickOpenCard(void* userdata);
	static void onClickNewCard(void* userdata);

	static LLUUID invfolderid;
	static const LLUUID& getAssetIDByName(const std::string& name);

	static bool getInstance();
	
private:

	static LLFloaterAO* sInstance;
	static int mAnimationState;
	static LLUUID mCurrentStandId;

	static AONoteCardDropTarget* mAOItemDropTarget;
	static void AOItemDrop(LLViewerInventoryItem* item);
	static void onSpinnerCommit(LLUICtrl* ctrl, void* userdata);
	static void onComboBoxCommit(LLUICtrl* ctrl, void* userdata);
	static BOOL SetDefault(void *userdata, LLUUID ao_id, std::string defaultanim);

	BOOL					mDirty;

protected:

	static void onNotecardLoadComplete(LLVFS *vfs,const LLUUID& asset_uuid,LLAssetType::EType type,void* user_data, S32 status, LLExtStat ext_status);

};

extern AOInvTimer* gAOInvTimer;

#endif