Window_Message::Window_Message(int ix, int iy, int iwidth, int iheight) : Window_Selectable(ix, iy, iwidth, iheight), contents_x(0), contents_y(0), line_count(0), kill_message(false), speed_modifier(0), speed_frame_counter(0), new_page_after_pause(false), number_input_window(new Window_NumberInput(0, 0)), gold_window(new Window_Gold(232, 0, 88, 32)) { SetContents(Bitmap::Create(width - 16, height - 16)); if (Data::battlecommands.battle_type != RPG::BattleCommands::BattleType_traditional && Data::battlecommands.transparency == RPG::BattleCommands::Transparency_transparent) { SetBackOpacity(128); } visible = false; SetZ(10000); escape_char = Utils::DecodeUTF32(Player::escape_symbol).front(); active = false; index = -1; text_color = Font::ColorDefault; number_input_window->SetVisible(false); gold_window->SetVisible(false); Game_Message::Init(); }
nuiDialogSelectDirectory::nuiDialogSelectDirectory(nuiMainWindow* pParent, const nglString& rTitle, const nglPath& rPath, const nglPath& rRootPath, nuiSize Left, nuiSize Top, nuiSize Width, nuiSize Height) : nuiDialog(pParent), mpParent(pParent), mPath(rPath), mEventSink(this) { mpContainer = new nuiSimpleContainer(); nuiSize userWidth = (Width == 0.f) ? mpParent->GetWidth() * .8 : Width; nuiSize userHeight = (Height == 0.f) ? mpParent->GetHeight() * .8 : Height; mpContainer->SetUserSize(userWidth, userHeight); mpSelector = new nuiFileSelector(mPath, rRootPath); mpContainer->AddChild(mpSelector); mEventSink.Connect(mpSelector->OK, &nuiDialogSelectDirectory::OnSelectorOK); nuiLabel* pTitle = new nuiLabel(rTitle); pTitle->SetObjectName(_T("nuiDialog::Title")); InitDialog(pTitle, NULL, nuiDialog::eDialogButtonOk + nuiDialog::eDialogButtonCancel); nuiButton* pButton = new nuiButton(_T("New Folder")); pButton->SetObjectName(_T("nuiDialog::Button")); AddButton(pButton, nuiDialog::eDialogButtonCustom); mEventSink.Connect(pButton->Activated, &nuiDialogSelectDirectory::OnCreateNewFolder); SetContents(mpContainer); if ((Top == 0.f) && (Left == 0.f) && (Width == 0.f) && (Height == 0.f)) SetDefaultPos(); else SetUserPos(Left, Top); mEventSink.Connect(DialogDone, &nuiDialogSelectDirectory::OnDialogDone); mpSelector->UpdateLayout(); }
Window_ActorTarget::Window_ActorTarget(int ix, int iy, int iwidth, int iheight) : Window_Selectable(ix, iy, iwidth, iheight) { SetContents(Bitmap::Create(width - 16, height - 16)); Refresh(); }
Window_ShopParty::Window_ShopParty(int ix, int iy, int iwidth, int iheight) : Window_Base(ix, iy, iwidth, iheight) { SetContents(Bitmap::Create(width - 16, height - 16)); contents->SetTransparentColor(windowskin->GetTransparentColor()); cycle = 0; item_id = 0; const std::vector<Game_Actor*>& actors = Game_Party::GetActors(); for (size_t i = 0; i < actors.size() && i < 4; i++) { Game_Actor *actor = actors[i]; const std::string& sprite_name = actor->GetCharacterName(); int sprite_id = actor->GetCharacterIndex(); BitmapRef bm = Cache::Charset(sprite_name); int width = bm->GetWidth() / 4 / 3; int height = bm->GetHeight() / 2 / 4; for (int j = 0; j < 3; j++) { int sx = ((sprite_id % 4) * 3 + j) * width; int sy = ((sprite_id / 4) * 4 + 2) * height; Rect src(sx, sy, width, height); for (int k = 0; k < 2; k++) { BitmapRef bm2 = Bitmap::Create(width, height, true); bm2->SetTransparentColor(bm->GetTransparentColor()); bm2->Clear(); bm2->Blit(0, 0, *bm, src, 255); if (k == 0) bm2->ToneBlit(0, 0, *bm2, bm2->GetRect(), Tone(0, 0, 0, 255)); bitmaps[i][j][k] = bm2; } } } Refresh(); }
Window_ShopNumber::Window_ShopNumber(int ix, int iy, int iwidth, int iheight) : Window_Base(ix, iy, iwidth, iheight), item_max(1), price(0), number(1), item_id(0) { SetContents(Surface::CreateSurface(width - 16, height - 16)); contents->SetTransparentColor(windowskin->GetTransparentColor()); contents->Clear(); }
Window_MenuStatus::Window_MenuStatus(int ix, int iy, int iwidth, int iheight) : Window_Selectable(ix, iy, iwidth, iheight) { SetContents(Bitmap::Create(width - 16, height - 16)); contents->SetTransparentColor(windowskin->GetTransparentColor()); Refresh(); }
ToolPane::ToolPane(nuiLabelAttribute* rLabel, nuiWidget* pWidget) : nuiFolderPane(rLabel, true/*opened*/) { GetTitle()->SetObjectName(_T("Toolpane::Title")); GetTitle()->SetColor(eNormalTextFg, nuiColor(255,255,255)); if (pWidget) SetContents(pWidget); }
Window_Gold::Window_Gold(int ix, int iy, int iwidth, int iheight) : Window_Base(ix, iy, iwidth, iheight) { SetContents(Bitmap::Create(width - 16, height - 16)); contents->SetTransparentColor(windowskin->GetTransparentColor()); Refresh(); }
Window_ShopStatus::Window_ShopStatus(int ix, int iy, int iwidth, int iheight) : Window_Base(ix, iy, iwidth, iheight), item_id(0) { SetContents(Bitmap::Create(width - 16, height - 16)); contents->SetTransparentColor(windowskin->GetTransparentColor()); Refresh(); }
Window_ActorInfo::Window_ActorInfo(int ix, int iy, int iwidth, int iheight, int actor_id) : Window_Base(ix, iy, iwidth, iheight), actor_id(actor_id) { SetContents(Bitmap::Create(width - 16, height - 16)); Refresh(); }
Window_ActorTarget::Window_ActorTarget(int ix, int iy, int iwidth, int iheight) : Window_Selectable(ix, iy, iwidth, iheight) { SetContents(Surface::CreateSurface(width - 16, height - 16)); contents->SetTransparentColor(windowskin->GetTransparentColor()); Refresh(); }
Window_Help::Window_Help(int ix, int iy, int iwidth, int iheight) : Window_Base(ix, iy, iwidth, iheight), align(Text::AlignLeft) { SetContents(Bitmap::Create(width - 16, height - 16)); contents->SetTransparentColor(windowskin->GetTransparentColor()); contents->Clear(); }
Window_Name::Window_Name(int ix, int iy, int iwidth, int iheight) : Window_Base(ix, iy, iwidth, iheight) { SetContents(Bitmap::Create(width - 16, height - 16)); name.clear(); Refresh(); }
void FGTank::ResetToIC(void) { SetTemperature( InitialTemperature ); SetStandpipe ( InitialStandpipe ); SetContents ( InitialContents ); PctFull = 100.0*Contents/Capacity; SetPriority( InitialPriority ); CalculateInertias(); }
Window_ActorStatus::Window_ActorStatus(int ix, int iy, int iwidth, int iheight, int actor_id) : Window_Base(ix, iy, iwidth, iheight), actor_id(actor_id) { SetContents(Surface::CreateSurface(width - 16, height - 16)); contents->SetTransparentColor(windowskin->GetTransparentColor()); Refresh(); }
void FGTank::ResetToIC(void) { SetTemperature( InitialTemperature ); SetStandpipe ( InitialStandpipe ); SetContents ( InitialContents ); PctFull = 100.0*Contents/Capacity; SetPriority( InitialPriority ); PreviousUsed = 0.0; }
Window_SaveFile::Window_SaveFile(int ix, int iy, int iwidth, int iheight) : Window_Base(ix, iy, iwidth, iheight), index(0), hero_hp(0), hero_level(0), corrupted(false) { SetContents(Bitmap::Create(width - 8, height - 16)); contents->SetTransparentColor(windowskin->GetTransparentColor()); SetZ(9999); Refresh(); UpdateCursorRect(); }
ToolPane::ToolPane(const nglString& rTitle, nuiWidget* pWidget) : nuiFolderPane(rTitle, true/*opened*/) { nglString title = rTitle; nuiLabel* pLabel = new nuiLabel(title.ToUpper(), nuiFont::GetFont(11)); pLabel->SetObjectName(_T("Toolpane::Title")); pLabel->SetColor(eNormalTextFg, nuiColor(255,255,255)); SetTitle(pLabel); if (pWidget) SetContents(pWidget); }
Window_Shop::Window_Shop(int ix, int iy, int iwidth, int iheight) : Window_Base(ix, iy, iwidth, iheight) { SetContents(Bitmap::Create(width - 16, height - 16)); contents->SetTransparentColor(windowskin->GetTransparentColor()); switch (Game_Temp::shop_type) { case 0: greeting = Data::terms.shop_greeting1; regreeting = Data::terms.shop_regreeting1; buy_msg = Data::terms.shop_buy1; sell_msg = Data::terms.shop_sell1; leave_msg = Data::terms.shop_leave1; buy_select = Data::terms.shop_buy_select1; buy_number = Data::terms.shop_buy_number1; purchased = Data::terms.shop_purchased1; sell_select = Data::terms.shop_sell_select1; sell_number = Data::terms.shop_sell_number1; sold_msg = Data::terms.shop_sold1; break; case 1: greeting = Data::terms.shop_greeting2; regreeting = Data::terms.shop_regreeting2; buy_msg = Data::terms.shop_buy2; sell_msg = Data::terms.shop_sell2; leave_msg = Data::terms.shop_leave2; buy_select = Data::terms.shop_buy_select2; buy_number = Data::terms.shop_buy_number2; purchased = Data::terms.shop_purchased2; sell_select = Data::terms.shop_sell_select2; sell_number = Data::terms.shop_sell_number2; sold_msg = Data::terms.shop_sold2; break; case 2: greeting = Data::terms.shop_greeting3; regreeting = Data::terms.shop_regreeting3; buy_msg = Data::terms.shop_buy3; sell_msg = Data::terms.shop_sell3; leave_msg = Data::terms.shop_leave3; buy_select = Data::terms.shop_buy_select3; buy_number = Data::terms.shop_buy_number3; purchased = Data::terms.shop_purchased3; sell_select = Data::terms.shop_sell_select3; sell_number = Data::terms.shop_sell_number3; sold_msg = Data::terms.shop_sold3; break; } mode = Scene_Shop::BuySellLeave; index = 1; Refresh(); }
Window_EquipStatus::Window_EquipStatus(int ix, int iy, int iwidth, int iheight, int actor_id, bool draw_actorname) : Window_Base(ix, iy, iwidth, iheight), actor_id(actor_id), draw_params(false), draw_actorname(draw_actorname), dirty(true) { SetContents(Bitmap::Create(width - 16, height - 16)); contents->SetTransparentColor(windowskin->GetTransparentColor()); Refresh(); }
Window_BattleStatus::Window_BattleStatus(int ix, int iy, int iwidth, int iheight, bool enemy) : Window_Selectable(ix, iy, iwidth, iheight), mode(ChoiceMode_All), enemy(enemy) { SetBorderX(4); SetContents(Bitmap::Create(width - 8, height - 16)); index = -1; if (Data::battlecommands.battle_type == RPG::BattleCommands::BattleType_gauge) { // Simulate a borderless window // Doing it this way for gauge style makes the implementation on // scene-side easier border_x = 0; border_y = 0; SetContents(Bitmap::Create(width, height)); SetOpacity(0); } Refresh(); }
Window_Command::Window_Command(std::vector<std::string> commands, int width, int max_item) : Window_Selectable(0, 0, GetRequiredWidth(commands, width), (max_item == -1 ? commands.size() : max_item) * 16 + 16), commands(commands) { index = 0; item_max = commands.size(); SetContents(Bitmap::Create(this->width - 16, item_max * 16)); contents->SetTransparentColor(windowskin->GetTransparentColor()); Refresh(); }
Window_BattleStatus::Window_BattleStatus() : Window_Base(0, 172, 244, 68) { SetBorderX(4); SetBorderY(4); SetContents(Bitmap::Create(width - 8, height - 8)); contents->SetTransparentColor(windowskin->GetTransparentColor()); index = -1; Refresh(); }
Window_SaveFile::Window_SaveFile(int ix, int iy, int iwidth, int iheight) : Window_Base(ix, iy, iwidth, iheight) { index = 0; hero_hp = 0; hero_level = 0; SetContents(Surface::CreateSurface(width - 8, height - 16)); contents->SetTransparentColor(windowskin->GetTransparentColor()); SetZ(9999); Refresh(); UpdateCursorRect(); }
BOOL COXHistoryCombo::RestoreContents(LPCTSTR pszValueName, LPCTSTR pszCompany /* = NULL */, LPCTSTR pszApplication /* = NULL*/ , HKEY hKeyRoot /* = HKEY_CURRENT_USER */, BOOL bRestoreFirstItem /* = TRUE */) { ASSERT_VALID(this); CString sValueName(pszValueName); CString sCompany(pszCompany); CString sApplication(pszApplication); CString sContents; if (sValueName.IsEmpty()) { TRACE0("COXHistoryCombo::SaveContents : No value name provided, failing\n"); return FALSE; } if (sCompany.IsEmpty()) sCompany = AfxGetApp()->m_pszRegistryKey; if (sCompany.IsEmpty()) { TRACE0("COXHistoryCombo::SaveContents : No valid company name is provided, failing\n"); return FALSE; } if (sApplication.IsEmpty()) sApplication = AfxGetApp()->m_pszProfileName; BOOL bSuccess = LoadContentsFromRegistry(hKeyRoot, sCompany, sApplication, sValueName, sContents); if (bSuccess) { // ... Set the contents in the list box SetContents(sContents); // Select the first item from the list if (bRestoreFirstItem) { SetCurSel(0); if (::IsWindow(GetSafeHwnd()) && GetFocus()==this && ::IsWindowEnabled(m_hWnd)) SetEditSel(0, -1); } } ASSERT_VALID(this); return bSuccess; }
Window_NumberInput::Window_NumberInput(int ix, int iy, int iwidth, int iheight) : Window_Selectable(ix, iy, iwidth, iheight), digits_max(6) { number = 0; SetContents(Bitmap::Create(width - 16, height - 16)); contents->SetTransparentColor(windowskin->GetTransparentColor()); cursor_width = 14; SetZ(10001); opacity = 0; index = 0; active = false; Refresh(); UpdateCursorRect(); }
Window_BattleCommand::Window_BattleCommand(int x, int y, int width, int height) : Window_Base(x, y, width, height) { SetActor(0); disabled.resize(commands.size()); index = -1; top_row = 0; cycle = 0; SetContents(Bitmap::Create(width - 16, height - 16)); num_rows = contents->GetHeight() / 16; Refresh(); }
Window_ShopParty::Window_ShopParty(int ix, int iy, int iwidth, int iheight) : Window_Base(ix, iy, iwidth, iheight) { SetContents(Bitmap::Create(width - 16, height - 16)); cycle = 0; item_id = 0; const std::vector<Game_Actor*>& actors = Main_Data::game_party->GetActors(); for (size_t i = 0; i < actors.size() && i < 4; i++) { const std::string& sprite_name = actors[i]->GetSpriteName(); FileRequestAsync* request = AsyncHandler::RequestFile("CharSet", sprite_name); request_ids.push_back(request->Bind(&Window_ShopParty::OnCharsetSpriteReady, this, (int)i)); request->Start(); } Refresh(); }
Window_NumberInput::Window_NumberInput(int ix, int iy, int iwidth, int iheight) : Window_Selectable(ix, iy, iwidth, iheight), digits_max(Player::IsRPG2k() ? 6 : 7) { number = 0; plus = true; SetContents(Bitmap::Create(width - 16, height - 16)); cursor_width = 14; // Above the message window SetZ(Priority_Window + 150); opacity = 0; ResetIndex(); active = false; show_operator = false; Refresh(); UpdateCursorRect(); }
Window_Keyboard::Window_Keyboard(int ix, int iy, int iwidth, int iheight) : Window_Base(ix, iy, iwidth, iheight) , play_cursor(false) { row = 0; col = 0; SetContents(Bitmap::Create(width - 16, height - 16)); contents->SetTransparentColor(windowskin->GetTransparentColor()); SetZ(9999); row_spacing = 16; col_spacing = (contents->GetWidth() - 2 * border_x) / col_max; mode = Letter; Refresh(); UpdateCursorRect(); }