本文整理汇总了C++中cWindowManager类的典型用法代码示例。如果您正苦于以下问题:C++ cWindowManager类的具体用法?C++ cWindowManager怎么用?C++ cWindowManager使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了cWindowManager类的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: 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;
}
示例3: 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;
}
}
示例4: 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;
}
}
示例5: 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;
}
}
示例6: 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;
}
}
示例7: 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!");
}
}
示例8: ViewSelectedGirl
void cScreenCentreManagement::ViewSelectedGirl()
{
if (selected_girl)
{
if (GirlDead(selected_girl)) return;
//load up the cycle_girls vector with the ordered list of girl IDs
FillSortedIDList(girllist_id, &cycle_girls, &cycle_pos);
for (int i = cycle_girls.size(); i-- > 0;)
{ // no viewing dead girls
if (g_Centre.GetGirl(g_CurrCentre, cycle_girls[i])->health() <= 0)
cycle_girls.erase(cycle_girls.begin() + i);
}
g_InitWin = true;
g_WinManager.push("Girl Details");
return;
}
}
示例9: check_farm
void cScreenTown::check_farm(int FarmNum)
{ // player clicked on one of the brothels
if (g_Farm.GetNumBrothels() == FarmNum)
{ // player doesn't own this Studio... can he buy it?
static_brothel_data *bck = farm_data + FarmNum;
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);
BuyFarm = FarmNum;
}
}
else
{ // player owns this brothel... go to it
g_Building = BUILDING_FARM;
g_CurrFarm = FarmNum;
g_WinManager.push("Farm Screen");
}
}
示例10: 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
}
示例11: 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;
}
}
示例12: 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");
//.........这里部分代码省略.........
示例13: check_keys
bool cScreenGirlDetails::check_keys()
{
if (g_LeftArrow)
{
g_LeftArrow = false;
PrevGirl();
return true;
}
if (g_RightArrow)
{
g_RightArrow = false;
NextGirl();
return true;
}
if (g_AltKeys)
{
if (g_A_Key)
{
g_A_Key = false;
PrevGirl();
return true;
}
if (g_D_Key)
{
g_D_Key = false;
NextGirl();
return true;
}
if (g_H_Key || g_J_Key)
{
int mod = 1; if (g_H_Key) mod = -1;
g_Girls.UpdateStat(selected_girl, STAT_HOUSE, mod);
g_H_Key = g_J_Key = false;
SliderValue(houseperc_id, g_Girls.GetStat(selected_girl, STAT_HOUSE));
ss.str("");
ss << gettext("House Percentage: ") << g_Girls.GetStat(selected_girl, STAT_HOUSE) << 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 true;
}
if (g_S_Key)
{
g_S_Key = false;
if (g_ShiftDown)
{
DetailLevel = 2;
EditTextItem(g_Girls.GetThirdDetailsString(selected_girl), girldesc_id);
}
else
{
if (DetailLevel == 0) { DetailLevel = 1; EditTextItem(g_Girls.GetMoreDetailsString(selected_girl), girldesc_id); }
else { DetailLevel = 0; EditTextItem(g_Girls.GetDetailsString(selected_girl), girldesc_id); }
}
return true;
}
if (g_SpaceKey)
{
g_SpaceKey = false;
g_WinManager.push("Gallery");
g_InitWin = true;
return true;
}
}
return false;
}
示例14: 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);
//.........这里部分代码省略.........
示例15: do_take_gold
/*
* returns TRUE if the girl won
*/
bool cScreenGirlDetails::do_take_gold(sGirl *girl, string &message)
{
const int GIRL_LOSES = false;
const int GIRL_WINS = true;
bool girl_win_flag = GIRL_WINS;
/*
* we're taking the girl's gold. Life gets complicated if she
* makes a fight of it - so lets do the case where she meekly complies
* first
*/
if (!g_Brothels.FightsBack(girl))
{
message += gettext("She quietly allows you to take her gold.");
return GIRL_LOSES; // no fight -> girl lose
}
/*
* 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
*/
//.........这里部分代码省略.........