Esempio n. 1
0
void iHeroChild::OnCompose()
{
	iRect rc = GetScrRect();
	gGfxMgr.BlitTile(PDGG_BKTILE, gApp.Surface(),rc);
	gApp.Surface().Darken25Rect(rc);

	check(m_pHero);

	// Name
	iRect trc(rc.x,rc.y,rc.w,17);
	ButtonFrame(gApp.Surface(),trc,0);
	iStringT txt;
	txt.Addf(_T("#S0#FEEE%s#S2#FAFF %s #S0#FEEE%s %d"),gTextMgr[TRID_HERO_TYPE_KNIGHT+m_pHero->Type()],m_pHero->Name().CStr(),gTextMgr[TRID_LEVEL],m_pHero->Level());
	gTextComposer.TextOut(gApp.Surface(),trc,txt,trc,AlignCenter);
	gApp.Surface().HLine(iPoint(rc.x,rc.y+17),rc.x2(),cColor_Black);

	rc.DeflateRect(0,18,0,0);

	// Portrait
	/*
	gApp.Surface().FrameRect(iRect(rc.x+2,rc.y+1,50,50),cColor_Black);
	gGfxMgr.Blit(m_pHero->Proto()->m_icn48,gApp.Surface(),iPoint(rc.x+3,rc.y+2));
	ButtonFrame(gApp.Surface(),iRect(rc.x+3,rc.y+2,48,48),0);
	*/
}
Esempio n. 2
0
	void OnCompose()
	{
		iRect rc = GetScrRect();
		sint32 tw = m_perks.GetSize() * 15 - 1;
		sint32 ox = rc.x + ((sint32)(rc.w/2) - tw/2);
		for (uint32 nn=0; nn<m_perks.GetSize(); ++nn) {
			gGfxMgr.Blit(PDGG_CREAT_PERKS + m_perks[nn], gApp.Surface(), iPoint(ox, rc.y));
			ox += 15;
		}
	}
Esempio n. 3
0
void iCastleToolBar::OnCompose()
{
	iRect rect = GetScrRect();
	gApp.Surface().FillRect(rect,cColor_Black);
	sint32 rval = m_pTabSwitch->GetSize().w+1+33;

	iRect rc(rect.x+rval,rect.y+1,rect.w-(30+rval)-1,20);
	gGfxMgr.BlitTile(PDGG_BKTILE, gApp.Surface(), rc);
	ButtonFrame(gApp.Surface(), rc, 0);
}
Esempio n. 4
0
void iArmyListEx::OnCompose()
{
	iRect rc = GetScrRect();

	iRect cMetrix(rc.x,rc.y,m_itemW,rc.h);
	for (sint32 xx=0; xx<7; ++xx) {
		gApp.Surface().FrameRect(iRect(cMetrix.x-1,cMetrix.y-1,cMetrix.w+2,cMetrix.h+2), cColor_Black);
		if (m_pArmy) ComposeCreatureButton(gApp.Surface(), cMetrix, m_pArmy->At(xx).Type(), m_pArmy->At(xx).Count(), VL_EXPERT, m_dCell == xx, (m_pDragItem && xx == m_pDragItem->m_fromCell), (m_pDropItem && xx == m_pDropItem->m_toCell));
		else ComposeCreatureButton(gApp.Surface(), cMetrix, CREAT_UNKNOWN, 0, VL_EXPERT, m_dCell == xx, false,false);
		cMetrix.x += (cMetrix.w+1);
	}
}
Esempio n. 5
0
	void OnCompose()
	{
		if (m_pHero) {
			iRect rc = GetScrRect();
			SpriteId sid = m_pHero->Proto()->m_icn48;
			gGfxMgr.Blit(sid,gApp.Surface(), rc);
			ButtonFrame(gApp.Surface(),rc,GetButtonState());
			if (!IsEnabled()) gApp.Surface().Darken25Rect(rc);
			rc.InflateRect(1);
			gApp.Surface().FrameRect(rc,cColor_Black);
		}
	}
Esempio n. 6
0
	void OnCompose()
	{
		iRect rc = GetScrRect();
		gApp.Surface().FrameRect(rc, cColor_Black);
		rc.DeflateRect(1);

		SpriteId icn = PDGG_CTL_SICONS+CTLT_COUNT*2+m_nt;
		//PDGG_CTL_SICONS + (NATION_COUNT-NATION_HIGHMEN)*2 + (m_nt-NATION_HIGHMEN)
		BlitIcon(gApp.Surface(), icn, rc);
		ButtonFrame(gApp.Surface(), rc, m_state);

		if (!IsEnabled()) gApp.Surface().FillRect(rc, cColor_Gray64,128);
	}
