2 #include "mof/KeyFrameAnimation.h"
6 et::WorldMenu::WorldMenu( mof::TextureManager* pTextureManager , et::World* pWorld , et::GameData* pGameData)
7 : et::MyFrame(mof::Line2D( 650 , 50 , 800 , 200) , true , pTextureManager->getResource(_T("image/frame0.png")) )
9 m_pTextureManager = pTextureManager;
11 m_pGameData = pGameData;
13 std::vector<mof::Window*> selectables;
15 mof::Window* pSelectable = NULL;
16 add(mof::Sprite::createSpriteFromText(_T("
\83\8f\81[
\83\8b\83h
\83\81\83j
\83\85\81[") , 16) );
17 pSelectable = addSelectableTextItem(this , selectables , _T("
\83_
\83\93\83W
\83\87\83\93\92T
\8dõ") , 16);
18 pSelectable->setAvailable(false);
19 addSelectableTextItem(this , selectables , _T("
\83G
\83\8a\83A
\83\81\83j
\83\85\81[") , 16);
20 addSelectableTextItem(this , selectables , _T("
\83X
\83\8a\81[
\83v") , 16);
21 pSelectable = addSelectableTextItem(this , selectables , _T("
\83\8f\81[
\83\8b\83h
\89ð
\90Í") , 16);
22 pSelectable->setAvailable(false);
23 m_pSelector = new mof::SelectionModel(selectables , mof::AnimationResource());
30 et::WorldMenu::~WorldMenu(void)
38 void et::WorldMenu::setVisible(bool visible){
39 et::MyFrame::setVisible(visible);
41 mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
42 pAnimation->setPosition(0 , mof::Vector2D(650 , 50));
43 pAnimation->setPosition(7 , mof::Vector2D(440 , 50));
44 mof::AnimationResource resource(pAnimation);
45 m_pSelector->setMenuAnimation(resource);
46 setAnimation(0 , resource);
49 mof::KeyFrameAnimation* pAnimation = new mof::KeyFrameAnimation();
50 pAnimation->setPosition(0 , mof::Vector2D(440 , 50));
51 pAnimation->setPosition(7 , mof::Vector2D(650 , 50));
52 mof::AnimationResource resource(pAnimation);
53 m_pSelector->setMenuAnimation(resource);
54 setAnimation(0 , resource);
58 et::MyFrame* et::WorldMenu::performAction(){
60 switch(getSelectionModel()->getSelectingIndex()){
61 case 0 : //
\83_
\83\93\83W
\83\87\83\93\92T
\8dõ
63 case 1 : //
\83G
\83\8a\83A
\83\81\83j
\83\85\81[
65 //
\83\8f\81[
\83\8b\83h
\83\81\83j
\83\85\81[
\81¨
\83G
\83\8a\83A
\83\81\83j
\83\85\81[
\82Ì
\91J
\88Ú
\83A
\83j
\83\81\82ð
\83Z
\83b
\83g
69 case 2 : //
\83X
\83\8a\81[
\83v
71 m_pGameData->addRegenerationEvent(et::RegenerationEvent::createSleepEvent(m_pWorld->getTerm()));
76 DEBUG_PRINT("
\96¢
\92è
\8b`
\82Ì
\83A
\83N
\83V
\83\87\83\93\82ª
\97v
\8b\81\82³
\82ê
\82Ü
\82µ
\82½");
83 mof::Window* et::WorldMenu::addSelectableTextItem(mof::Window* pOwner, std::vector<mof::Window*>& selectables , TCHAR* text , int size){
84 mof::Window* pSelectable = new et::MyWindow(mof::Sprite::createSpriteFromText(text , size) , m_pTextureManager);
85 pOwner->add(pSelectable);
86 selectables.push_back(pSelectable);