Planeshift

pawsgmspawn.h

Go to the documentation of this file.
00001 /*
00002  * pawsgmspawn.h - Author: Christian Svensson
00003  *
00004  * Copyright (C) 2004 Atomic Blue ([email protected], http://www.atomicblue.org)
00005  *
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation (version 2 of the License)
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017  *
00018  */
00019 #ifndef PAWS_GMSPAWN_HEADER
00020 #define PAWS_GMSPAWN_HEADER
00021 
00022 #include "paws/pawstree.h"
00023 #include "psengine.h"
00024 
00025 class pawsObjectView;
00026 class pawsTextBox;
00027 class pawsEditTextBox;
00028 class pawsCheckBox;
00029 class pawsModsWindow;
00030 
00031 class pawsItemTree : public pawsSimpleTree
00032 {
00033 public:
00034     bool OnDoubleClick(int button, int modifiers, int x, int y);
00035 };
00036 
00037 class pawsGMSpawnWindow : public pawsWidget, public psClientNetSubscriber, public DelayedLoader
00038 {
00039 public:
00040     pawsGMSpawnWindow();
00041     virtual ~pawsGMSpawnWindow();
00042 
00043     bool PostSetup();
00044     void Show();
00045     void Close();
00046     void HandleMessage(MsgEntry* me);
00047     bool OnSelected(pawsWidget* widget);
00048 
00049     bool OnButtonPressed(int button,int keyModifier,pawsWidget* widget);
00050 
00051     bool CheckLoadStatus();
00052 
00053     void SetItemModifier(const char* name, uint32_t id, uint32_t type);
00054 
00055 private:
00056     pawsItemTree*                   itemTree;
00057     pawsObjectView*                 objView;
00058     pawsWidget*                     itemImage;
00059     pawsTextBox*                    itemName;
00060     pawsCheckBox*                   cbForce;
00061     pawsCheckBox*                   cbLockable;
00062     pawsCheckBox*                   cbLocked;
00063     pawsCheckBox*                   cbPickupable;
00064     pawsCheckBox*                   cbPickupableWeak;
00065     pawsCheckBox*                   cbCollidable;
00066     pawsCheckBox*                   cbUnpickable;
00067     pawsCheckBox*                   cbTransient;
00068     pawsCheckBox*                   cbSettingItem;
00069     pawsCheckBox*                   cbNPCOwned;
00070     pawsEditTextBox*                itemCount;
00071     pawsEditTextBox*                itemQuality;
00072     pawsEditTextBox*                lockSkill;
00073     pawsEditTextBox*                lockStr;
00074     pawsTextBox*                    factname;
00075     pawsTextBox*                    meshname;
00076     pawsTextBox*                    imagename;
00077     pawsTextBox*                    modname[psGMSpawnMods::ITEM_NUM_TYPES];
00078 
00079     struct Item
00080     {
00081         csString name;
00082         csString category;
00083         csString mesh;
00084         csString icon;
00085     };
00086 
00087     csArray<Item>   items;
00088 
00089     csString currentItem;
00090     bool loaded;
00091     csString factName;
00092     csArray<uint32_t> mods;
00093     pawsModsWindow* modwindow;
00094 };
00095 
00096 
00097 CREATE_PAWS_FACTORY( pawsGMSpawnWindow );
00098 #endif