コード例 #1
0
ファイル: UIGifAnimEx.cpp プロジェクト: FJSDS/DuiLib_Ultimate
		void EventSetVisible(bool bVisible)
		{
			if(bVisible)
			{
				if(!m_bRealStop)
					StartAnim();
			}
			else
				StopAnim(true);
		}
コード例 #2
0
ファイル: cars.c プロジェクト: vcosta/derclou
void tcColorCar(Car car)
{
    LIST *colors, *bubble;
    ubyte choice;
    U32 costs;
    Person marc = (Person) dbGetObject(Person_Marc_Smith);

    costs = (U32)tcColorCosts(car);

    bubble = txtGoKeyAndInsert(BUSINESS_TXT, "LACKIEREN", (U32) costs, NULL);

    SetPictID(marc->PictID);
    Bubble(bubble, 0, 0L, 0L);
    RemoveList(bubble);

    if (Say(BUSINESS_TXT, 0, MATT_PICTID, "LACKIEREN_ANT") == 0) {
	colors = txtGoKey(OBJECTS_ENUM_TXT, "enum_ColorE");

	txtPutCharacter(colors, 0, '*');

	if (tcSpendMoney(costs, 1)) {
	    char exp[TXT_KEY_LENGTH];

	    txtGetFirstLine(BUSINESS_TXT, "NO_CHOICE", exp);
	    ExpandObjectList(colors, exp);

	    if (ChoiceOk
		(choice =
		 Bubble(colors, (ubyte) car->ColorIndex, 0L, 0L), GET_OUT,
		 colors)) {
		car->ColorIndex = (ubyte) choice;

		SetCarColors(car->ColorIndex);
		gfxPrepareRefresh();
		PlayAnim("Umlackieren", 3000, GFX_DONT_SHOW_FIRST_PIC);

		inpSetWaitTicks(200L);

		inpWaitFor(INP_LBUTTONP | INP_TIME);

		StopAnim();
		inpSetWaitTicks(1L);

		gfxRefresh();
		/*gfxShow(26,GFX_NO_REFRESH|GFX_ONE_STEP,0L,-1L,-1L);*/
		/*gfxShow((uword)car->PictID,GFX_NO_REFRESH|GFX_OVERLAY,1L,-1L,-1L);*/
	    }
	}

	RemoveList(colors);
    }

    AddVTime(137);
}
コード例 #3
0
ファイル: cars.c プロジェクト: vcosta/derclou
void tcRepairCar(Car car, char *repairWhat)
{
    LIST *presentationData = CreateList();
    LIST *list = NULL;
    ubyte *item = NULL, type = 7, ready = 0;
    bool enough = true;
    U32 costs = 0, choice = 0L, totalCosts = 0L;
    uword line = 0;
    Person marc = (Person) dbGetObject(Person_Marc_Smith);

    if (strcmp(repairWhat, "MotorRepair") == 0) {
	item = &car->MotorState;
	costs = tcCostsPerEngineRepair(car);
	type = 1;
    } else {
	if (strcmp(repairWhat, "BodyRepair") == 0) {
	    item = &car->BodyWorkState;
	    costs = tcCostsPerBodyRepair(car);
	    type = 2;
	} else {
	    if (strcmp(repairWhat, "TyreRepair") == 0) {
		item = &car->TyreState;
		costs = tcCostsPerTyreRepair(car);
		type = 4;
	    } else
		costs = tcCostsPerTotalRepair(car);
	}
    }

    if (!(enough = tcSpendMoney(costs, 0)))
	return;

    list = txtGoKey(PRESENT_TXT, repairWhat);

    gfxPrepareRefresh();
    gfxShow((uword) BIG_SHEET, GFX_NO_REFRESH | GFX_OVERLAY, 0L, -1L, -1L);
    inpSetWaitTicks(3L);

    PlayAnim("Reperatur", 30000, GFX_DONT_SHOW_FIRST_PIC);

    while (!(choice & INP_LBUTTONP) && enough && (!ready)) {
	line = 0;

	AddVTime(3);

	AddPresentTextLine(presentationData, NULL, 0L, list, line++);

	if (item)
	    AddPresentLine(presentationData, PRESENT_AS_BAR, (U32) (*item),
			   255L, list, line++);

	AddPresentLine(presentationData, PRESENT_AS_BAR, (U32) (car->State),
		       255L, list, line++);

	AddPresentLine(presentationData, PRESENT_AS_NUMBER, totalCosts, 0L,
		       list, line++);
	AddPresentLine(presentationData, PRESENT_AS_NUMBER,
		       (U32) tcGetPlayerMoney, 0L, list, line++);

	DrawPresent(presentationData, 0, u_gc,
		    (ubyte) GetNrOfNodes(presentationData));

	RemoveNode(presentationData, NULL);

	choice = inpWaitFor(INP_LBUTTONP | INP_TIME);

	if (choice & INP_TIME) {
	    if ((enough = tcSpendMoney(costs, 1))) {
		totalCosts += costs;

		if (type & 1)
		    tcSetCarMotorState(car, 1);

		if (type & 2)
		    tcSetCarBodyState(car, 1);

		if (type & 4)
		    tcSetCarTyreState(car, 1);
	    }
	}

	if (item) {
	    if ((*item) == 255) {
		StopAnim();
		gfxRefresh();
		Say(BUSINESS_TXT, 0, marc->PictID, "REP_READY");
		ready = 1;
	    }
	} else {
	    if (tcGetCarTotalState(car) > 253) {
		StopAnim();
		gfxRefresh();
		Say(BUSINESS_TXT, 0, marc->PictID, "REP_READY");
		ready = 1;
	    }
	}
    }

    if (!ready) {
	StopAnim();
	gfxRefresh();
    }

    inpSetWaitTicks(0L);

    /*gfxShow(26,GFX_NO_REFRESH|GFX_ONE_STEP,0L,-1L,-1L);*/
    /*gfxShow((uword)car->PictID,GFX_NO_REFRESH|GFX_OVERLAY,1L,-1L,-1L);*/

    RemoveList(presentationData);
    RemoveList(list);
}
コード例 #4
0
ファイル: evidence.c プロジェクト: vcosta/derclou
S32 tcEscapeByCar(U32 escBits, S32 timeLeft)
{
    Person gludo = dbGetObject(Person_John_Gludo);
    Person miles = dbGetObject(Person_Miles_Chickenwing);
    ubyte escapeSucc;

    if (timeLeft > 0)
	escapeSucc = FAHN_ESCAPED;
    else
	escapeSucc = FAHN_NOT_ESCAPED;

    /* Flucht per Auto! */
    if (escapeSucc == FAHN_ESCAPED) {
	if ((Search.BuildingId != Building_Tower_of_London) &&
	    (Search.BuildingId != Building_Starford_Kaserne))
	    escapeSucc = tcCalcCarEscape(timeLeft);
    } else
	tcMattGoesTo(7);	/* Polizei */

    /* Ausgabe : Flucht gelungen, Flucht nicht gelungen */
    if (escapeSucc == FAHN_ESCAPED) {
	if ((escBits & FAHN_ALARM) || (escBits & FAHN_QUIET_ALARM)) {
	    Say(BUSINESS_TXT, 0, gludo->PictID, "HINWEIS_0");	/* entkommen!  */
	    Say(BUSINESS_TXT, 0, miles->PictID, "HINWEIS_2");	/* woher Hinweis? */
	} else
	    Say(BUSINESS_TXT, 0, OLD_MATT_PICTID, "I_ESCAPED");	/* no problems */
    } else {
	Say(BUSINESS_TXT, 0, gludo->PictID, "HINWEIS_1");	/* geschnappt! */
	Say(BUSINESS_TXT, 0, miles->PictID, "HINWEIS_2");	/* woher Hinweis? */
    }

    /* Gludo erz�hlt woher Hinweise stammten (falls es welche gibt) */
    if (escBits & FAHN_ALARM) {
	if (escBits & FAHN_ALARM_ALARM)
	    Say(BUSINESS_TXT, 0, gludo->PictID, "HINWEIS_6");	/* Alarmanlage */

	if (escBits & FAHN_ALARM_POWER)
	    Say(BUSINESS_TXT, 0, gludo->PictID, "HINWEIS_8");

	if (escBits & FAHN_ALARM_TIMER)
	    Say(BUSINESS_TXT, 0, gludo->PictID, "HINWEIS_6");	/* Alarmanlage */

	if (escBits & FAHN_ALARM_MICRO)
	    Say(BUSINESS_TXT, 0, gludo->PictID, "HINWEIS_9");

	if (escBits & FAHN_ALARM_TIMECLOCK)
	    Say(BUSINESS_TXT, 0, gludo->PictID, "HINWEIS_7");	/* Alarmanlage */

	if (escBits & FAHN_ALARM_GUARD)
	    Say(BUSINESS_TXT, 0, gludo->PictID, "HINWEIS_10");
    } else {
	if (escBits & FAHN_QUIET_ALARM) {
	    if (escBits & FAHN_ALARM_RADIO)
		Say(BUSINESS_TXT, 0, gludo->PictID, "HINWEIS_5");

	    if (escBits & FAHN_ALARM_PATRO)
		Say(BUSINESS_TXT, 0, gludo->PictID, "HINWEIS_4");

	    if (escBits & FAHN_ALARM_LOUDN)
		Say(BUSINESS_TXT, 0, gludo->PictID, "HINWEIS_3");
	}
    }

    if (escapeSucc != FAHN_ESCAPED)
	StopAnim();

    return ((S32) escapeSucc);
}