diff --git a/src/game/client/components/ghost.h b/src/game/client/components/ghost.h index 1b97ed649..a0bf2b737 100644 --- a/src/game/client/components/ghost.h +++ b/src/game/client/components/ghost.h @@ -85,7 +85,6 @@ private: static void GetNetObjCharacter(CNetObj_Character *pChar, const CGhostCharacter *pGhostChar); void AddInfos(const CNetObj_Character *pChar); - int GetSlot() const; void StartRecord(); void StopRecord(int Time = -1); @@ -107,6 +106,7 @@ public: virtual void OnMessage(int MsgType, void *pRawMsg); virtual void OnMapLoad(); + int GetSlot() const; int Load(const char *pFilename); void Unload(int Slot); diff --git a/src/game/client/components/menus_ingame.cpp b/src/game/client/components/menus_ingame.cpp index 728c5df74..2b70de5d1 100644 --- a/src/game/client/components/menus_ingame.cpp +++ b/src/game/client/components/menus_ingame.cpp @@ -1138,8 +1138,9 @@ void CMenus::RenderGhost(CUIRect MainView) static int s_GhostButton = 0; static int s_DeleteButton = 0; static int s_SaveButton = 0; + static int s_ReloadButton = 0; - if(pGhost->HasFile()) + if(pGhost->HasFile() && (pGhost->Active() || m_pClient->m_pGhost->GetSlot() != -1)) { Status.VSplitRight(120.0f, &Status, &Button); @@ -1176,4 +1177,12 @@ void CMenus::RenderGhost(CUIRect MainView) if(DoButton_Menu(&s_SaveButton, Localize("Save"), 0, &Button)) m_pClient->m_pGhost->SaveGhost(pGhost); } + + Status.VSplitLeft(120.0f, &Button, &Status); + + if(DoButton_Menu(&s_ReloadButton, Localize("Reload"), 0, &Button)) + { + m_pClient->m_pGhost->UnloadAll(); + GhostlistPopulate(); + } }