Questions about __WIKI

05/07/2020 17:30 lampaniboden1#1
Hi guys!

So i just leeched the __WIKI system from totemia/virtuos files, i build neuz and worldserver without problems.
However when i view the Wiki by typing /wiki in the chat it looks like this:

[Only registered and activated users can see links. Click Here To Register...]

How can i add text to the Yellow buttons?
And how can i make the text of all items visable not just when its marked like shown in the pic?

I'm using v15 btw

I'd appreciate some help guys!

Greetz
05/07/2020 17:42 netHoxInc#2
Resource for buttons, if im not totally wrong, for font-color check source code.
05/07/2020 19:30 Hyellow#3
Quote:
Originally Posted by lampaniboden1 View Post
Hi guys!

So i just leeched the __WIKI system from totemia/virtuos files, i build neuz and worldserver without problems.
However when i view the Wiki by typing /wiki in the chat it looks like this:

[Only registered and activated users can see links. Click Here To Register...]

How can i add text to the Yellow buttons?
And how can i make the text of all items visable not just when its marked like shown in the pic?

I'm using v15 btw

I'd appreciate some help guys!

Greetz
Update your text's color (WndControl.cpp)

Code:
	if (pWnd->GetWndId() == APP_WIKI)
	{
		CWndWiki *pWndWiki = (CWndWiki*)pWnd;
		m_nFontHeight = 40;
		CPoint pt(10, 3);
		DWORD dwColor;
		vector<ItemProp*> *pVecItems = pWndWiki->GetItemList();
		CRect rectClient = GetClientRect();
		dwColor = D3DCOLOR_ARGB(255, 0, 0, 0);
		int nPage = rectClient.Height() / m_nFontHeight;
		m_wndScrollBar.SetScrollRange(0, pVecItems->size());
		m_wndScrollBar.SetScrollPage(nPage);

		for (unsigned i = (unsigned)m_wndScrollBar.GetScrollPos(); i < (unsigned)(pVecItems->size()); ++i)
		{
			if (i > (unsigned)(nPage + m_wndScrollBar.GetScrollPos()))
				break;
			ItemProp *pProp = pVecItems->at(i);
			CString strBuf;

			p2DRender->RenderLine(CPoint(-2, pt.y + 37), CPoint(rectClient.right, pt.y + 37), 0xFF776655);
			if (i == m_nCurSelect)
			{
				CRect DrawRect = CRect(0, pt.y - 2, rectClient.right, pt.y + 36);
				p2DRender->RenderFillRect(DrawRect, 0xFFECF3F7);
				p2DRender->RenderRect(DrawRect, 0xFFe1ebf2);
			}
			if (strlen(pProp->szIcon))
			{
				CTexture *pIcon = CWndBase::m_textureMng.AddTexture(p2DRender->m_pd3dDevice, MakePath(DIR_ITEM, pProp->szIcon), 0xffff00ff);
				pIcon->Render(p2DRender, pt);
			}
			CRect rectToolTip(pt.x, pt.y, pt.x + 35, pt.y + 35);
			if (rectToolTip.PtInRect(m_ptMouse))
			{
				CPoint pt2 = m_ptMouse;
				ClientToScreen(&pt2);
				ClientToScreen(&rectToolTip);
				CItemElem Item;
				Item.m_dwItemId = pProp->dwID;
				g_WndMng.PutToolTip_Item(&Item, pt2, &rectToolTip, APP_WIKI);
			}
			pt.x += 40;
			pt.y += 10;
			p2DRender->TextOut(pt.x, pt.y, pProp->szName, dwColor);
			pt.x += 250;
			if (pProp->dwItemJob < MAX_JOB)
				p2DRender->TextOut(pt.x, pt.y, prj.m_aJob[pProp->dwItemJob].szName, dwColor);
			pt.x += 150;
			int nLevel = (pProp->dwLimitLevel1 == NULL_ID ? 1 : pProp->dwLimitLevel1);
			strBuf.Format("%d", nLevel);
			p2DRender->TextOut(pt.x, pt.y, strBuf, dwColor);
			pt.x = 10;
			pt.y += m_nFontHeight - 10;
		}
	}else
05/08/2020 20:40 lampaniboden1#4
Quote:
Originally Posted by Hyellow View Post
Update your text's color (WndControl.cpp)

