Added reload button in ghost menu

This commit is contained in:
Redix 2017-09-10 04:09:38 +02:00
parent 5b3e9e4bbf
commit 1e845a4020
2 changed files with 11 additions and 2 deletions

View file

@ -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);

View file

@ -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();
}
}