BOOL CPlayerStatsDlg::OnInitDialog () { CDialog::OnInitDialog (); games.simple = true; games.Attach (GetDlgItem (IDC_STATS)->m_hWnd); games.SetExtendedStyle (LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT); games.SetImageList (getImageList (), LVSIL_SMALL); games.InsertColumn (COL_HERO, "Hero"); games.InsertColumn (COL_KD, "K-D"); games.InsertColumn (COL_CS, "CS"); games.InsertColumn (COL_LANE, "Lane"); games.InsertColumn (COL_GOLD, "Gold"); games.InsertColumn (COL_AGOLD, "Avg. Gold"); games.InsertColumn (COL_LVL, "Level"); games.InsertColumn (COL_ALVL, "Avg. Lvl"); games.InsertColumn (COL_SCORE, "Score"); games.InsertColumn (COL_RESULT, "Result"); games.InsertColumn (COL_LEFT, "Left"); games.InsertColumn (COL_LENGTH, "Length"); games.InsertColumn (COL_APM, "APM"); games.InsertColumn (COL_NAME, "Game name"); games.InsertColumn (COL_DATE, "Game date"); return TRUE; }
void NewGame::_changeCharacter() { auto& dude = _characters.at(_selectedCharacter); *getTextArea("stats_1") = ""; *getTextArea("stats_1") << _t(MSG_STATS, 100) << " " << (dude->stat(STAT::STRENGTH) < 10 ? "0" : "") << dude->stat(STAT::STRENGTH) << "\n" << _t(MSG_STATS, 101) << " " << (dude->stat(STAT::PERCEPTION) < 10 ? "0" : "") << dude->stat(STAT::PERCEPTION) << "\n" << _t(MSG_STATS, 102) << " " << (dude->stat(STAT::ENDURANCE) < 10 ? "0" : "") << dude->stat(STAT::ENDURANCE) << "\n" << _t(MSG_STATS, 103) << " " << (dude->stat(STAT::CHARISMA) < 10 ? "0" : "") << dude->stat(STAT::CHARISMA) << "\n" << _t(MSG_STATS, 104) << " " << (dude->stat(STAT::INTELLIGENCE) < 10 ? "0" : "") << dude->stat(STAT::INTELLIGENCE) << "\n" << _t(MSG_STATS, 105) << " " << (dude->stat(STAT::AGILITY) < 10 ? "0" : "") << dude->stat(STAT::AGILITY) << "\n" << _t(MSG_STATS, 106) << " " << (dude->stat(STAT::LUCK) < 10 ? "0" : "") << dude->stat(STAT::LUCK) << "\n"; *getTextArea("stats_2") = ""; *getTextArea("stats_2") << _t(MSG_STATS, dude->stat(STAT::STRENGTH) + 300) << "\n" << _t(MSG_STATS, dude->stat(STAT::PERCEPTION) + 300) << "\n" << _t(MSG_STATS, dude->stat(STAT::ENDURANCE) + 300) << "\n" << _t(MSG_STATS, dude->stat(STAT::CHARISMA) + 300) << "\n" << _t(MSG_STATS, dude->stat(STAT::INTELLIGENCE) + 300) << "\n" << _t(MSG_STATS, dude->stat(STAT::AGILITY) + 300) << "\n" << _t(MSG_STATS, dude->stat(STAT::LUCK) + 300) << "\n"; getTextArea("bio")->setText(dude->biography()); getTextArea("name")->setText(dude->name()); getImageList("images")->setCurrentImage(_selectedCharacter); std::string stats3 = _t(MSG_MISC, 16) + "\n" // Hit Points + _t(MSG_STATS, 109) + "\n" // Armor Class + _t(MSG_MISC, 15) + "\n" // Action Points + _t(MSG_STATS, 111) + "\n"; // Melee Damage std::string stats3_values = std::to_string(dude->hitPointsMax()) + "/" + std::to_string(dude->hitPointsMax()) + "\n" + std::to_string(dude->armorClass()) + "\n" + std::to_string(dude->actionPoints()) + "\n" + std::to_string(dude->meleeDamage()) + "\n"; for (unsigned i = (unsigned)SKILL::SMALL_GUNS; i <= (unsigned)SKILL::OUTDOORSMAN; i++) { if (dude->skillTagged((SKILL)i)) { stats3 += "\n" + _t(MSG_SKILLS, 100 + i); stats3_values += "\n" + std::to_string(dude->skillValue((SKILL)i)) + "%"; } } for (unsigned i = (unsigned)TRAIT::FAST_METABOLISM; i <= (unsigned)TRAIT::GIFTED; i++) { if (dude->traitTagged((TRAIT)i)) { stats3 += "\n" + _t(MSG_TRAITS, 100 + i); } } getTextArea("stats_3")->setText(stats3); getTextArea("stats3_values")->setText(stats3_values); }
void NewGameState::_changeCharacter() { auto dude = _characters.at(_selectedCharacter); std::stringstream ss; auto msg = ResourceManager::msgFileType("text/english/game/stat.msg"); ss << msg->message(100)->text() << " " << (dude->stat(0) < 10 ? "0" : "") << dude->stat(0) << "\n" << msg->message(101)->text() << " " << (dude->stat(1) < 10 ? "0" : "") << dude->stat(1) << "\n" << msg->message(102)->text() << " " << (dude->stat(2) < 10 ? "0" : "") << dude->stat(2) << "\n" << msg->message(103)->text() << " " << (dude->stat(3) < 10 ? "0" : "") << dude->stat(3) << "\n" << msg->message(104)->text() << " " << (dude->stat(4) < 10 ? "0" : "") << dude->stat(4) << "\n" << msg->message(105)->text() << " " << (dude->stat(5) < 10 ? "0" : "") << dude->stat(5) << "\n" << msg->message(106)->text() << " " << (dude->stat(6) < 10 ? "0" : "") << dude->stat(6) << "\n"; getTextArea("stats_1")->setText(ss.str()); ss.str(""); ss << _statToString(dude->stat(0)) << "\n" << _statToString(dude->stat(1)) << "\n" << _statToString(dude->stat(2)) << "\n" << _statToString(dude->stat(3)) << "\n" << _statToString(dude->stat(4)) << "\n" << _statToString(dude->stat(5)) << "\n" << _statToString(dude->stat(6)) << "\n"; getTextArea("stats_2")->setText(ss.str()); getTextArea("bio")->setText(dude->biography()); getTextArea("name")->setText(dude->name()); getImageList("images")->setCurrentImage(_selectedCharacter); auto msgMisc = ResourceManager::msgFileType("text/english/game/misc.msg"); std::string stats3 = msgMisc->message(16)->text() + "\n" // Hit Points + msg->message(109)->text() + "\n" // Armor Class + msgMisc->message(15)->text() + "\n" // Action Points + msg->message(111)->text() + "\n"; // Melee Damage std::string stats3_values = std::to_string(dude->hitPointsMax()) + "/" + std::to_string(dude->hitPointsMax()) + "\n" + std::to_string(dude->armorClass()) + "\n" + std::to_string(dude->actionPoints()) + "\n" + std::to_string(dude->meleeDamage()) + "\n"; for (unsigned int i=0; i != 17; ++i) if (dude->skill(i)) { stats3 += "\n" + ResourceManager::msgFileType("text/english/game/skill.msg")->message(100 + i)->text(); stats3_values += "\n" + std::to_string(dude->skillValue(i)) + "%"; } for (unsigned int i=0; i != 16; ++i) if (dude->trait(i)) { stats3 += "\n" + ResourceManager::msgFileType("text/english/game/trait.msg")->message(100 + i)->text(); } getTextArea("stats_3")->setText(stats3); getTextArea("stats3_values")->setText(stats3_values); }
BOOL CActionsDlg::OnInitDialog () { CDialog::OnInitDialog (); selPlayer.Attach (GetDlgItem (IDC_SELPLAYER)->m_hWnd); selPlayer.SetImageList (getImageList ()); actions.Attach (GetDlgItem (IDC_ACTIONCHART)->m_hWnd); actions.InsertColumn (0, ""); actions.InsertColumn (1, ""); actions.SetColumnWidth (0, 150); actions.SetColumnWidth (1, LVSCW_AUTOSIZE_USEHEADER); for (int i = 0; i < NUM_ACTIONS; i++) actions.InsertItem (i, actionNames[i]); hkeys.Attach (GetDlgItem (IDC_GROUPS)->m_hWnd); hkeys.InsertColumn (0, "Group"); hkeys.InsertColumn (1, "Assigned"); hkeys.InsertColumn (2, "Used"); hkeys.SetColumnWidth (0, LVSCW_AUTOSIZE_USEHEADER); hkeys.SetColumnWidth (1, LVSCW_AUTOSIZE_USEHEADER); hkeys.SetColumnWidth (2, LVSCW_AUTOSIZE_USEHEADER); hkeys.SetExtendedStyle (LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES); CRect rc; GetDlgItem (IDC_GRAPHAREA)->GetWindowRect (rc); actions.ScreenToClient (rc); actions.start = rc.left; actions.end = rc.right; GetDlgItem (IDC_ACTIONGRAPH)->GetWindowRect (rc); ScreenToClient (rc); history = new CActionHistory (rc, this); loc.SetWindow (this); loc.SetItemAbsolute (IDC_SELPLAYER, SIDE_LEFT, PERCENT); loc.SetItemAbsolute (IDC_SELPLAYER, SIDE_RIGHT, PERCENT); loc.SetItemAbsolute (IDC_ACTIONCHART, SIDE_LEFT, PERCENT); loc.SetItemAbsolute (IDC_ACTIONCHART, SIDE_RIGHT, PERCENT); loc.SetItemAbsolute (&actions, SIDE_LEFT, PERCENT); loc.SetItemAbsolute (&actions, SIDE_RIGHT, PERCENT); loc.SetItemAbsolute (IDC_GROUPS, SIDE_LEFT, PERCENT); loc.SetItemAbsolute (IDC_GROUPS, SIDE_RIGHT, PERCENT); loc.SetItemAbsolute (IDC_GROUPS, SIDE_BOTTOM, PERCENT); loc.SetItemRelative (IDC_AFKTIME, SIDE_TOP, IDC_GROUPS, SIDE_BOTTOM); loc.SetItemAbsolute (IDC_AFKTIME, SIDE_LEFT, PERCENT); loc.SetItemAbsolute (IDC_AFKTIME, SIDE_RIGHT, PERCENT); loc.SetItemRelative (history, SIDE_TOP, GetDlgItem (IDC_AFKTIME), SIDE_BOTTOM); loc.SetItemAbsolute (history, SIDE_RIGHT); loc.SetItemAbsolute (history, SIDE_BOTTOM); loc.Start (); return TRUE; }
BOOL CSearchDlg::OnInitDialog () { CDialog::OnInitDialog (); mode[0].Attach (GetDlgItem (IDC_PMODE1)->m_hWnd); mode[1].Attach (GetDlgItem (IDC_PMODE2)->m_hWnd); mode[2].Attach (GetDlgItem (IDC_PMODE3)->m_hWnd); mode[3].Attach (GetDlgItem (IDC_PMODE4)->m_hWnd); mode[4].Attach (GetDlgItem (IDC_PMODE5)->m_hWnd); mode[BOX_FILE].Attach (GetDlgItem (IDC_FFUNC)->m_hWnd); mode[BOX_NAME].Attach (GetDlgItem (IDC_NFUNC)->m_hWnd); mode[BOX_MODE].Attach (GetDlgItem (IDC_MFUNC)->m_hWnd); hero[0].Attach (GetDlgItem (IDC_PHERO1)->m_hWnd); hero[1].Attach (GetDlgItem (IDC_PHERO2)->m_hWnd); hero[2].Attach (GetDlgItem (IDC_PHERO3)->m_hWnd); hero[3].Attach (GetDlgItem (IDC_PHERO4)->m_hWnd); hero[4].Attach (GetDlgItem (IDC_PHERO5)->m_hWnd); dfrom.Attach (GetDlgItem (IDC_SAVEDA)->m_hWnd); dto.Attach (GetDlgItem (IDC_SAVEDB)->m_hWnd); lfrom.Attach (GetDlgItem (IDC_LENGTHA)->m_hWnd); lto.Attach (GetDlgItem (IDC_LENGTHB)->m_hWnd); for (int i = 0; i < 8; i++) mode[i].SetCurSel (0); dfrom.SetTime (&CTime (1971, 1, 1, 0, 0, 0)); dto.SetTime (&CTime::GetCurrentTime ()); lfrom.SetTime (&CTime (2000, 1, 1, 0, 0, 0)); lto.SetTime (&CTime (2000, 1, 1, 23, 59, 59)); for (int i = 0; i < 5; i++) { hero[i].SetImageList (getImageList ()); int cur = 0; int cnt = getNumHeroes (); hero[i].InsertItem ("Any hero", getImageIndex ("Unknown")); for (int j = 0; j < getNumTaverns (); j++) { DotaTavern* tavern = getTavern (j); hero[i].InsertItem (tavern->name, getImageIndex (tavern->side == 0 ? "RedBullet" : "GreenBullet"), 0, -1); for (int cur = 0; cur < getNumHeroes (); cur++) { DotaHero* h = getHero (cur); if (h->tavern == j) hero[i].InsertItem (h->name, getImageIndex (h->imgTag), RGB (255, 255, 255), h->point); } } selhero[i] = 0; hero[i].SetCurSel (0); } return TRUE; }
// CDraftDlg message handlers BOOL CDraftDlg::OnInitDialog () { CDialog::OnInitDialog (); draftPool.Attach (GetDlgItem (IDC_DRAFTPOOL)->m_hWnd); draftPool.SetExtendedStyle (LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT); draftBans.Attach (GetDlgItem (IDC_DRAFT_BANS)->m_hWnd); draftBans.SetExtendedStyle (LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT); draftPicks.Attach (GetDlgItem (IDC_DRAFT_PICKS)->m_hWnd); draftPicks.SetExtendedStyle (LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT); draftPool.InsertColumn (0, ""); draftPool.SetImageList (getImageList (), LVSIL_SMALL); draftPool.SetColumnWidth (0, LVSCW_AUTOSIZE_USEHEADER); draftBans.InsertColumn (0, ""); draftBans.SetImageList (getImageList (), LVSIL_SMALL); draftBans.SetColumnWidth (0, LVSCW_AUTOSIZE_USEHEADER); draftPicks.InsertColumn (0, ""); draftPicks.SetImageList (getImageList (), LVSIL_SMALL); draftPicks.SetColumnWidth (0, LVSCW_AUTOSIZE_USEHEADER); loc.SetWindow (this); loc.SetItemAbsolute (IDC_SENTINEL_TIP, SIDE_LEFT, PERCENT); loc.SetItemRelative (IDC_SCOURGE_TIP, SIDE_LEFT, IDC_SENTINEL_TIP, SIDE_LEFT); loc.SetItemRelative (IDC_BANS_TIP, SIDE_LEFT, IDC_SENTINEL_TIP, SIDE_LEFT); loc.SetItemRelative (IDC_DRAFT_BANS, SIDE_LEFT, IDC_SENTINEL_TIP, SIDE_LEFT); loc.SetItemRelative (IDC_PICKS_TIP, SIDE_LEFT, IDC_SENTINEL_TIP, SIDE_LEFT); loc.SetItemRelative (IDC_DRAFT_PICKS, SIDE_LEFT, IDC_SENTINEL_TIP, SIDE_LEFT); loc.SetItemRelative (IDC_DRAFTPOOL, SIDE_RIGHT, IDC_SENTINEL_TIP, SIDE_LEFT); loc.SetItemAbsolute (IDC_DRAFTPOOL, SIDE_BOTTOM); loc.SetItemAbsolute (IDC_DRAFT_BANS, SIDE_RIGHT); loc.SetItemAbsolute (IDC_DRAFT_PICKS, SIDE_RIGHT); loc.SetItemAbsolute (IDC_DRAFT_PICKS, SIDE_BOTTOM); loc.Start (); return TRUE; }
void WorkspacePanel::createPanel() { mSizer = new wxFlexGridSizer(1, 1, 0, 0); mSizer->AddGrowableCol(0); mSizer->AddGrowableRow(0); mSizer->SetFlexibleDirection(wxVERTICAL); mSizer->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED); //mToolBarPanel = new wxPanel(this); //mSizer->Add(mToolBarPanel, 1, wxALL | wxEXPAND, 0); mTreeCtrl = new wxTreeCtrl(this, ID_TREE_CTRL, wxDefaultPosition, wxDefaultSize, wxNO_BORDER | wxTR_FULL_ROW_HIGHLIGHT | wxTR_HAS_BUTTONS | wxTR_SINGLE); mTreeCtrl->AssignImageList(getImageList()); mRootId = mTreeCtrl->AddRoot(wxT("Workspace"), WORKSPACE_IMAGE); mSizer->Add(mTreeCtrl, 0, wxALL | wxEXPAND, 0); SetSizer(mSizer); Layout(); }