예제 #1
0
void GameModel::SetSaveFile(SaveFile * newSave)
{
	SetSave(NULL);

	if(newSave && newSave->GetGameSave())
	{
		GameSave * saveData = newSave->GetGameSave();
		SetPaused(saveData->paused & GetPaused());
		sim->gravityMode = saveData->gravityMode;
		sim->air->airMode = saveData->airMode;
		sim->legacy_enable = saveData->legacyEnable;
		sim->water_equal_test = saveData->waterEEnabled;
		if(saveData->gravityEnable && !sim->grav->ngrav_enable)
		{
			sim->grav->start_grav_async();
		}
		else if(!saveData->gravityEnable && sim->grav->ngrav_enable)
		{
			sim->grav->stop_grav_async();
		}
		sim->clear_sim();
		sim->Load(saveData);
	}
	
	notifySaveChanged();
	UpdateQuickOptions();
}
예제 #2
0
bool ItemAttributeMgr::Load(bool notify) {

    // save & set notify state
    bool old_notify = GetNotify();
    SetNotify(notify);

    // save & set save state
    bool old_save = GetSave();
    SetSave(false);

    // delete old contents
    EVEAdvancedAttributeMgr::Delete();
    // load the new contents
    bool res = m_factory.db().LoadItemAttributes(item().itemID(), *this);

    // restore save state
    SetSave(old_save);

    // restore notify state
    SetNotify(old_notify);

    return res;
}
예제 #3
0
파일: KeysTab.cpp 프로젝트: cryham/cAmp
bool cAmp::KeysEdit(bool shift, WPARAM k)
{
	//  Edit Tab Name
	switch(k)  {	// strlen, left,right,ctrl, home,end ...
		//  <del
		case VK_BACK:  ied--;  if (ied<0) ied=0;  sed[ied]=0;  fTi=0.5f;  rt
		
		case VK_ESCAPE: case VK_F2: case VK_F3:  GuiOff();  rt	//  exit

		case VK_RETURN: //  accept
			switch(ed)	{
				case ED_nTab:
				{	pls->name = sed;	GuiOff();
					pls->Save();  SetSave();  }  rt
				case ED_nFind:
				{	scpy(srch, sed);  GuiOff();  DoSearch();  }  rt
			}	rt

		default:	//  add char
		{	if (ied >= (ed==ED_nTab?NamePls:NameSrch)-1)  rt
			char c = 0;
			//  key char codes
			if (k>='0' && k<='9'){	if (shift) c=chShNum[k-'0']; else c=k;  }  else
			if (k>='A' && k<='Z'){	if (shift) c=k; else c=k-'A'+'a';  }  else
			switch (k)
			{
				case VK_SPACE:		c=' ';  break;
				case VK_OEM_3:		if (shift) c='~'; else c='`';  break;
				case VK_OEM_MINUS:	if (shift) c='_'; else c='-';  break;
				case VK_OEM_PLUS:	if (shift) c='+'; else c='=';  break;
				case VK_OEM_4:		if (shift) c='{'; else c='[';  break;
				case VK_OEM_6:		if (shift) c='}'; else c=']';  break;
				case VK_OEM_7:		c='\'';  break;
				case VK_OEM_PERIOD:	c='.';  break;
				case VK_OEM_COMMA:	c=',';  break;
			}
			if (c==0)  rt	//  write char
			sed[ied]= (char)c;  ied++;  sed[ied]=0;  fTi=0.5f;
			//... le ri del bck
		}  rt
	}	rf
}
예제 #4
0
int ProblemStavSave(Stav* s, char** pBuf) {
  bufwriteone(s->v, *pBuf);
  SetSave(s->m, pBuf);
  return 1;
}