Code:
	if (pWnd->GetWndId() == APP_WIKI)
	{
		CWndWiki *pWndWiki = (CWndWiki*)pWnd;
		m_nFontHeight = 40;
		CPoint pt(10, 3);
		DWORD dwColor;
		vector<ItemProp*> *pVecItems = pWndWiki->GetItemList();
		CRect rectClient = GetClientRect();
		dwColor = D3DCOLOR_ARGB(255, 0, 0, 0);
		int nPage = rectClient.Height() / m_nFontHeight;
		m_wndScrollBar.SetScrollRange(0, pVecItems->size());
		m_wndScrollBar.SetScrollPage(nPage);

		for (unsigned i = (unsigned)m_wndScrollBar.GetScrollPos(); i < (unsigned)(pVecItems->size()); ++i)
		{
			if (i > (unsigned)(nPage + m_wndScrollBar.GetScrollPos()))
				break;
			ItemProp *pProp = pVecItems->at(i);
			CString strBuf;

			p2DRender->RenderLine(CPoint(-2, pt.y + 37), CPoint(rectClient.right, pt.y + 37), 0xFF776655);
			if (i == m_nCurSelect)
			{
				CRect DrawRect = CRect(0, pt.y - 2, rectClient.right, pt.y + 36);
				p2DRender->RenderFillRect(DrawRect, 0xFFECF3F7);
				p2DRender->RenderRect(DrawRect, 0xFFe1ebf2);
			}
			if (strlen(pProp->szIcon))
			{
				CTexture *pIcon = CWndBase::m_textureMng.AddTexture(p2DRender->m_pd3dDevice, MakePath(DIR_ITEM, pProp->szIcon), 0xffff00ff);
				pIcon->Render(p2DRender, pt);
			}
			CRect rectToolTip(pt.x, pt.y, pt.x + 35, pt.y + 35);
			if (rectToolTip.PtInRect(m_ptMouse))
			{
				CPoint pt2 = m_ptMouse;
				ClientToScreen(&pt2);
				ClientToScreen(&rectToolTip);
				CItemElem Item;
				Item.m_dwItemId = pProp->dwID;
				g_WndMng.PutToolTip_Item(&Item, pt2, &rectToolTip, APP_WIKI);
			}
			pt.x += 40;
			pt.y += 10;
			p2DRender->TextOut(pt.x, pt.y, pProp->szName, dwColor);
			pt.x += 250;
			if (pProp->dwItemJob < MAX_JOB)
				p2DRender->TextOut(pt.x, pt.y, prj.m_aJob[pProp->dwItemJob].szName, dwColor);
			pt.x += 150;
			int nLevel = (pProp->dwLimitLevel1 == NULL_ID ? 1 : pProp->dwLimitLevel1);
			strBuf.Format("%d", nLevel);
			p2DRender->TextOut(pt.x, pt.y, strBuf, dwColor);
			pt.x = 10;
			pt.y += m_nFontHeight - 10;
		}
	}else
Thank you that did the trick! :D

Still can't figure out the resource part though, here's my resdata.txt

IDS_RESDATA_INC_009586 Model View
IDS_RESDATA_INC_009537
IDS_RESDATA_INC_009538 Itemlist
IDS_RESDATA_INC_009539 Search
IDS_RESDATA_INC_009540 Type
IDS_RESDATA_INC_009541 Job
IDS_RESDATA_INC_009542 Find
IDS_RESDATA_INC_009543 Itemname
IDS_RESDATA_INC_009544 Job
IDS_RESDATA_INC_009545 Level

resdata.inc

APP_WIKI "WndTile00.tga" 1 624 624 0x2410000 26
{
// Title String
IDS_RESDATA_INC_009538
}
{
// ToolTip
IDS_RESDATA_INC_009537
}
{
WTYPE_COMBOBOX WIDC_COMBOBOX1 "WndEditTile00.tga" 1 96 20 187 39 0x20000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_009537
}
{
// ToolTip
IDS_RESDATA_INC_009537
}
WTYPE_COMBOBOX WIDC_COMBOBOX2 "WndEditTile00.tga" 1 258 20 349 39 0x20000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_009537
}
{
// ToolTip
IDS_RESDATA_INC_009537
}
WTYPE_EDITCTRL WIDC_EDIT1 "WndEditTile00.tga" 1 408 20 499 39 0x20000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_009537
}
{
// ToolTip
IDS_RESDATA_INC_009537
}
WTYPE_BUTTON WIDC_BUTTON1 "ButtNormal00.tga" 0 508 18 582 42 0x220010 0 0 0 0
{
// Title String
IDS_RESDATA_INC_009539
}
{
// ToolTip
IDS_RESDATA_INC_009537
}
WTYPE_STATIC WIDC_STATIC1 "" 0 26 22 86 38 0x2220000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_009540
}
{
// ToolTip
IDS_RESDATA_INC_009537
}
WTYPE_STATIC WIDC_STATIC2 "" 0 196 22 254 38 0x2220000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_009541
}
{
// ToolTip
IDS_RESDATA_INC_009537
}
WTYPE_STATIC WIDC_STATIC3 "" 0 358 22 410 38 0x2220000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_009542
}
{
// ToolTip
IDS_RESDATA_INC_009537
}
WTYPE_BUTTON WIDC_BUTTON2 "ButtNormal02.tga" 0 24 68 234 92 0x220010 0 0 0 0
{
// Title String
IDS_RESDATA_INC_009543
}
{
// ToolTip
IDS_RESDATA_INC_009537
}
WTYPE_BUTTON WIDC_BUTTON3 "ButtNormal01.tga" 0 286 68 390 92 0x220010 0 0 0 0
{
// Title String
IDS_RESDATA_INC_009544
}
{
// ToolTip
IDS_RESDATA_INC_009537
}
WTYPE_BUTTON WIDC_BUTTON4 "ButtNormal01.tga" 0 446 68 550 92 0x220010 0 0 0 0
{
// Title String
IDS_RESDATA_INC_009545
}
{
// ToolTip
IDS_RESDATA_INC_009537
}
WTYPE_LISTBOX WIDC_LISTBOX1 "WndEditTile00.tga" 1 14 104 598 574 0x20020000 0 0 0 0
{
// Title String
IDS_RESDATA_INC_009537
}
{
// ToolTip
IDS_RESDATA_INC_009537
}

}