Esempio n. 7
0
void iSpellListView::OnCompose() 
{
	iRect rc = GetScrRect();

	// Buttons frame;
	iRect brc = m_pSchoolSwitch->GetScrRect();
	brc.InflateRect(1);
	gApp.Surface().FrameRect(brc, cColor_Black);


	rc.DeflateRect(m_pSchoolSwitch->GetRect().x2() + 5, -1, -1, -1);

	// Frame
	gApp.Surface().FrameRect(rc, cColor_Black);
	gApp.Surface().Darken25Rect(rc);
	rc.DeflateRect(3);


	// Spell
	if (m_curSel != MSP_INVALID) {
		// Name
		gTextComposer.TextOut(iTextComposer::FontConfig(iTextComposer::FS_MEDIUM,MSCH_COLORS[SPELL_DESCRIPTORS[m_curSel].school][0]), gApp.Surface(),iPoint(rc.x,rc.y),gTextMgr[TRID_SPNAME_MAGICARROW+m_curSel],rc, AlignTop);
		rc.DeflateRect(0,13,0,0);
		// Level
		gTextComposer.TextOut(iTextComposer::FontConfig(iTextComposer::FS_SMALL,MSCH_COLORS[SPELL_DESCRIPTORS[m_curSel].school][0]), gApp.Surface(),iPoint(rc.x,rc.y),gTextMgr[TRID_LEVEL] + iFormat(_T(": %d"), SPELL_DESCRIPTORS[m_curSel].level + 1),rc, AlignTop);
		rc.DeflateRect(0,16,0,0);
		// Icon
		rc.DeflateRect(0,40,0,0);
		// Hero school level
		ComposeSpellLevel(gApp.Surface(), rc, m_curSel, m_pOwner);
		rc.DeflateRect(0,12,0,0);
		// Cost
		uint8 cost = iBaseSpell::GetSpellCost(m_curSel, m_pOwner);
		uint8 school = SPELL_DESCRIPTORS[m_curSel].school;
		gTextComposer.TextOut(iTextComposer::FontConfig(iTextComposer::FS_SMALL,MSCH_COLORS[school][0]), gApp.Surface(),iPoint(rc.x,rc.y),gTextMgr[TRID_COST]+iFormat(_T(" %d"),cost),rc, AlignTop);
		rc.DeflateRect(0,20,0,0);
		// Inaccessebility reason
		if (m_pOwner->ManaPts() < cost) {
			iStringT msgStr(gTextMgr[TRID_MSG_SPELL_NOT_ENOUGH_MANA]);
			iTextComposer::FontConfig fntSmall(iTextComposer::FS_SMALL,RGB16(255,96,0));
			gTextComposer.TextBoxOut( fntSmall, gApp.Surface(), msgStr,rc);
		} else if (iCombatSpell* pCombatSpell = DynamicCast<iCombatSpell*>(gGame.ItemMgr().m_spellMgr.Spell(m_curSel))) {
			iTextComposer::FontConfig fntSmallDifferentColor(iTextComposer::FS_SMALL,RGB16(255,255,0));
			gTextComposer.TextBoxOut( fntSmallDifferentColor, gApp.Surface(), pCombatSpell->ActionText(m_pOwner),rc);
		}
	} else {
		iTextComposer::FontConfig fntSmall(iTextComposer::FS_SMALL,RGB16(255,96,0));
		gTextComposer.TextBoxOut(fntSmall, gApp.Surface(), gTextMgr[TRID_NO_SPELL_SELECTED],rc);
	}
}
Esempio n. 8
0
		void OnCompose()
		{
//			gApp.Surface().Darken50Rect(GetScrRect());
			// Compose outer frame
			iRect rect = GetScrRect();
			rect.InflateRect(1);

			iDibFont::ComposeProps props = iDibFont::ComposeProps(iGradient(menuBtnText,15), cColor_Black, iDibFont::DecBorder);
			uint32 state = GetButtonState();
			if ( state & iButton::Disabled ) {
				props = iDibFont::ComposeProps(RGB16(255,160,80), cColor_Black, iDibFont::DecBorder);
			} else if ( state & iButton::Pressed ) {
				props = iDibFont::ComposeProps(RGB16(255,255,255), cColor_Black, iDibFont::DecBorder);
				uint16 cColor_Grey = RGB16(32,32,32);
				gApp.Surface().HLine(iPoint(rect.x+2, rect.y), rect.x+rect.w-3, cColor_Grey);
				gApp.Surface().HLine(iPoint(rect.x+2, rect.y+rect.h-1), rect.x+rect.w-3, cColor_Grey);
				gApp.Surface().VLine(iPoint(rect.x,rect.y+2), rect.y+rect.h-2, cColor_Grey);
				gApp.Surface().VLine(iPoint(rect.x+rect.w-1,rect.y+2), rect.y+rect.h-2, cColor_Grey);
				gApp.Surface().Darken50Rect(GetScrRect());
			}
			iTextComposer::FontConfig fc(iTextComposer::FS_LARGE, props );
			gTextComposer.TextOut(fc, gApp.Surface(), iPoint(), gTextMgr[m_TextKey], GetScrRect(), AlignCenter);
		}
