void iSettingsDlg::UpdateSliderLabel(uint32 sliderId) { if (sliderId == 101) { // Sfx Volume if (!m_sfxVolumeSlider->CurPos()) m_sfxVolumeLabel->SetText(iStringT(gTextMgr[TRID_SFX_VOLUME]) + _T(": ") + gTextMgr[TRID_OFF]); else m_sfxVolumeLabel->SetText(iFormat(_T("%s: #FFF0%d"), gTextMgr[TRID_CFGENTRY_SFXVOL], m_sfxVolumeSlider->CurPos())); } else if (sliderId == 102) { // Display gamma m_dispGammaLabel->SetText(iFormat(_T("%s: #FFF0%d"), gTextMgr[TRID_CFGENTRY_DISPGAMMA], m_dispGammaSlider->CurPos())); } else if (sliderId == 103) { // Map scroll speed m_mapScrollLabel->SetText(iStringT(gTextMgr[TRID_CFGENTRY_MAPSCROLLSPEED]) + _T(": #FFF0") + gTextMgr[TRID_CFG_SPEED_VSLOW + m_mapScrollSlider->CurPos()]); } else if (sliderId == 104) { // Hero speed m_heroSpeedLabel->SetText(iStringT(gTextMgr[TRID_CFGENTRY_HEROSPEED]) + _T(": #FFF0") + gTextMgr[TRID_CFG_SPEED_VSLOW + m_heroSpeedSlider->CurPos()]); } else if (sliderId == 105) { // Combat speed m_combatSpeedLabel->SetText(iStringT(gTextMgr[TRID_CFGENTRY_COMBATSPEED]) + _T(": #FFF0") + gTextMgr[TRID_CFG_SPEED_VSLOW + m_combatSpeedSlider->CurPos()]); } }
inline void zWarning( void* X, const char* fmt, ... ) { va_list arg; va_start( arg, fmt ); //iStringT buf = VPrintf( fmt, arg ); char buffer[512]; _vsnprintf( buffer, sizeof( buffer ) / sizeof( char ), fmt, arg ); va_end( arg ); HandlerBase* handler = static_cast<HandlerBase*>(X); handler->OnWarning( iStringT( CvtAT<>( buffer ) ) ); }
void iDlg_CreatInfo::DoCompose(const iRect& clRect) { iRect rc(clRect); // title gTextComposer.TextOut(dlgfc_hdr, gApp.Surface(),rc.point(),gTextMgr[m_cGroup.Type()*3+TRID_CREATURE_PEASANT_F2], iRect(rc.x,rc.y,rc.w,15),AlignCenter); rc.y+=15; // icon BlitIcon(gApp.Surface(),PDGG_MINIMON+m_cGroup.Type(),iRect(rc.x,rc.y,rc.w,45)); rc.y+=45; // Perks if (CREAT_DESC[m_cGroup.Type()].perks != CPERK_NONE) rc.y+=15; // props iRect trc(rc.x,rc.y,90,12); iTextComposer::FontConfig fc(iTextComposer::FS_SMALL, RGB16(192,192,255)); gTextComposer.TextOut(fc, gApp.Surface(),trc.point(),iStringT(gTextMgr[TRID_SKILL_ATTACK])+_T(" :"),trc,AlignTopRight); trc.y+=10; gTextComposer.TextOut(fc, gApp.Surface(),trc.point(),iStringT(gTextMgr[TRID_SKILL_DEFENCE])+_T(" :"),trc,AlignTopRight); trc.y+=10; gTextComposer.TextOut(fc, gApp.Surface(),trc.point(),iStringT(gTextMgr[TRID_SKILL_SHOTS])+_T(" :"),trc,AlignTopRight); trc.y+=10; gTextComposer.TextOut(fc, gApp.Surface(),trc.point(),iStringT(gTextMgr[TRID_SKILL_DAMAGE])+_T(" :"),trc,AlignTopRight); trc.y+=10; gTextComposer.TextOut(fc, gApp.Surface(),trc.point(),iStringT(gTextMgr[TRID_SKILL_HEALTH])+_T(" :"),trc,AlignTopRight); trc.y+=10; gTextComposer.TextOut(fc, gApp.Surface(),trc.point(),iStringT(gTextMgr[TRID_SKILL_SPEED])+_T(" :"),trc,AlignTopRight); trc.y+=10; gTextComposer.TextOut(fc, gApp.Surface(),trc.point(),iStringT(gTextMgr[TRID_SKILL_MORALE])+_T(" :"),trc,AlignTopRight); trc.y+=10; gTextComposer.TextOut(fc, gApp.Surface(),trc.point(),iStringT(gTextMgr[TRID_SKILL_LUCK])+_T(" :"),trc,AlignTopRight); trc.y+=10; trc = iRect(rc.x+95,rc.y,rc.w-105,12); iTextComposer::FontConfig tfc(iTextComposer::FS_SMALL, RGB16(255,220,192)); iStringT tout; tout.Setf(_T("%d (%d)"),CREAT_DESC[m_cGroup.Type()].attack, CREAT_DESC[m_cGroup.Type()].attack+m_furtSkills.Value(FSK_ATTACK)); gTextComposer.TextOut(tfc, gApp.Surface(),trc.point(),tout,trc,AlignTopLeft); trc.y+=10; tout.Setf(_T("%d (%d)"),CREAT_DESC[m_cGroup.Type()].defence, CREAT_DESC[m_cGroup.Type()].defence+m_furtSkills.Value(FSK_DEFENCE)); gTextComposer.TextOut(tfc, gApp.Surface(),trc.point(),tout,trc,AlignTopLeft); trc.y+=10; if (CREAT_DESC[m_cGroup.Type()].shots) tout.Setf(_T("%d"),CREAT_DESC[m_cGroup.Type()].shots); else tout.Setf(_T("-")); gTextComposer.TextOut(tfc, gApp.Surface(),trc.point(),tout,trc,AlignTopLeft); trc.y+=10; tout.Setf(_T("%d - %d"),CREAT_DESC[m_cGroup.Type()].damage_min,CREAT_DESC[m_cGroup.Type()].damage_max); gTextComposer.TextOut(tfc, gApp.Surface(),trc.point(),tout,trc,AlignTopLeft); trc.y+=10; tout.Setf(_T("%d (%d)"),CREAT_DESC[m_cGroup.Type()].hits, CREAT_DESC[m_cGroup.Type()].hits+m_furtSkills.Value(FSK_HITS)); gTextComposer.TextOut(tfc, gApp.Surface(),trc.point(),tout,trc,AlignTopLeft); trc.y+=10; tout.Setf(_T("%d (%d)"),CREAT_DESC[m_cGroup.Type()].speed, CREAT_DESC[m_cGroup.Type()].speed+m_furtSkills.Value(FSK_SPEED)); gTextComposer.TextOut(tfc, gApp.Surface(),trc.point(),tout,trc,AlignTopLeft); trc.y+=10; sint32 morale = (CREAT_DESC[m_cGroup.Type()].perks&CPERK_UNDEAD)?0:(m_furtSkills.Value(FSK_MORALE)+m_moraleMod); gTextComposer.TextOut(tfc, gApp.Surface(),trc.point(),FormatNumber(morale,true),trc,AlignTopLeft); trc.y+=10; gTextComposer.TextOut(tfc, gApp.Surface(),trc.point(),FormatNumber(m_furtSkills.Value(FSK_LUCK),true),trc,AlignTopLeft); trc.y+=10; }
void iSettingsDlg::OnCreateDlg() { iRect clRect = ClientRect(); // Label AddChild(new iPHLabel(m_pMgr,iRect(clRect.x, clRect.y, clRect.w, 15), gTextMgr[TRID_MENU_GAMESETTINGS], AlignTop, dlgfc_hdr)); // Track bars sint32 xpos = clRect.x + 10; sint32 ypos = clRect.y + 18; // Sfx volume AddChild(m_sfxVolumeLabel = new iPHLabel(m_pMgr,iRect(xpos, ypos, 120, 12), iStringT(), AlignTop, dlgfc_splain)); ypos += 13; AddChild(m_sfxVolumeSlider = new iPHMiniSlider(m_pMgr,this,iRect(xpos, ypos , 120, 11), 101)); ypos += 15; m_sfxVolumeSlider->SetMetrics(11,1); if (gSettings.ForceNoSound()) { m_sfxVolumeSlider->SetEnabled(false); m_sfxVolumeSlider->SetCurPos(0); } else { m_sfxVolumeSlider->SetCurPos(gSettings.GetEntryValue(CET_SFXVOLUME)); } UpdateSliderLabel(101); // Display gamma AddChild(m_dispGammaLabel = new iPHLabel(m_pMgr,iRect(xpos, ypos, 120, 12), iStringT(), AlignTop, dlgfc_splain)); ypos += 13; AddChild(m_dispGammaSlider = new iPHMiniSlider(m_pMgr,this,iRect(xpos, ypos , 120, 12), 102)); ypos += 15; m_dispGammaSlider->SetMetrics(5,1); m_dispGammaSlider->SetCurPos(gSettings.GetEntryValue(CET_DISPGAMMA)); UpdateSliderLabel(102); // Map scroll speed AddChild(m_mapScrollLabel = new iPHLabel(m_pMgr,iRect(xpos, ypos, 120, 12), iStringT(), AlignTop, dlgfc_splain)); ypos += 13; AddChild(m_mapScrollSlider = new iPHMiniSlider(m_pMgr,this,iRect(xpos, ypos , 120, 12), 103)); ypos += 15; m_mapScrollSlider->SetMetrics(5,1); m_mapScrollSlider->SetCurPos(gSettings.GetEntryValue(CET_MAPSCROLLSPEED)); UpdateSliderLabel(103); // Hero speed AddChild(m_heroSpeedLabel = new iPHLabel(m_pMgr,iRect(xpos, ypos, 120, 12), iStringT(), AlignTop, dlgfc_splain)); ypos += 13; AddChild(m_heroSpeedSlider = new iPHMiniSlider(m_pMgr,this,iRect(xpos, ypos , 120, 12), 104)); ypos += 15; m_heroSpeedSlider->SetMetrics(5,1); m_heroSpeedSlider->SetCurPos(gSettings.GetEntryValue(CET_HEROSPEED)); UpdateSliderLabel(104); // Combat speed AddChild(m_combatSpeedLabel = new iPHLabel(m_pMgr,iRect(xpos, ypos, 120, 12), iStringT(), AlignTop, dlgfc_splain)); ypos += 13; AddChild(m_combatSpeedSlider = new iPHMiniSlider(m_pMgr,this,iRect(xpos, ypos , 120, 12), 105)); ypos += 15; m_combatSpeedSlider->SetMetrics(5,1); m_combatSpeedSlider->SetCurPos(gSettings.GetEntryValue(CET_COMBATSPEED)); UpdateSliderLabel(105); // Checkboxes xpos = clRect.x + (clRect.w/2) + 10; ypos = clRect.y + 29; // Show Hero Reminder AddChild(m_checkBoxes[0] = new iCheckBox(m_pMgr,this,iRect(xpos, ypos, 120, 12), gTextMgr[TRID_CFGENTRY_ENDTURN], 201, Visible|Enabled, gSettings.GetEntryValue(CET_ENDTURNCONF)>0)); ypos += 16; AddChild(m_checkBoxes[1] = new iCheckBox(m_pMgr,this,iRect(xpos, ypos, 120, 12), gTextMgr[TRID_CFGENTRY_MAPGRID], 202, Visible|Enabled, gSettings.GetEntryValue(CET_OVRLANDGRID)>0)); ypos += 16; AddChild(m_checkBoxes[2] = new iCheckBox(m_pMgr,this,iRect(xpos, ypos, 120, 12), gTextMgr[TRID_CFGENTRY_COMBATGRID], 203, Visible|Enabled, gSettings.GetEntryValue(CET_COMBATGRID)>0)); ypos += 16; AddChild(m_checkBoxes[3] = new iCheckBox(m_pMgr,this,iRect(xpos, ypos, 120, 12), gTextMgr[TRID_CFGENTRY_QUICKCOMBAT], 204, Visible|Enabled, gSettings.GetEntryValue(CET_QUICKCOMBAT)>0)); ypos += 16; AddChild(m_checkBoxes[4] = new iCheckBox(m_pMgr,this,iRect(xpos, ypos, 120, 12), gTextMgr[TRID_CFGENTRY_PATHMODE], 205, Visible|Enabled, gSettings.GetEntryValue(CET_TRVPTSMODE)>0)); ypos += 16; AddChild(m_checkBoxes[5] = new iCheckBox(m_pMgr,this,iRect(xpos, ypos, 120, 12), gTextMgr[TRID_CFGENTRY_SURVMAPFILT], 206, Visible|Enabled, gSettings.GetEntryValue(CET_SURVMAPFILTR)>0)); ypos += 16; AddChild(m_checkBoxes[6] = new iCheckBox(m_pMgr,this,iRect(xpos, ypos, 120, 12), gTextMgr[TRID_CFGENTRY_SURVMAPSCALE], 207, Visible|Enabled, gSettings.GetEntryValue(CET_SURVMAPSCALE)>0)); ypos += 16; AddChild(m_checkBoxes[7] = new iCheckBox(m_pMgr,this,iRect(xpos, ypos, 120, 12), gTextMgr[TRID_CFGENTRY_LHANDER], 208, Visible|Enabled, gSettings.GetEntryValue(CET_LHANDMAODE)>0)); ypos += 16; // Hardware keys and Ok button AddChild(new iTextButton(m_pMgr,this,iRect(clRect.x+(clRect.w/2-57),clRect.y2()-DEF_BTN_HEIGHT,40,DEF_BTN_HEIGHT),TRID_OK, DRC_OK)); AddChild(new iTextButton(m_pMgr,this,iRect(clRect.x+(clRect.w/2-57) + 45,clRect.y2()-DEF_BTN_HEIGHT,70,DEF_BTN_HEIGHT),TRID_HARDWARE_KEYS, 301)); }