void HideEditorToolbar( INT32 iOldTaskMode )
{
	INT32 i, iStart, iEnd;
	switch( iOldTaskMode )
	{
		case TASK_TERRAIN:		iStart = FIRST_TERRAIN_BUTTON;			iEnd = LAST_TERRAIN_BUTTON;			break;
		case TASK_BUILDINGS:	iStart = FIRST_BUILDINGS_BUTTON;		iEnd = LAST_BUILDINGS_BUTTON;		break;
		case TASK_ITEMS:			iStart = FIRST_ITEMS_BUTTON;				iEnd = LAST_ITEMS_BUTTON;				break;
		case TASK_MERCS:			iStart = FIRST_MERCS_BUTTON;				iEnd = LAST_MERCS_BUTTON;				break;
		case TASK_MAPINFO:		iStart = FIRST_MAPINFO_BUTTON;			iEnd = LAST_MAPINFO_BUTTON;		break;
		case TASK_OPTIONS:		iStart = FIRST_OPTIONS_BUTTON;			iEnd = LAST_OPTIONS_BUTTON;			break;
		default:		return;
	}
	for( i = iStart; i <= iEnd; i++ )
	{
		HideButton( iEditorButton[ i ] );
		UnclickEditorButton( i );
	}
}
void HideEditorButtons( INT32 iFirstEditorButtonID, INT32 iLastEditorButtonID )
{
	INT32 i;
	for( i = iFirstEditorButtonID; i <= iLastEditorButtonID; i++ )
		HideButton( iEditorButton[ i ] );
}
void HideEditorButton( INT32 iEditorButtonID )
{
	HideButton( iEditorButton[ iEditorButtonID ] );
}
Esempio n. 4
0
void ViewerToolBar::OnResetToolbar(NMHDR* notify_struct, LRESULT* result)
{
	*result = 0;
	ResetToolBar(false);
	HideButton(ID_STOP_SLIDE_SHOW);
}
void cScreenGirlDetails::init()
{
	if (selected_girl == 0)
	{
		g_WinManager.Pop();
		g_InitWin = true;
		g_LogFile.write("ERROR - girl details screen, selected_girl is null");
		/*
		*		adding this because the game will crash if we
		*		go past this point with a null girl
		*
		*		Now as to why it was null in the first place ...
		*		-- doc
		*/
		return;
	}

	g_CurrentScreen = SCREEN_GIRLDETAILS;
	if (!g_InitWin) return;

	Focused();
	g_InitWin = false;

	////////////////////
	if (selected_girl->health() <= 0)
	{
		// `J` instead of removing dead girls from the list which breaks the game, just skip past her in the list.
		NextGirl();								// `J` currently this prevents scrolling backwards past her - need to fix that.
//		selected_girl = remove_selected_girl();
		if (selected_girl == 0)
		{
			g_WinManager.Pop();
			g_InitWin = true;
			return;
		}
	}

	u_int job = (Day0Night1 ? selected_girl->m_NightJob : selected_girl->m_DayJob);
	SetJob = true;

	EditTextItem(selected_girl->m_Realname, girlname_id);

	string detail;
	if (DetailLevel == 0)		detail = g_Girls.GetDetailsString(selected_girl);
	else if (DetailLevel == 1)	detail = g_Girls.GetMoreDetailsString(selected_girl);
	else						detail = g_Girls.GetThirdDetailsString(selected_girl);
	EditTextItem(detail, girldesc_id);

	if (selected_girl)
	{
		if (lastsexact != -1)
		{
			PrepareImage(girlimage_id, selected_girl, lastsexact, true, ImageNum);
			lastsexact = -1;
		}
		else
		{
			if (selected_girl->m_newRandomFixed >= 0)
			{
				PrepareImage(girlimage_id, selected_girl, IMGTYPE_PROFILE, false, selected_girl->m_newRandomFixed);
			}
			else
			{
				PrepareImage(girlimage_id, selected_girl, IMGTYPE_PROFILE, true, ImageNum);
			}
		}
	}

	SliderRange(houseperc_id, 0, 100, g_Girls.GetStat(selected_girl, STAT_HOUSE), 10);
	ss.str("");
	ss << gettext("House Percentage: ") << SliderValue(houseperc_id) << gettext("%");
	EditTextItem(ss.str(), housepercval_id);

	ClearListBox(jobtypelist_id);

	// `J` Replacing accom buttons with slider
	if (accomdown_id != -1)	DisableButton(accomdown_id, selected_girl->m_AccLevel < 1);
	if (accomup_id != -1)	DisableButton(accomup_id, selected_girl->m_AccLevel > 9);
	if (accom_id != -1)
	{
		SliderRange(accom_id, 0, 9, selected_girl->m_AccLevel, 1);
		SliderMarker(accom_id, g_Girls.PreferredAccom(selected_girl));
	}
	if (accomval_id != -1)
	{
		stringstream acc;
		acc << "Accommodation: " << g_Girls.Accommodation(SliderValue(accom_id));
		if (cfg.debug.log_extradetails())
		{
			int val = SliderValue(accom_id) - g_Girls.PreferredAccom(selected_girl);
			if (val != 0) acc << "  ( " << (val > 0 ? "+" : "") << val << " )";
		}
		EditTextItem(acc.str(), accomval_id);
	}
	DisableButton(interact_id, (g_TalkCount <= 0));
	DisableButton(takegold_id, (selected_girl->m_Money <= 0));
	SetCheckBox(antipreg_id, (selected_girl->m_UseAntiPreg));

	bool InMovieStudio = (selected_girl->m_InStudio);
	bool InArena = (selected_girl->m_InArena);
	bool InCentre = (selected_girl->m_InCentre);
	bool InClinic = (selected_girl->m_InClinic);
	bool InHouse = (selected_girl->m_InHouse);
	bool InFarm = (selected_girl->m_InFarm);
	bool InDungeon = (selected_girl->m_DayJob == JOB_INDUNGEON);
	DisableButton(reldungeon_id, !InDungeon);
	DisableButton(senddungeon_id, InDungeon);

	// Disable dungeon if selected girl is in a non-brothel building
//	if (InMovieStudio || InArena || InCentre || InClinic || InFarm || InHouse) 
//	{
//		DisableButton(senddungeon_id, true);
//	}

	if (InArena)
	{
		ClearListBox(joblist_id);
		AddToListBox(jobtypelist_id, JOBFILTER_ARENASTAFF, g_Arena.m_JobManager.JobFilterName[JOBFILTER_ARENASTAFF]);
		AddToListBox(jobtypelist_id, JOBFILTER_ARENA, g_Arena.m_JobManager.JobFilterName[JOBFILTER_ARENA]);
		RefreshJobList();
		if (job >= g_Arena.m_JobManager.JobFilterIndex[JOBFILTER_ARENA] && job < g_Arena.m_JobManager.JobFilterIndex[JOBFILTER_ARENA + 1])
			SetSelectedItemInList(jobtypelist_id, JOBFILTER_ARENA);
		else // if (job >= g_Arena.m_JobManager.JobFilterIndex[JOBFILTER_ARENASTAFF] && job < g_Arena.m_JobManager.JobFilterIndex[JOBFILTER_ARENASTAFF + 1])
			SetSelectedItemInList(jobtypelist_id, JOBFILTER_ARENASTAFF);
		HideButton(day_id, false);
		HideButton(night_id, false);
		DisableButton(day_id, (Day0Night1 == SHIFT_DAY));
		DisableButton(night_id, (Day0Night1 == SHIFT_NIGHT));
	}
	else if (InClinic)
	{
		ClearListBox(joblist_id);
		AddToListBox(jobtypelist_id, JOBFILTER_CLINIC, g_Clinic.m_JobManager.JobFilterName[JOBFILTER_CLINIC]);
		AddToListBox(jobtypelist_id, JOBFILTER_CLINICSTAFF, g_Clinic.m_JobManager.JobFilterName[JOBFILTER_CLINICSTAFF]);
		RefreshJobList();
		if (job >= g_Clinic.m_JobManager.JobFilterIndex[JOBFILTER_CLINIC] && job < g_Clinic.m_JobManager.JobFilterIndex[JOBFILTER_CLINIC + 1])
			SetSelectedItemInList(jobtypelist_id, JOBFILTER_CLINIC);
		else SetSelectedItemInList(jobtypelist_id, JOBFILTER_CLINICSTAFF);
		HideButton(day_id, false);
		HideButton(night_id, false);
		DisableButton(day_id, (Day0Night1 == SHIFT_DAY));
		DisableButton(night_id, (Day0Night1 == SHIFT_NIGHT));
	}
	else if (InCentre)
	{
		ClearListBox(joblist_id);
		AddToListBox(jobtypelist_id, JOBFILTER_COMMUNITYCENTRE, g_Centre.m_JobManager.JobFilterName[JOBFILTER_COMMUNITYCENTRE]);
		AddToListBox(jobtypelist_id, JOBFILTER_COUNSELINGCENTRE, g_Centre.m_JobManager.JobFilterName[JOBFILTER_COUNSELINGCENTRE]);
		RefreshJobList();
		if (job >= g_Centre.m_JobManager.JobFilterIndex[JOBFILTER_COUNSELINGCENTRE] && job < g_Centre.m_JobManager.JobFilterIndex[JOBFILTER_COUNSELINGCENTRE + 1])
			SetSelectedItemInList(jobtypelist_id, JOBFILTER_COUNSELINGCENTRE);
		else SetSelectedItemInList(jobtypelist_id, JOBFILTER_COMMUNITYCENTRE);
		HideButton(day_id, false);
		HideButton(night_id, false);
		DisableButton(day_id, (Day0Night1 == SHIFT_DAY));
		DisableButton(night_id, (Day0Night1 == SHIFT_NIGHT));
	}
	else if (InHouse)
	{
		ClearListBox(joblist_id);
		AddToListBox(jobtypelist_id, JOBFILTER_HOUSE, g_House.m_JobManager.JobFilterName[JOBFILTER_HOUSE]);
		SetSelectedItemInList(jobtypelist_id, JOBFILTER_HOUSE);
		RefreshJobList();
		HideButton(day_id, false);
		HideButton(night_id, false);
		DisableButton(day_id, (Day0Night1 == SHIFT_DAY));
		DisableButton(night_id, (Day0Night1 == SHIFT_NIGHT));
	}
	else if (InMovieStudio)
	{
		Day0Night1 = SHIFT_NIGHT;
		ClearListBox(joblist_id);
		AddToListBox(jobtypelist_id, JOBFILTER_STUDIOCREW, g_Studios.m_JobManager.JobFilterName[JOBFILTER_STUDIOCREW]);
		AddToListBox(jobtypelist_id, JOBFILTER_MOVIESTUDIO, g_Studios.m_JobManager.JobFilterName[JOBFILTER_MOVIESTUDIO]);
		RefreshJobList();
		if (job >= g_Studios.m_JobManager.JobFilterIndex[JOBFILTER_MOVIESTUDIO] && job < g_Studios.m_JobManager.JobFilterIndex[JOBFILTER_MOVIESTUDIO + 1])
			SetSelectedItemInList(jobtypelist_id, JOBFILTER_MOVIESTUDIO);
		else SetSelectedItemInList(jobtypelist_id, JOBFILTER_STUDIOCREW);
		HideButton(day_id, true);
		HideButton(night_id, true);

	}
	else if (InFarm)
	{
		ClearListBox(joblist_id);
		AddToListBox(jobtypelist_id, JOBFILTER_FARMSTAFF, g_Farm.m_JobManager.JobFilterName[JOBFILTER_FARMSTAFF]);
		AddToListBox(jobtypelist_id, JOBFILTER_LABORERS, g_Farm.m_JobManager.JobFilterName[JOBFILTER_LABORERS]);
		AddToListBox(jobtypelist_id, JOBFILTER_PRODUCERS, g_Farm.m_JobManager.JobFilterName[JOBFILTER_PRODUCERS]);
		RefreshJobList();
		if (job >= g_Farm.m_JobManager.JobFilterIndex[JOBFILTER_LABORERS] && job < g_Farm.m_JobManager.JobFilterIndex[JOBFILTER_LABORERS + 1])
			SetSelectedItemInList(jobtypelist_id, JOBFILTER_LABORERS);
		else if (job >= g_Farm.m_JobManager.JobFilterIndex[JOBFILTER_PRODUCERS] && job < g_Farm.m_JobManager.JobFilterIndex[JOBFILTER_PRODUCERS + 1])
			SetSelectedItemInList(jobtypelist_id, JOBFILTER_PRODUCERS);
		else SetSelectedItemInList(jobtypelist_id, JOBFILTER_FARMSTAFF);
		HideButton(day_id, false);
		HideButton(night_id, false);
		DisableButton(day_id, (Day0Night1 == SHIFT_DAY));
		DisableButton(night_id, (Day0Night1 == SHIFT_NIGHT));

	}
	else if (!InDungeon)
	{  // if not in dungeon, set up job lists
		// add the job filters
		//	for(int i=0; i<NUMJOBTYPES; i++)  // loop through all job types
		for (unsigned int i = 0; i <= JOBFILTER_BROTHEL; i++)  // temporary limit to job types shown
		{
			AddToListBox(jobtypelist_id, i, g_Brothels.m_JobManager.JobFilterName[i]);
		}

		// set the job filter
		int jobtype = 0;
		for (unsigned int i = 0; i < NUMJOBTYPES; i++)
		{
			if (job >= g_Brothels.m_JobManager.JobFilterIndex[i] && job < g_Brothels.m_JobManager.JobFilterIndex[i + 1])
			{
				jobtype = i;
				break;
			}
		}
		SetSelectedItemInList(jobtypelist_id, jobtype);
		RefreshJobList();

		HideButton(day_id, false);
		HideButton(night_id, false);
		DisableButton(day_id, (Day0Night1 == SHIFT_DAY));
		DisableButton(night_id, (Day0Night1 == SHIFT_NIGHT));
	}
	else
	{  // if in dungeon, effectively disable job lists
		ClearListBox(joblist_id);
		AddToListBox(jobtypelist_id, -1, gettext("Languish in dungeon"));
		HideButton(day_id, true);
		HideButton(night_id, true);
	}

	ClearListBox(traitlist_id);
	for (int i = 0; i < MAXNUM_TRAITS; i++)
	{
		if (selected_girl->m_Traits[i])
		{
			stringstream st;
			st << selected_girl->m_Traits[i]->m_Name;
			if (selected_girl->m_TempTrait[i] > 0) st << "   (" << selected_girl->m_TempTrait[i] << ")";
			AddToListBox(traitlist_id, i, g_Traits.GetTranslateName(st.str()));
		}
	}
	EditTextItem("", traitdesc_id);
}
Esempio n. 6
0
void cScreenTown::init()
{
	if (BuyClinic != -1)
	{
		(g_ChoiceManager.GetChoice(0) == 0 ? GetClinic = true : BuyClinic = -1);
		g_ChoiceManager.Free();
	}
	if (GetClinic)
	{
		static_brothel_data *bpt = clinic_data + BuyClinic;
		g_Gold.brothel_cost(bpt->price);
		g_Clinic.NewBrothel(bpt->rooms, bpt->maxrooms);
		g_Clinic.SetName(0, gettext("Clinic"));
		GetClinic = false;
		BuyClinic = -1;
	}
	if (BuyCentre != -1)
	{
		(g_ChoiceManager.GetChoice(0) == 0 ? GetCentre = true : BuyCentre = -1);
		g_ChoiceManager.Free();
	}
	if (GetCentre)
	{
		static_brothel_data *bpt = centre_data + BuyCentre;
		g_Gold.brothel_cost(bpt->price);
		g_Centre.NewBrothel(bpt->rooms, bpt->maxrooms);
		g_Centre.SetName(0, gettext("Centre"));
		GetCentre = false;
		BuyCentre = -1;
	}
	if (BuyArena != -1)
	{
		(g_ChoiceManager.GetChoice(0) == 0 ? GetArena = true : BuyArena = -1);
		g_ChoiceManager.Free();
	}
	if (GetArena)
	{
		static_brothel_data *bpt = arena_data + BuyArena;

		g_Gold.brothel_cost(bpt->price);
		g_Arena.NewBrothel(bpt->rooms, bpt->maxrooms);
		g_Arena.SetName(0, gettext("Arena"));

		GetArena = false;
		BuyArena = -1;
	}
	if (BuyStudio != -1)
	{
		(g_ChoiceManager.GetChoice(0) == 0 ? GetStudio = true : BuyStudio = -1);
		g_ChoiceManager.Free();
	}
	if (GetStudio)
	{
		static_brothel_data *bpt = studio_data + BuyStudio;
		g_Gold.brothel_cost(bpt->price);
		g_Studios.NewBrothel(bpt->rooms, bpt->maxrooms);
		g_Studios.SetName(0, gettext("Studio"));
		GetStudio = false;
		BuyStudio = -1;
	}
	if (BuyFarm != -1)
	{
		(g_ChoiceManager.GetChoice(0) == 0 ? GetFarm = true : BuyFarm = -1);
		g_ChoiceManager.Free();
	}
	if (GetFarm)
	{
		static_brothel_data *bpt = farm_data + BuyFarm;
		g_Gold.brothel_cost(bpt->price);
		g_Farm.NewBrothel(bpt->rooms, bpt->maxrooms);
		g_Farm.SetName(0, gettext("Farm"));
		GetFarm = false;
		BuyFarm = -1;
	}
	if (GetName)
	{
		if (g_ReturnText != "")
		{
			if (g_Brothels.GetObjective() && g_Brothels.GetObjective()->m_Objective == OBJECTIVE_GETNEXTBROTHEL) 
				g_Brothels.PassObjective();
			static_brothel_data *bpt = brothel_data + BuyBrothel;
			g_Gold.brothel_cost(bpt->price);
			g_Brothels.NewBrothel(bpt->rooms, bpt->maxrooms);
			g_Brothels.SetName(g_Brothels.GetNumBrothels() - 1, g_ReturnText);
			g_InitWin = true;
		}
		GetName = false;
		BuyBrothel = -1;
	}
	if (BuyBrothel != -1)
	{
		if (g_ChoiceManager.GetChoice(0) == 0)
		{
			g_MessageQue.AddToQue("Enter a name for your new brothel.", 0);
			GetName = true;
			g_InitWin = true;
			g_WinManager.Push(GetString, &g_GetString);
		}
		else BuyBrothel = -1;
		g_ChoiceManager.Free();
		if (!GetName) BuyBrothel = -1;
		return;
	}
	g_CurrentScreen = SCREEN_TOWN;
	if (!g_InitWin) return;

	Focused();
	g_InitWin = false;

	// buttons enable/disable
	DisableButton(walk_id, g_WalkAround);

	HideButton(brothel2_id, (g_Brothels.GetBrothel(1) == 0));
	HideButton(brothel3_id, (g_Brothels.GetBrothel(2) == 0));
	HideButton(brothel4_id, (g_Brothels.GetBrothel(3) == 0));
	HideButton(brothel5_id, (g_Brothels.GetBrothel(4) == 0));
	HideButton(brothel6_id, (g_Brothels.GetBrothel(5) == 0));

	string brothel = "Current Brothel: ";
	brothel += g_Brothels.GetName(g_CurrBrothel);
	EditTextItem(brothel, curbrothel_id);
}