Yosin_Game/SquirrelTownStage.cpp

70 lines
1.8 KiB
C++
Raw Permalink Normal View History

2024-05-04 18:30:32 +08:00
#include "SquirrelTownStage.h"
#include "SquirrelClassEx.h"
extern SquirrelClassEx* TObject;
extern Cursor* Mouse_Object;
extern std::map<std::uint64_t, int>UI_HOVER_ZORDER;
extern std::map<std::uint64_t, UiFrameWork*>UI_HOVER_OBJECT;
void SquirrelTownStage::PushBaseUi()
{
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>UIͼ<49><CDBC>
LayerActorPtr MouseUiLayer = new LayerActor();
MouseUiLayer->SetName("Scene_Mouse_UI_Layer");
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD><EFBFBD><E3BCB6><EFBFBD><EFBFBD>
MouseUiLayer->SetZOrder(100000);
SquirrelClassEx::PushLayerActorPtrToMap(MouseUiLayer);
this->AddChild(MouseUiLayer);
//<2F><><EFBFBD><EFBFBD>Ĭ<EFBFBD><C4AC>ͼ<EFBFBD><CDBC>
LayerActorPtr DefaultLayer = new LayerActor();
DefaultLayer->SetName(this->GetName() + "_Default_Layer");
SquirrelClassEx::PushLayerActorPtrToMap(DefaultLayer);
this->AddChild(DefaultLayer);
}
void SquirrelTownStage::OnEnter()
{
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӹ<EFBFBD><D3B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƴ<EFBFBD>
Mouse_Object->RemoveFromParent();
ActorPtr MouseUiLayer = this->GetChild("Scene_Mouse_UI_Layer");
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϊ<EFBFBD><CEAA>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD><EFBFBD>Ӷ<EFBFBD><D3B6><EFBFBD>
MouseUiLayer->AddChild(Mouse_Object);
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//TObject->RunSceneScript(this->GetName() + "_Enter", this);
//ȫ<>ֽ<EFBFBD><D6BD><EFBFBD>
TObject->RunSceneScript("Game_Enter", this);
}
void SquirrelTownStage::OnExit()
{
//<2F><><EFBFBD><EFBFBD>UI<55><49>Map
UI_HOVER_ZORDER.clear();
UI_HOVER_OBJECT.clear();
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӹ<EFBFBD><D3B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ƴ<EFBFBD>
Mouse_Object->RemoveFromParent();
//ȫ<><C8AB><EFBFBD>˳<EFBFBD>
TObject->RunSceneScript("Game_Exit", this);
}
void SquirrelTownStage::OnUpdate(Duration dt)
{
if (Director::GetInstance().GetCurrentStage()->GetHashName() == this->GetHashName() && this->GetName().find("LoadingGame") == std::string::npos) {
//ȫ<><C8AB>Proc
TObject->RunSceneScript("Game_Proc", this);
//<2F>ж<EFBFBD><D0B6>Ƿ<EFBFBD><C7B7><EFBFBD>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD>
if (FILE* file = fopen("Yosin_Game_Reloading.Sign", "r")) {
SquirrelClassEx::ReloadingScript();
//OnExit();
//OnEnter();
fclose(file);
remove("Yosin_Game_Reloading.Sign");
}
}
}