本文整理汇总了C++中cWindowManager::Pop方法的典型用法代码示例。如果您正苦于以下问题:C++ cWindowManager::Pop方法的具体用法?C++ cWindowManager::Pop怎么用?C++ cWindowManager::Pop使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cWindowManager
的用法示例。
在下文中一共展示了cWindowManager::Pop方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: check_events
void cScreenGetInput::check_events()
{
if (g_InterfaceEvents.GetNumEvents() != 0 || g_EnterKey)
{
switch (m_profile)
{
case (MODE_CONFIRM_EXIT) :
CheckEvents_ConfirmExit();
break;
default:
if (g_InterfaceEvents.CheckEvent(EVENT_BUTTONCLICKED, id_btn_ok))
{
g_EnterKey = false;
g_ReturnText = GetEditBoxText(id_textfield);
g_IntReturn = atol(g_ReturnText.c_str());
g_InitWin = true;
g_WinManager.Pop();
return;
}
else if (g_InterfaceEvents.CheckEvent(EVENT_BUTTONCLICKED, id_btn_cancel))
g_WinManager.Pop();
}
}
}
示例2: process
void cArenaTry::process()
{
if (!ids_set) set_ids(); // we need to make sure the ID variables are set
init();
if (g_InterfaceEvents.GetNumEvents() == 0) return; // no events means we can go home
/*
* otherwise, compare event IDs
*
* if it's the back button, pop the window off the stack
* and we're done
*/
if (g_InterfaceEvents.CheckButton(back_id))
{
g_InitWin = true;
g_WinManager.Pop();
return;
}
else if (g_InterfaceEvents.CheckButton(walk_id))
{
do_walk();
if (!g_Cheats) g_TryOuts = true;
g_InitWin = true;
}
}
示例3: check_events
void cScreenMovieMaker::check_events()
{
// no events means we can go home
if(g_InterfaceEvents.GetNumEvents() == 0)
return;
// if it's the back button, pop the window off the stack and we're done
if(g_InterfaceEvents.CheckButton(back_id)) {
g_InitWin = true;
g_WinManager.Pop();
return;
}
// if it's the back button, pop the window off the stack and we're done
if(g_InterfaceEvents.CheckButton(releasemovie_id)) {
g_InitWin = true;
g_WinManager.Pop();
g_Studios.ReleaseCurrentMovie();
return;
}
}
示例4: game_over
static int game_over(lua_State *L)
{
cScriptManager sm;
g_MessageQue.AddToQue("GAME OVER", COLOR_RED);
g_WinManager.PopToWindow(&g_BrothelManagement);
g_WinManager.Pop();
g_InitWin = true;
sm.Release();
return 0;
}
示例5: check_events
void cScreenHouse::check_events()
{
if (g_InterfaceEvents.GetNumEvents() == 0) return; // no events means we can go home
// if it's the back button, pop the window off the stack and we're done
if (g_InterfaceEvents.CheckButton(back_id))
{
g_InitWin = true;
g_WinManager.Pop();
return;
}
}
示例6: CheckEvents_ConfirmExit
void cScreenGetInput::CheckEvents_ConfirmExit()
{
if (g_InitWin)
{
Focused();
g_InitWin = false;
}
if (g_InterfaceEvents.GetNumEvents() == 0 && !g_EnterKey) {
return;
}
if (g_InterfaceEvents.CheckButton(id_btn_cancel)) {
g_ReturnText = "";
g_InitWin = true;
g_WinManager.Pop();
return;
}
if (g_InterfaceEvents.CheckButton(id_btn_ok) || g_EnterKey) {
g_EnterKey = false;
g_ReturnText = "";
g_InitWin = true;
g_WinManager.Pop();
g_WinManager.Pop();
ResetInterface();
// Schedule Quit Event -- To quit
//SDL_Event ev;
//ev->type = SDL_QUIT;
//if (!SDL_PushEvent(ev))
// g_LogFile.write("SDL Quit Re-Scheduled!");
}
}
示例7: check_events
void cScreenMayor::check_events()
{
if (g_InterfaceEvents.GetNumEvents() == 0) return; // no events means we can go home
if (g_InterfaceEvents.CheckButton(back_id)) // if it's the back button, pop the window off the stack and we're done
{
g_InitWin = true;
g_WinManager.Pop();
return;
}
if (g_InterfaceEvents.CheckButton(bribe_id))
{
SetBribe = true;
g_GetInput.ModeGetInt();
g_WinManager.push("GetInput");
g_InitWin = true;
return;
}
}
示例8: check_brothel
// player clicked on one of the brothels
void cScreenTown::check_brothel(int BrothelNum)
{
if (g_Brothels.GetNumBrothels() == BrothelNum) // player doesn't own this brothel... can he buy it?
{
static_brothel_data *bck = brothel_data + BrothelNum;
locale syslocale("");
stringstream ss;
ss.imbue(syslocale);
if (!g_Gold.afford(bck->price) || g_Gangs.GetNumBusinessExtorted() < bck->business)
{ // can't buy it
ss << gettext("This building costs ") << bck->price << gettext(" gold and you need to control at least ") << bck->business << gettext(" businesses.");
if (!g_Gold.afford(bck->price))
ss << "\n" << gettext("You need ") << (bck->price - g_Gold.ival()) << gettext(" more gold to afford it.");
if (g_Gangs.GetNumBusinessExtorted() < bck->business)
ss << "\n" << gettext("You need to control ") << (bck->business - g_Gangs.GetNumBusinessExtorted()) << gettext(" more businesses.");
g_MessageQue.AddToQue(ss.str(), 0);
}
else // can buy it
{
ss << gettext("Do you wish to purchase this building for ") << bck->price << gettext(" gold? It has ") << bck->rooms << gettext(" rooms.");
g_MessageQue.AddToQue(ss.str(), 2);
g_ChoiceManager.CreateChoiceBox(224, 112, 352, 384, 0, 2, 32, 8);
g_ChoiceManager.AddChoice(0, gettext("Buy It"), 0);
g_ChoiceManager.AddChoice(0, gettext("Don't Buy It"), 1);
g_ChoiceManager.SetActive(0);
BuyBrothel = BrothelNum;
}
}
else // player owns this brothel... go to it
{
g_Building = BUILDING_BROTHEL;
g_CurrBrothel = BrothelNum;
g_WinManager.Pop();
}
}
示例9: process
void cScreenTown::process()
{
if (!ids_set)set_ids(); // we need to make sure the ID variables are set
init();
if (g_InterfaceEvents.GetNumEvents() == 0) return; // no events means we can go home
if (girlimage_id != -1 && !eventrunning) HideImage(girlimage_id, true);
/*
* otherwise, compare event IDs
*
* if it's the back button, pop the window off the stack
* and we're done
*/
/* */if (g_InterfaceEvents.CheckButton(back_id)) { g_InitWin = true; g_WinManager.Pop(); return; }
else if (g_InterfaceEvents.CheckButton(slavemarket_id)) { g_InitWin = true; g_WinManager.push("Slave Market"); return; }
else if (g_InterfaceEvents.CheckButton(prison_id)) { g_InitWin = true; g_WinManager.push("Prison"); return; }
else if (g_InterfaceEvents.CheckButton(house_id)) { g_Building = BUILDING_HOUSE; g_CurrHouse = 0; g_InitWin = true; g_WinManager.push("Player House"); return; }
else if (g_InterfaceEvents.CheckButton(clinic_id)) { check_clinic(0); g_InitWin = true; return; }
else if (g_InterfaceEvents.CheckButton(studio_id)) { check_studio(0); g_InitWin = true; return; }
else if (g_InterfaceEvents.CheckButton(arena_id)) { check_arena(0); g_InitWin = true; return; }
else if (g_InterfaceEvents.CheckButton(centre_id)) { check_centre(0); g_InitWin = true; return; }
else if (g_InterfaceEvents.CheckButton(farm_id)) { check_farm(0); g_InitWin = true; return; }
else if (g_InterfaceEvents.CheckButton(mayor_id)) { g_InitWin = true; g_WinManager.push("Mayor"); return; }
else if (g_InterfaceEvents.CheckButton(bank_id)) { g_InitWin = true; g_WinManager.push("Bank"); return; }
else if (g_InterfaceEvents.CheckButton(shop_id)) { g_InitWin = true; g_AllTogle = false; g_WinManager.push("Item Management"); return; }
else if (g_InterfaceEvents.CheckButton(brothel0_id)) { check_brothel(0); g_InitWin = true; return; }
else if (g_InterfaceEvents.CheckButton(brothel1_id)) { check_brothel(1); g_InitWin = true; return; }
else if (g_InterfaceEvents.CheckButton(brothel2_id)) { check_brothel(2); g_InitWin = true; return; }
else if (g_InterfaceEvents.CheckButton(brothel3_id)) { check_brothel(3); g_InitWin = true; return; }
else if (g_InterfaceEvents.CheckButton(brothel4_id)) { check_brothel(4); g_InitWin = true; return; }
else if (g_InterfaceEvents.CheckButton(brothel5_id)) { check_brothel(5); g_InitWin = true; return; }
else if (g_InterfaceEvents.CheckButton(brothel6_id)) { check_brothel(6); g_InitWin = true; return; }
else if (g_InterfaceEvents.CheckButton(walk_id)) { do_walk(); if (!g_Cheats) g_WalkAround = true; g_InitWin = true; }
else if (g_InterfaceEvents.CheckButton(setup_id)) { g_InitWin = true; g_WinManager.push("Property Management"); return; } // `J` added
}
示例10: check_events
void cScreenGirlDetails::check_events()
{
// no events means we can go home
if (g_InterfaceEvents.GetNumEvents() == 0) return;
// if it's the back button, pop the window off the stack and we're done
if (g_InterfaceEvents.CheckButton(back_id))
{
g_InitWin = true;
g_WinManager.Pop();
return;
}
if (g_InterfaceEvents.CheckSlider(houseperc_id))
{
g_Girls.SetStat(selected_girl, STAT_HOUSE, SliderValue(houseperc_id));
ss.str("");
ss << gettext("House Percentage: ") << SliderValue(houseperc_id) << gettext("%");
EditTextItem(ss.str(), housepercval_id);
// Rebelliousness might have changed, so update details
if (DetailLevel == 0)
{
string detail = g_Girls.GetDetailsString(selected_girl);
EditTextItem(detail, girldesc_id);
}
return;
}
if (g_InterfaceEvents.CheckButton(more_id))
{
if (DetailLevel == 0) { DetailLevel = 1; EditTextItem(g_Girls.GetMoreDetailsString(selected_girl), girldesc_id); }
else if (DetailLevel == 1) { DetailLevel = 2; EditTextItem(g_Girls.GetThirdDetailsString(selected_girl), girldesc_id); }
else { DetailLevel = 0; EditTextItem(g_Girls.GetDetailsString(selected_girl), girldesc_id); }
}
if (g_InterfaceEvents.CheckButton(day_id))
{
DisableButton(day_id, true);
DisableButton(night_id, false);
g_InitWin = true;
Day0Night1 = SHIFT_DAY;
}
if (g_InterfaceEvents.CheckButton(night_id))
{
DisableButton(day_id, false);
DisableButton(night_id, true);
g_InitWin = true;
Day0Night1 = SHIFT_NIGHT;
}
if (g_InterfaceEvents.CheckCheckbox(antipreg_id))
{
selected_girl->m_UseAntiPreg = (IsCheckboxOn(antipreg_id));
}
if (g_InterfaceEvents.CheckListbox(traitlist_id))
{
int selection = GetLastSelectedItemFromList(traitlist_id);
if (selection != -1)
EditTextItem(selected_girl->m_Traits[selection]->m_Desc, traitdesc_id);
else
EditTextItem("", traitdesc_id);
}
if (g_InterfaceEvents.CheckListbox(jobtypelist_id))
{
SetJob = true;
RefreshJobList();
}
if (g_InterfaceEvents.CheckListbox(joblist_id))
{
bool fulltime = g_CTRLDown;
int selection = GetSelectedItemFromList(joblist_id);
if (selection != -1)
{
int old_job = (Day0Night1 ? selected_girl->m_NightJob : selected_girl->m_DayJob);
// handle special job requirements and assign - if HandleSpecialJobs returns true, the job assignment was modified or cancelled
if (g_Brothels.m_JobManager.HandleSpecialJobs(g_CurrBrothel, selected_girl, selection, old_job, Day0Night1, fulltime))
{
selection = (Day0Night1 ? selected_girl->m_NightJob : selected_girl->m_DayJob);
SetSelectedItemInList(joblist_id, selection, false);
}
// refresh job worker counts for former job and current job
if (old_job != selection)
{
SetSelectedItemText(joblist_id, old_job, g_Brothels.m_JobManager.JobDescriptionCount(old_job, g_CurrBrothel, Day0Night1));
SetSelectedItemText(joblist_id, selection, g_Brothels.m_JobManager.JobDescriptionCount(selection, g_CurrBrothel, Day0Night1));
}
RefreshJobList();
}
}
if (g_InterfaceEvents.CheckButton(inventory_id))
{
if (selected_girl)
{
if (GirlDead(selected_girl)) return;
g_InitWin = true;
g_AllTogle = true;
g_WinManager.push("Item Management");
return;
}
}
if (g_InterfaceEvents.CheckButton(gallery_id))
{
g_WinManager.push("Gallery");
//.........这里部分代码省略.........
示例11: init
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);
//.........这里部分代码省略.........
示例12: do_take_gold
//.........这里部分代码省略.........
/*
* OK - she's going to fight -
*/
sGang* gang;
/*
* ok: to win she needs to defeat all the gangs on
* guard duty. I've made a change here so that she doesn't
* need to wipe one gang out before moving on to the next one
* which means that she can cause some damage on the way out
* without necessarily slaying all who stand before her
*
* it also means that if you have 5 gangs guarding, she needs
* to get past 5 gangs, but you don't have to have them all die
* in the process
*/
while ((gang = g_Gangs.GetGangOnMission(MISS_GUARDING)))
{
/*
* this returns true if the girl wins, false if she loses
*
* Suggestion on the forums that we allow clever girls to
* outwit stupid gang memebers here, which sounds cool.
* Also nice would be if a strongly magical girl could
* use sorcery to evade a none-too-crafty goon squad.
* (possibly make her fight the first one).
*
* But none of this makes much difference if the user
* never sees it happen. We can make combat as textured as
* we like, but unless the details are reported to the player
* we might as well roll a single die and be done with it.
*/
girl_win_flag = g_Gangs.GangCombat(girl, gang);
/*
* if she didn't win, exit the loop
*/
if (girl_win_flag == GIRL_LOSES) break;
}
/*
* the "girl lost" case is easier
*/
if (girl_win_flag == GIRL_LOSES)
{ // put her in the dungeon
message += gettext("She puts up a fight ");
if (gang && gang->m_Num == 0)
{
message += gettext("and the gang is wiped out, ");
}
message += gettext(" but you take her gold anyway.");
return girl_win_flag;
}
/*
* from here on down, the girl won against the goons
*/
message += gettext("She puts up a fight ");
if (gang && gang->m_Num == 0) message += gettext(" and the gang is wiped out ");
/*
* can the player tame this particular shrew?
*/
if (!g_Brothels.PlayerCombat(girl)) // fight with the player
{
message += gettext("but you defeat her yourself and take her gold.");
return false; // girl did not win, after all
}
/*
* Looks like she won: put her out of the brothel
* and post her as a runaway
*/
message += gettext("after defeating you as well she escapes to the outside.\n");
sGirl* nextGirl = remove_selected_girl();
sGirl* temp = girl;
/*
* what we have to do depends on whether she was in brothel
* or dungeon
*/
if (girl->m_DayJob != JOB_INDUNGEON)
g_Brothels.RemoveGirl(g_CurrBrothel, girl, false);
else
temp = g_Brothels.GetDungeon()->RemoveGirl(girl);
/*
* set her job
*/
temp->m_RunAway = 6; // player has 6 weeks to retreive
temp->m_NightJob = girl->m_DayJob = JOB_RUNAWAY;
/*
* add her to the runaway list
*/
g_Brothels.AddGirlToRunaways(temp);
stringstream smess;
smess << temp->m_Realname << gettext(" has run away");
g_MessageQue.AddToQue(smess.str(), 1);
selected_girl = nextGirl;
g_InitWin = true;
if (selected_girl == 0) g_WinManager.Pop();
return true; // the girl still won
}
示例13: check_events
void cScreenGangs::check_events()
{
if (g_InterfaceEvents.GetNumEvents() == 0) return; // no events means we can go home
if (g_InterfaceEvents.CheckButton(back_id)) // if it's the back button, pop the window off the stack and we're done
{
g_InitWin = true;
g_WinManager.Pop();
return;
}
if (g_InterfaceEvents.CheckButton(ganghire_id))
{
hire_recruitable();
return;
}
if (g_InterfaceEvents.CheckButton(weaponup_id))
{
int cost = 0;
int *wlev = g_Gangs.GetWeaponLevel();
cost = tariff.goon_weapon_upgrade(*wlev);
if (g_Gold.item_cost(cost) == true)
{
*wlev += 1;
g_InitWin = true;
}
wlev = 0;
return;
}
int buynets = 0;
if (g_InterfaceEvents.CheckButton(netbuy_id)) buynets = 1;
if (g_InterfaceEvents.CheckButton(netbuy10_id)) buynets = 10;
if (g_InterfaceEvents.CheckButton(netbuy20_id)) buynets = 20;
if (buynets > 0)
{
int cost = 0;
int amount = buynets;
int *nets = g_Gangs.GetNets();
if (((*nets) + buynets) > 60) amount = 60 - (*nets);
cost = tariff.nets_price(amount);
if (g_Gold.item_cost(cost) == true)
{
*nets += amount;
if (IsCheckboxOn(netautobuy_id)) g_Gangs.KeepNetStocked(*nets);
g_InitWin = true;
}
nets = 0;
buynets = 0;
return;
}
int buypots = 0;
if (g_InterfaceEvents.CheckButton(healbuy_id)) buypots = 1;
if (g_InterfaceEvents.CheckButton(healbuy10_id)) buypots = 10;
if (g_InterfaceEvents.CheckButton(healbuy20_id)) buypots = 20;
if (buypots > 0)
{
int cost = 0;
int amount = buypots;
int *potions = g_Gangs.GetHealingPotions();
if (((*potions) + buypots) > 200) amount = 200 - (*potions);
cost = tariff.healing_price(amount);
if (g_Gold.item_cost(cost) == true)
{
*potions += amount;
if (IsCheckboxOn(healautobuy_id)) g_Gangs.KeepHealStocked(*potions);
g_InitWin = true;
}
potions = 0;
buypots = 0;
return;
}
if (g_InterfaceEvents.CheckCheckbox(netautobuy_id))
{
int *nets = g_Gangs.GetNets();
g_Gangs.KeepNetStocked(IsCheckboxOn(netautobuy_id) ? *nets : 0);
}
if (g_InterfaceEvents.CheckCheckbox(healautobuy_id))
{
int *potions = g_Gangs.GetHealingPotions();
g_Gangs.KeepHealStocked(IsCheckboxOn(healautobuy_id) ? *potions : 0);
}
if (g_InterfaceEvents.CheckButton(gangfire_id))
{
selection = GetLastSelectedItemFromList(ganglist_id);
if (selection != -1)
{
g_Gangs.FireGang(selection);
g_InitWin = true;
}
return;
}
if (g_InterfaceEvents.CheckListbox(recruitlist_id))
{
string ClickedHeader = HeaderClicked(recruitlist_id);
if (ClickedHeader != "")
{
g_LogFile.ss() << "User clicked \"" << ClickedHeader << "\" column header on Recruit listbox" << endl; g_LogFile.ssend();
return;
}
//.........这里部分代码省略.........
示例14: process
void cClinicScreen::process()
{
/*
* we need to make sure the ID variables are set
*/
if (!ids_set) set_ids();
init();
if (g_InitWin)
{
EditTextItem(g_Clinic.GetBrothelString(0), clinicdetails_id);
g_InitWin = false;
}
/*
* no events means we can go home
*/
if (g_InterfaceEvents.GetNumEvents() == 0) return;
/*
* otherwise, compare event IDs
*
* if it's the back button, pop the window off the stack
* and we're done
*/
if (g_InterfaceEvents.CheckButton(back_id))
{
g_InitWin = true;
g_WinManager.Pop();
return;
}
else if (g_InterfaceEvents.CheckButton(walk_id))
{
g_InitWin = true;
g_WinManager.push("Clinic Try");
return;
}
else if (g_InterfaceEvents.CheckButton(girls_id))
{
g_InitWin = true;
g_WinManager.push("Clinic");
return;
}
else if (g_InterfaceEvents.CheckButton(staff_id))
{
g_InitWin = true;
g_WinManager.push("Gangs");
return;
}
else if (g_InterfaceEvents.CheckButton(turns_id))
{
g_InitWin = true;
g_WinManager.push("TurnSummary");
return;
}
else if (g_InterfaceEvents.CheckButton(setup_id))
{
g_Building = BUILDING_CLINIC;
g_InitWin = true;
g_WinManager.push("Building Setup");
return;
}
else if (g_InterfaceEvents.CheckButton(dungeon_id))
{
g_InitWin = true;
g_WinManager.push("Dungeon");
return;
}
else if (g_InterfaceEvents.CheckButton(weeks_id))
{
g_InitWin = true;
if (!g_CTRLDown) { g_CTRLDown = false; AutoSaveGame(); }
NextWeek();
g_WinManager.push("TurnSummary");
return;
}
}
示例15: check_events
void cScreenCentreManagement::check_events()
{
// no events means we can go home
if (g_InterfaceEvents.GetNumEvents() == 0)
return;
// if it's the back button, pop the window off the stack and we're done
if (g_InterfaceEvents.CheckButton(back_id)) {
g_InitWin = true;
g_WinManager.Pop();
return;
}
if (g_InterfaceEvents.CheckButton(viewdetails_id))
{
ViewSelectedGirl();
}
if (g_InterfaceEvents.CheckButton(day_id))
{
DisableButton(day_id, true);
DisableButton(night_id, false);
Day0Night1 = SHIFT_DAY;
RefreshSelectedJobType();
}
if (g_InterfaceEvents.CheckButton(night_id))
{
DisableButton(day_id, false);
DisableButton(night_id, true);
Day0Night1 = SHIFT_NIGHT;
RefreshSelectedJobType();
}
if (g_InterfaceEvents.CheckListbox(jobtypelist_id))
{
selection = GetSelectedItemFromList(jobtypelist_id);
if (selection == -1)
EditTextItem("Nothing Selected", jobtypedesc_id);
else
{
// populate Jobs listbox with jobs in the selected category
RefreshJobList();
string jdmessage = g_Centre.m_JobManager.JobFilterDesc[selection];
if ((g_Centre.GetNumGirlsOnJob(g_CurrCentre, JOB_COUNSELOR, 0) < 1 &&
g_Centre.GetNumberPatients(0) > 0) ||
(g_Centre.GetNumGirlsOnJob(g_CurrCentre, JOB_COUNSELOR, 1) < 1 &&
g_Centre.GetNumberPatients(1) > 0))
{
jdmessage += gettext("\n*** A Counselor is required to guide Rehab and Therapy patients. ");
}
EditTextItem(jdmessage, jobtypedesc_id);
}
}
if (g_InterfaceEvents.CheckListbox(joblist_id))
{
bool fulltime = g_CTRLDown;
selection = GetSelectedItemFromList(joblist_id);
if (selection != -1)
{
// first handle the descriptions
EditTextItem(g_Centre.m_JobManager.JobDesc[selection], jobdesc_id);
// Now assign the job to all the selected girls
int pos = 0;
int GSelection = GetNextSelectedItemFromList(girllist_id, 0, pos);
while (GSelection != -1)
{
u_int new_job = selection;
selected_girl = g_Centre.GetGirl(g_CurrCentre, GSelection);
if (selected_girl)
{
int old_job = (Day0Night1 ? selected_girl->m_NightJob : selected_girl->m_DayJob);
// handle special job requirements and assign
// if HandleSpecialJobs returns true, the job assignment was modified or cancelled
if (g_Centre.m_JobManager.HandleSpecialJobs(g_CurrCentre, selected_girl, new_job, old_job, Day0Night1, fulltime))
{
new_job = (Day0Night1 ? selected_girl->m_NightJob : selected_girl->m_DayJob);
SetSelectedItemInList(joblist_id, new_job, false);
}
// update the girl's listing to reflect the job change
ss.str("");
ss << g_Centre.m_JobManager.JobName[selected_girl->m_DayJob];
SetSelectedItemColumnText(girllist_id, GSelection, ss.str(), m_ListBoxes[girllist_id]->DayJobColumn());
ss.str("");
ss << g_Centre.m_JobManager.JobName[selected_girl->m_NightJob];
SetSelectedItemColumnText(girllist_id, GSelection, ss.str(), m_ListBoxes[girllist_id]->NightJobColumn());
// refresh job worker counts for former job and current job
SetSelectedItemText(joblist_id, old_job, g_Centre.m_JobManager.JobDescriptionCount(old_job, 0, Day0Night1, false, false, false, true));
SetSelectedItemText(joblist_id, new_job, g_Centre.m_JobManager.JobDescriptionCount(new_job, 0, Day0Night1, false, false, false, true));
}
if (selected_girl->m_DayJob == JOB_REHAB) // `J` added
{
ss.str("");
ss << g_Centre.m_JobManager.JobName[selected_girl->m_DayJob] << " (" << 3 - selected_girl->m_WorkingDay << ")";
//.........这里部分代码省略.........