mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-17 02:51:27 +00:00
Implement progress failures
I took the liberty to improve the obvious failure cases where a red progress bar would be useful.
This commit is contained in:
@ -868,8 +868,8 @@ hsBool plClient::MsgReceive(plMessage* msg)
|
||||
// plResPatcherMsg
|
||||
//============================================================================
|
||||
if (plResPatcherMsg * resMsg = plResPatcherMsg::ConvertNoRef(msg)) {
|
||||
plgDispatch::Dispatch()->UnRegisterForExactType(plResPatcherMsg::Index(), GetKey());
|
||||
IOnAsyncInitComplete();
|
||||
IHandlePatcherMsg(resMsg);
|
||||
return true;
|
||||
}
|
||||
|
||||
return hsKeyedObject::MsgReceive(msg);
|
||||
@ -1300,7 +1300,10 @@ void plClient::IProgressMgrCallbackProc(plOperationProgress * progress)
|
||||
if (gTaskbarList)
|
||||
{
|
||||
HWND hwnd = fInstance->GetWindowHandle(); // lazy
|
||||
if (progress->IsLastUpdate())
|
||||
if (progress->IsAborting())
|
||||
// We'll assume this is fatal
|
||||
gTaskbarList->SetProgressState(hwnd, TBPF_ERROR);
|
||||
else if (progress->IsLastUpdate())
|
||||
gTaskbarList->SetProgressState(hwnd, TBPF_NOPROGRESS);
|
||||
else if (progress->GetMax() == 0.f)
|
||||
gTaskbarList->SetProgressState(hwnd, TBPF_INDETERMINATE);
|
||||
@ -2550,6 +2553,18 @@ void plClient::IHandlePreloaderMsg (plPreloaderMsg * msg) {
|
||||
IPatchGlobalAgeFiles();
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
void plClient::IHandlePatcherMsg (plResPatcherMsg * msg) {
|
||||
plgDispatch::Dispatch()->UnRegisterForExactType(plResPatcherMsg::Index(), GetKey());
|
||||
|
||||
if (!msg->Success()) {
|
||||
plNetClientApp::GetInstance()->QueueDisableNet(true, msg->GetError());
|
||||
return;
|
||||
}
|
||||
|
||||
IOnAsyncInitComplete();
|
||||
}
|
||||
|
||||
//============================================================================
|
||||
void plClient::IHandleNetCommAuthMsg (plNetCommAuthMsg * msg) {
|
||||
|
||||
|
@ -82,7 +82,7 @@ class plBinkPlayer;
|
||||
class plPreloaderMsg;
|
||||
class plNetCommAuthMsg;
|
||||
class plAgeLoaded2Msg;
|
||||
|
||||
class plResPatcherMsg;
|
||||
|
||||
typedef void (*plMessagePumpProc)( void );
|
||||
|
||||
@ -179,6 +179,7 @@ protected:
|
||||
|
||||
void ICompleteInit ();
|
||||
void IOnAsyncInitComplete ();
|
||||
void IHandlePatcherMsg (plResPatcherMsg * msg);
|
||||
void IHandlePreloaderMsg (plPreloaderMsg * msg);
|
||||
void IHandleNetCommAuthMsg (plNetCommAuthMsg * msg);
|
||||
bool IHandleAgeLoaded2Msg (plAgeLoaded2Msg * msg);
|
||||
|
Reference in New Issue
Block a user