Beispiel #1
0
int EView::OpenDir(char *Path) {
    char XPath[MAXPATH];
    EDirectory *dir = 0;

    if (ExpandPath(Path, XPath, sizeof(XPath)) == -1)
        return 0;
    {
        EModel *x = Model;
        while (x) {
            if (x->GetContext() == CONTEXT_DIRECTORY) {
                if (filecmp(((EDirectory *)x)->Path, XPath) == 0) {
                    dir = (EDirectory *)x;
                    break;
                }
            }
            x = x->Next;
            if (x == Model)
                break;
        }
    }
    if (dir == 0)
        dir = new EDirectory(0, &ActiveModel, XPath);
    SelectModel(dir);
    return 1;
}
DialogObject::DialogObject(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::DialogObject), dialogItem(this)
{
    ui->setupUi(this);
    ui->dialog->setEnabled(false);

    for (short i = 0 ; i < 4 ; ++i)
      ui->type->addItem(objectTypes[i]);

    connect(ui->interactionTalkTo, SIGNAL(toggled(bool)), ui->dialog, SLOT(setEnabled(bool)));
    connect(ui->type, SIGNAL(currentIndexChanged(QString)), this, SLOT(UpdateType(QString)));
    connect(this, SIGNAL(accepted()), this, SLOT(Apply()));
    connect(ui->buttonBox->button(QDialogButtonBox::Reset), SIGNAL(clicked()), this, SLOT(Reset()));

    connect(ui->itemList, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(ItemAdd()));
    connect(ui->inventory, SIGNAL(doubleClicked(QModelIndex)), this, SLOT(OpenItemDialog()));
    connect(&dialogItem, SIGNAL(accepted()), this, SLOT(ItemSave()));

    connect(ui->toolSelectCharsheet, SIGNAL(clicked()), this, SLOT(SelectCharsheet()));
    connect(ui->toolSelectScript,    SIGNAL(clicked()), this, SLOT(SelectScript()));
    connect(ui->toolSelectDialog,    SIGNAL(clicked()), this, SLOT(SelectDialog()));

    connect(ui->modelPick,   SIGNAL(clicked()), this, SLOT(SelectModel()));
    connect(ui->texturePick, SIGNAL(clicked()), this, SLOT(SelectTexture()));
}
void CUIPetStashSelectEffect::UpdateAni()
{
	DWORD nCurrent = timeGetTime();

	if ( nCurrent < m_dwAniStartTime + m_dwAniMaitionTime )
	{
		if (nCurrent > m_dwDelayTime)
		{
			m_nCurFrame = m_nCurFrame % m_nMaxFrame;

			m_aniLeft->SetRenderIdx( m_nCurFrame );
			m_aniMid->SetRenderIdx( m_nCurFrame + 1 );
			m_aniRight->SetRenderIdx( m_nCurFrame + 2 );

			m_dwDelayTime = nCurrent + m_dwDelay;
			m_dwDelay += m_dwSlowTime;
			m_nCurFrame++;

			_PlaySound(SOUND_TYPE_MOVE);
		}		
	}
	else
	{
		if ( m_bSelect == TRUE)
			EndAni();
		else
		{
			if ( nCurrent > m_dwDelayTime)
			{
				SelectModel();
			}			
		}
	}
}
void CEditAnimationDialog::CreateNewModel()
{
    TString ModelName = _T("NewModel");
    wxTreeItemId item = AddModelToTree(GetAvailableName(ModelName));
    SelectModel(item);
    ClearResourceLoadFlag();
}
//-----------------------------------------------------------------------------
// Precache - precaches all resources this NPC needs
//-----------------------------------------------------------------------------
void CNPC_Hutman::Precache()
{
    SelectModel( );
    BaseClass::Precache();

    PrecacheInstancedScene( HUTMAN_IDLE_SCENE );
}
Beispiel #6
0
static int premia_interactive_menu(  Planning          *pt_plan,
                                     Model             **models,
                                     Family            **families,
                                     Pricing           **pricings,
                                     int               user)
{

  Model*            pt_model;
  Option*           pt_option;
  Pricing*          pt_pricing;
  PricingMethod*    pt_method;
  DynamicTest*      pt_test;
  PricingMethod*    pt_methods_available[MAX_METHODS];

  if (OutputFile(&out_stream)!=OK) return WRONG;
  if (SelectModel(user,pt_plan,models,families,pricings,&pt_model)!=OK) return WRONG;
  if (SelectOption(user,pt_plan,families,pt_model,pricings,&pt_option)!=OK) return WRONG;
  if (SelectPricing(user,pt_model,pt_option,pricings,&pt_pricing)!=OK) return WRONG;

  while(1){
    if (SelectMethod(user,pt_plan,pt_pricing,pt_option,pt_model,&pt_method)!=OK)
      return FAIL;
    if (SelectTest(user,pt_plan,pt_pricing,pt_option,pt_model,pt_method,&pt_test)!=OK)
      return FAIL;
    if (GetTimeInfo(user,pt_plan,&computation_time_info)!=OK)
      return FAIL;
          
    if ((pt_plan->Action=='p')||
        (( pt_plan->Action=='t')&&
         (GetTest(user,pt_plan,pt_pricing,pt_option,pt_test)==OK))){
      (void)ShowPlanning(NAMEONLYTOFILE,pt_plan);
      (void)Action(pt_model,pt_option,pt_pricing,
                   pt_method,pt_test,NAMEONLYTOFILE,pt_plan,&computation_time_info);
      Fprintf(TOSCREEN,"\nComputing...\n");
      Iterate(pt_plan,&(pt_plan->Par[0]),0,pt_plan->Action,pt_model,pt_option,
              pt_pricing,pt_method,pt_test,TOFILE,&computation_time_info);
      pt_methods_available[pt_plan->NumberOfMethods]=pt_method;
      if (pt_plan->Action=='t' || MoreAction(&(pt_plan->NumberOfMethods))==FAIL)
        break;
      else
        free_premia_method(pt_method);
    }
  }

  fclose(out_stream);

  if ((pt_plan->Action=='p') && (pt_plan->VarNumber>0))
    (void)BuildGnuStuff(pt_plan,pt_model,pt_option,pt_pricing,pt_methods_available);

  if (pt_plan->Action=='t')
    {
      (void)FreeTest(pt_test); 
      (void)BuildGnuStuffTest(pt_model,pt_option,pt_pricing,pt_method,pt_test); 
    }
  free_premia_model(pt_model);
  free_premia_option(pt_option);
  free_premia_method(pt_method);
  return OK;
}
Beispiel #7
0
int EView::FileNext() {
    if (Model) {
        EModel *n = Model->Next;
        if (IgnoreBufferList && n && n->GetContext() == CONTEXT_BUFFERS) n = n->Next;
        SelectModel(n);
        return 1;
    }
    return 0;
}
Beispiel #8
0
	virtual void Precache()
	{
		// Prevents a warning
		SelectModel( );
		BaseClass::Precache();

		PrecacheScriptSound( "NPC_Barney.FootstepLeft" );
		PrecacheScriptSound( "NPC_Barney.FootstepRight" );
		PrecacheScriptSound( "NPC_Barney.Die" );

		PrecacheInstancedScene( "scenes/Expressions/BarneyIdle.vcd" );
		PrecacheInstancedScene( "scenes/Expressions/BarneyAlert.vcd" );
		PrecacheInstancedScene( "scenes/Expressions/BarneyCombat.vcd" );
	}
void CEditAnimationDialog::OnModelTreeItemChanged( wxTreeEvent& event )
{
    SelectModel(event.GetItem());
}