Esempio n. 9
0
void iCastleTitleBar::OnCompose()
{
	iRect rect = GetScrRect();
	gApp.Surface().FillRect(rect,cColor_Black);
	rect.DeflateRect(33,1,33,1);
	
	gGfxMgr.BlitTile(PDGG_BKTILE,gApp.Surface(),rect);
	ComposeDlgButton(gApp.Surface(), rect, iButton::Disabled);

	iStringT txt;
	txt.Addf(_T("#S1#FFF0 %s #S0#FC90(%s)"),m_pCastle->Name().CStr(),gTextMgr[TRID_CASTLE_TYPE_CITADEL+m_pCastle->Proto()->Type()]);
	gTextComposer.TextOut(gApp.Surface(),rect,txt,rect,AlignCenter);

	//iTextComposer::FontConfig fc(dlgfc_hdr);
	//gTextComposer.TextOut(fc, gApp.Surface(),rect.point(),m_pCastle->Name(),rect,AlignCenter);
}
Esempio n. 10
0
	void OnCompose()
	{
		iRect rc = GetScrRect();
		gApp.Surface().FrameRect(rc, cColor_Black);
		rc.DeflateRect(1);
		gApp.Surface().FillRect(rc, PLAYER_COLORS[m_pid],96);
		ButtonFrame(gApp.Surface(), rc, m_state);		

		SpriteId sid = (m_pt == PT_HUMAN)?PDGG_ICN_PLT_HUMAN:PDGG_ICN_PLT_AI;
		iPoint op(rc.x + (sint32)(rc.w/2) - (sint32)(gGfxMgr.Dimension(sid).w/2), rc.y + (sint32)(rc.h/2) - (sint32)(gGfxMgr.Dimension(sid).h/2));
		gGfxMgr.Blit(sid, gApp.Surface(), op);
		/*
		if (m_pt == PT_HUMAN) gTextComposer.TextOut(dlgfc_stopic, gApp.Surface(), iPoint(), _T("Human"), rc, AlignCenter);
		else if (m_pt == PT_COMPUTER) gTextComposer.TextOut(dlgfc_splain, gApp.Surface(), iPoint(), _T("CPU"), rc, AlignCenter);
		*/

		if (!IsEnabled()) gApp.Surface().FillRect(rc, cColor_Gray64,128);
	}
Esempio n. 11
0
void iCtlViewChild::OnCompose()
{
	iRect rc = GetScrRect();
	gGfxMgr.BlitTile(PDGG_BKTILE, gApp.Surface(),rc);
	gApp.Surface().Darken25Rect(rc);
}
Esempio n. 12
0
void iCastleView::OnCompose()
{
	gApp.Surface().FillRect(GetScrRect(),RGB16(32,64,128));
}
Esempio n. 13
0
void iMeetToolBar::OnCompose()
{
	iRect rect = GetScrRect();
	gGfxMgr.BlitTile(PDGG_BKTILE, gApp.Surface(), iRect(rect.x,rect.y+1,rect.w-30,20));
	ButtonFrame(gApp.Surface(), iRect(rect.x,rect.y+1,rect.w-30,20), 0);
}
Esempio n. 14
0
void iMeetView::OnCompose()
{
	gApp.Surface().FillRect(GetScrRect(),0);
}