Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Flyff > Flyff Private Server
You last visited: Today at 16:45

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



HELP WIKI & MODEL VIEWER

Discussion on HELP WIKI & MODEL VIEWER within the Flyff Private Server forum part of the Flyff category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Nov 2019
Posts: 11
Received Thanks: 0
HELP WIKI & MODEL VIEWER

can someone help me fixing this. Instead of viewing a model, WIKICI will popup
iiamevan is offline  
Old 04/18/2020, 08:18   #2
 
Naltalah's Avatar
 
elite*gold: 0
Join Date: Aug 2016
Posts: 308
Received Thanks: 372
Because this code will open up the CI window if your authority is high enough. Maybe take a look at what it actually does.

Code:
BOOL CWndWiki::OnChildNotify(UINT message, UINT nID, LRESULT *pLResult)
{
	if (message == EN_CHANGE)
	{
		if (nID == WIDC_EDIT1)
			UpdateList();
	}
	else if (message == WNM_DBLCLK)
	{
		if (nID == WIDC_LISTBOX1)
		{
			{
				if (m_pListItems->GetCurSel() != -1)
				{
					if (g_pPlayer->m_dwAuthorization >= AUTH_GAMEMASTER)
					{
						SAFE_DELETE(m_pCreate);
						m_pCreate = new CWndWikiCreate();
						m_pCreate->Initialize(this);
						m_pCreate->SetItem(m_vecItems[m_pListItems->GetCurSel()]);
(This might not be the exact same code as you're using, but it will give you an idea what to look for)
Naltalah is offline  
Thanks
1 User
Old 04/18/2020, 08:20   #3
 
elite*gold: 0
Join Date: Nov 2019
Posts: 11
Received Thanks: 0
Quote:
Originally Posted by Naltalah View Post
Because this code will open up the CI window if your authority is high enough. Maybe take a look at what it actually does.

Code:
BOOL CWndWiki::OnChildNotify(UINT message, UINT nID, LRESULT *pLResult)
{
	if (message == EN_CHANGE)
	{
		if (nID == WIDC_EDIT1)
			UpdateList();
	}
	else if (message == WNM_DBLCLK)
	{
		if (nID == WIDC_LISTBOX1)
		{
			{
				if (m_pListItems->GetCurSel() != -1)
				{
					if (g_pPlayer->m_dwAuthorization >= AUTH_GAMEMASTER)
					{
						SAFE_DELETE(m_pCreate);
						m_pCreate = new CWndWikiCreate();
						m_pCreate->Initialize(this);
						m_pCreate->SetItem(m_vecItems[m_pListItems->GetCurSel()]);

Even if normal players, cant view a model, how to fix it?
iiamevan is offline  
Old 04/18/2020, 08:21   #4
 
Naltalah's Avatar
 
elite*gold: 0
Join Date: Aug 2016
Posts: 308
Received Thanks: 372
Then your modelviewer code is not in the OnChildNotify function.
Naltalah is offline  
Thanks
1 User
Old 04/18/2020, 08:24   #5
 
elite*gold: 0
Join Date: Nov 2019
Posts: 11
Received Thanks: 0
its here


Code:
#include "stdafx.h"

#ifdef __WIKI
#include "WndWiki.h"
#include "resdata.h"

#include "DPClient.h"

#ifdef __MODEL_VIEW
#include "WndModelView.h"
#endif

extern CDPClient g_DPlay;

DWORD WINAPI __SortThread(LPVOID lpParam)
{
	CWndWiki *pWiki = (CWndWiki*)lpParam;
	pWiki->Sort();
	return 0;
}

CWndWiki::CWndWiki()
{
	m_vecItems.clear();
	m_bUpperCase = false;
	m_cSortType = 0;
	m_hSortThread = INVALID_HANDLE_VALUE;
	m_pCreate = NULL;
}

CWndWiki::~CWndWiki()
{
	m_vecItems.clear();
	TerminateThread(m_hSortThread,0);
	SAFE_DELETE(m_pCreate);
}

BOOL CWndWiki::Initialize(CWndBase *pWndParent, DWORD dwStyle)
{
	return CWndNeuz::InitDialog(g_Neuz.GetSafeHwnd(),APP_WIKI,0,0,pWndParent);
}

void CWndWiki::OnInitialUpdate()
{
	CWndNeuz::OnInitialUpdate();

	m_pListItems = (CWndListBox*)GetDlgItem(WIDC_LISTBOX1);
	m_pComboKind = (CWndComboBox*)GetDlgItem(WIDC_COMBOBOX1);
	m_pComboJob = (CWndComboBox*)GetDlgItem(WIDC_COMBOBOX2);
	m_pEditFilter = (CWndEdit*)GetDlgItem(WIDC_EDIT1);
	
	int nIdx = 0;
	for( int i = 0; i < MAX_JOB; ++i )
	{
		if( i == JOB_PUPPETEER || i == JOB_DOPPLER || i == JOB_GATEKEEPER )
			continue;
		nIdx = m_pComboJob->AddString(prj.m_aJob[i].szName);
		m_pComboJob->SetItemData(nIdx,i);
	}
	m_pComboJob->SetCurSel(0);

	nIdx = m_pComboKind->AddString("All");
	m_pComboKind->SetItemData(nIdx,NULL_ID);

	nIdx = m_pComboKind->AddString("Weapon");
	m_pComboKind->SetItemData(nIdx,IK1_WEAPON);

	nIdx = m_pComboKind->AddString("Armor");
	m_pComboKind->SetItemData(nIdx,IK1_ARMOR);

	nIdx = m_pComboKind->AddString("Ride");
	m_pComboKind->SetItemData(nIdx,IK1_RIDE);

	nIdx = m_pComboKind->AddString("Furniture");
	m_pComboKind->SetItemData(nIdx,IK1_HOUSING);

	nIdx = m_pComboKind->AddString("Pet");
	m_pComboKind->SetItemData(nIdx,IK3_PET);

	m_pComboKind->SetCurSel(0);

	UpdateList();

	MoveParentCenter();
}

BOOL CWndWiki::OnChildNotify(UINT message, UINT nID, LRESULT *pLResult)
{
	if( message == WNM_CLICKED )
	{
		switch( nID )
		{
		case WIDC_BUTTON2:
			{
				TerminateThread(m_hSortThread,0);
				m_cSortType = 0;
				m_bUpperCase = !m_bUpperCase;
				m_hSortThread = CreateThread(0,0,__SortThread,this,0,0);
			}
			break;
		case WIDC_BUTTON3:
			{
				TerminateThread(m_hSortThread,0);
				m_cSortType = 1;
				m_bUpperCase = !m_bUpperCase;
				m_hSortThread = CreateThread(0,0,__SortThread,this,0,0);
			}
			break;
		case WIDC_BUTTON4:
			{
				TerminateThread(m_hSortThread,0);
				m_cSortType = 2;
				m_bUpperCase = !m_bUpperCase;
				m_hSortThread = CreateThread(0,0,__SortThread,this,0,0);
			}
			break;
		case WIDC_BUTTON1:
			{
				UpdateList();
			}
			break;
		}
	}
	else if( message == WNM_SELCHANGE )
	{
		if( nID == WIDC_COMBOBOX1 || nID == WIDC_COMBOBOX2 )
			UpdateList();
	}
	else if( message == EN_CHANGE )
	{
		if( nID == WIDC_EDIT1 )
			UpdateList();
	}
	else if( message == WNM_DBLCLK )
	{
		if( nID == WIDC_LISTBOX1 )
		{
#ifdef __MODEL_VIEW
			if( m_pListItems->GetCurSel() != -1 )
			{
				if( g_pPlayer->m_dwAuthorization >= AUTH_OPERATOR && GetAsyncKeyState(VK_SHIFT) & 0x8000 )
				{
					SAFE_DELETE(m_pCreate);
					m_pCreate = new CWndWikiCreate();
					m_pCreate->Initialize(this);
					m_pCreate->SetItem(m_vecItems[m_pListItems->GetCurSel()]);
				}else
				{
					ItemProp *pProp = m_vecItems[m_pListItems->GetCurSel()];
					if( pProp )
					{
						CWndModelView *pWndViewer = (CWndModelView*)g_WndMng.GetApplet(APP_MODEL_VIEW);
						if( !pWndViewer )
						{
							pWndViewer = (CWndModelView*)g_WndMng.CreateApplet(APP_MODEL_VIEW);
							if( pWndViewer )
							{
								if( !pWndViewer->SetPart(pProp) )
									pWndViewer->Destroy();
							}
						}else
							pWndViewer->SetPart(pProp);
					}
				}
			}
#else
			if( g_pPlayer->m_dwAuthorization >= AUTH_SOFTWAREENGINEER )
			{
				if( m_pListItems->GetCurSel() != -1 )
				{
					SAFE_DELETE(m_pCreate);
					m_pCreate = new CWndWikiCreate();
					m_pCreate->Initialize(this);
					m_pCreate->SetItem(m_vecItems[m_pListItems->GetCurSel()]);
				}
			}
#endif
		}
	}
	return CWndNeuz::OnChildNotify(message,nID,pLResult);
}


void CWndWiki::UpdateList()
{
	const static DWORD dwItems [] = { II_SYS_SYS_SCR_PERIN };
	DWORD dwJob = m_pComboJob->GetSelectedItemData();
	DWORD dwFilter = m_pComboKind->GetSelectedItemData();
	CString strFilter = m_pEditFilter->GetString();

	m_vecItems.clear();
	m_pListItems->ResetContent();

	for( int i = 0; i < prj.m_aPropItem.GetSize(); ++i )
	{
		ItemProp *pProp = prj.m_aPropItem.GetAt(i);
		if( pProp )
		{
			bool bInArray = false;
			for( int j = 0; j < sizeof(dwItems) / sizeof(dwItems[0]); ++j )
			{
				if( pProp->dwID == dwItems[j] )
				{
					bInArray = true;
					break;
				}
			}
			if( strstr(pProp->szName,"?") )
				continue;
			if( pProp->dwLimitLevel1 > MAX_CHARACTER_LEVEL && pProp->dwLimitLevel1 != NULL_ID )
				continue;
			if( !strlen(pProp->szName) )
				continue;
			if( !strlen(pProp->szIcon) )
				continue;
			if( bInArray )
				continue;
			if( dwJob != JOB_VAGRANT )
			{
				if( pProp->dwItemJob != dwJob )
					continue;
			}
			if( dwFilter != NULL_ID )
			{
				if( pProp->dwItemKind1 != dwFilter )
					continue;
			}
			if( strFilter.GetLength() )
			{
				CString strName = pProp->szName;
				if( !strstr(strName.MakeLower(),strFilter.MakeLower()) )
					continue;
			}
			m_vecItems.push_back(pProp);
			m_pListItems->AddString("");
		}
	}
}

bool SortByNameUpper(const ItemProp *pPropLeft, const ItemProp *pPropRight)
{
	std::string strLeft = pPropLeft->szName;
	std::string strRight = pPropRight->szName;
	return (strLeft < strRight);
}
bool SortByNameLower(const ItemProp *pPropLeft, const ItemProp *pPropRight)
{
	std::string strLeft = pPropLeft->szName;
	std::string strRight = pPropRight->szName;
	return (strLeft > strRight);
}
bool SortByLevelUpper(const ItemProp *pPropLeft, const ItemProp *pPropRight)
{
	int nLevelLeft = (pPropLeft->dwLimitLevel1 == NULL_ID ? 1 : pPropLeft->dwLimitLevel1);
	int nLevelRight = (pPropRight->dwLimitLevel1 == NULL_ID ? 1 : pPropRight->dwLimitLevel1);
	return (nLevelLeft < nLevelRight);
}
bool SortByLevelLower(const ItemProp *pPropLeft, const ItemProp *pPropRight)
{
	int nLevelLeft = (pPropLeft->dwLimitLevel1 == NULL_ID ? 1 : pPropLeft->dwLimitLevel1);
	int nLevelRight = (pPropRight->dwLimitLevel1 == NULL_ID ? 1 : pPropRight->dwLimitLevel1);
	return (nLevelLeft > nLevelRight);
}
bool SortByJobUpper(const ItemProp *pPropLeft, const ItemProp *pPropRight)
{
	return (pPropLeft->dwItemJob < pPropRight->dwItemJob);
}
bool SortByJobLower(const ItemProp *pPropLeft, const ItemProp *pPropRight)
{
	return (pPropLeft->dwItemJob > pPropRight->dwItemJob);
}

void CWndWiki::SortByName()
{
	if( m_bUpperCase )
		std::sort(m_vecItems.begin(),m_vecItems.end(), SortByNameUpper);
	else
		std::sort(m_vecItems.begin(),m_vecItems.end(), SortByNameLower);
}

void CWndWiki::SortByLevel()
{
	if( m_bUpperCase )
		std::sort(m_vecItems.begin(),m_vecItems.end(), SortByLevelUpper);
	else
		std::sort(m_vecItems.begin(),m_vecItems.end(), SortByLevelLower);
}

void CWndWiki::SortByJob()
{
	if( m_bUpperCase )
		std::sort(m_vecItems.begin(),m_vecItems.end(), SortByJobUpper);
	else
		std::sort(m_vecItems.begin(),m_vecItems.end(), SortByJobLower);
}

void CWndWiki::Sort()
{
	m_pListItems->EnableWindow(FALSE);
	switch( m_cSortType )
	{
	case 0: SortByName(); break;
	case 1: SortByJob(); break;
	case 2: SortByLevel(); break;
	}
	m_pListItems->EnableWindow(TRUE);
}

CWndWikiCreate::CWndWikiCreate()
{
	m_pPropCreate = NULL;
}

BOOL CWndWikiCreate::Initialize(CWndBase *pWndParent, DWORD dwStyle)
{
	return CWndNeuz::InitDialog(g_Neuz.GetSafeHwnd(),APP_WIKICI,WBS_MODAL,0,pWndParent);
}

void CWndWikiCreate::OnInitialUpdate()
{
	CWndNeuz::OnInitialUpdate();

	m_pStcName = (CWndStatic*)GetDlgItem(WIDC_STATIC1);
	m_pDrawCtrl = GetWndCtrl(WIDC_STATIC4);
	m_pEditAmount = (CWndEdit*)GetDlgItem(WIDC_EDIT1);
	m_pEditAmount->AddWndStyle(EBS_NUMBER);
	m_pEditAmount->SetString("1");
	m_pEditName = (CWndEdit*)GetDlgItem(WIDC_EDIT2);

	MoveParentCenter();
}

void CWndWikiCreate::OnDraw(C2DRender *p2DRender)
{
	CWndNeuz::OnDraw(p2DRender);
	if( m_pPropCreate )
	{
		CTexture *pTex = CWndBase::m_textureMng.AddTexture(p2DRender->m_pd3dDevice, MakePath(DIR_ITEM,m_pPropCreate->szIcon), 0xffff00ff);
		if( pTex )
			pTex->Render(p2DRender,CPoint(m_pDrawCtrl->rect.left+6,m_pDrawCtrl->rect.top+6));
	}
}

BOOL CWndWikiCreate::OnChildNotify(UINT message, UINT nID, LRESULT *pLResult)
{
	if( nID == WIDC_BUTTON1 )
	{
		if( m_pPropCreate )
		{
			int nAmount = atoi(m_pEditAmount->GetString());
			if( nAmount > 0 && nAmount < 100 )
			{
				g_DPlay.SendWikiCreateItem(m_pPropCreate,nAmount,m_pEditName->GetString());
				Destroy();
			}
		}
	}else if( nID == WIDC_BUTTON2 )
	{
		Destroy();
	}
	return CWndNeuz::OnChildNotify(message,nID,pLResult);
}

void CWndWikiCreate::OnMouseWndSurface(CPoint point)
{
	if( m_pDrawCtrl->rect.PtInRect(point) )
	{
		if( m_pPropCreate )
		{
			CItemElem itemElem;
			CRect rect = m_pDrawCtrl->rect;
			itemElem.m_dwItemId = m_pPropCreate->dwID;
			ClientToScreen(&point);
			ClientToScreen(&rect);
			g_WndMng.PutToolTip_Item(&itemElem,point,&rect);
		}
	}
}

void CWndWikiCreate::SetItem(ItemProp *pPropCreate)
{
	m_pPropCreate = pPropCreate;
	if( m_pPropCreate )
		m_pStcName->SetTitle(m_pPropCreate->szName);
	else
		m_pStcName->SetTitle("");
}
#endif // __WIKI
iiamevan is offline  
Old 04/18/2020, 08:27   #6
 
Naltalah's Avatar
 
elite*gold: 0
Join Date: Aug 2016
Posts: 308
Received Thanks: 372
Just debug your neuz then and check why it's not opening I guess. Might as well be a bug in your modelviewer. And I do have to ask this, __MODEL_VIEW is defined right?
Naltalah is offline  
Thanks
1 User
Old 04/18/2020, 08:27   #7
 
elite*gold: 0
Join Date: Nov 2019
Posts: 11
Received Thanks: 0
Quote:
Originally Posted by Naltalah View Post
Yeah... really easy to read. Just debug your neuz then and check why it's not opening I guess. Might as well be a bug in your modelviewer. And I do have to ask this, __MODEL_VIEW is defined right?
yes sir it is defined already
iiamevan is offline  
Old 04/18/2020, 08:33   #8
 
Naltalah's Avatar
 
elite*gold: 0
Join Date: Aug 2016
Posts: 308
Received Thanks: 372
Then the only solution is to debug your neuz with breakpoints on the window opening in the Wiki and see why it triggers or doesnt trigger.

If the modelviewer won't open up even tho the code is being executed, there's an error in your modelviewer and you need to debug that. From what you have posted here, everything should work correctly.
But from this point on, it's your task to find the bug.

Might as well check the MSDN about Debugging if you don't know how to do it:
Naltalah is offline  
Thanks
1 User
Old 04/18/2020, 16:55   #9
 
elite*gold: 0
Join Date: Nov 2019
Posts: 11
Received Thanks: 0
Quote:
Originally Posted by Naltalah View Post
Then the only solution is to debug your neuz with breakpoints on the window opening in the Wiki and see why it triggers or doesnt trigger.

If the modelviewer won't open up even tho the code is being executed, there's an error in your modelviewer and you need to debug that. From what you have posted here, everything should work correctly.
But from this point on, it's your task to find the bug.

Might as well check the MSDN about Debugging if you don't know how to do it:
its the same outcome sir
iiamevan is offline  
Reply


Similar Threads Similar Threads
Model Viewer+Item Wiki Problem
06/20/2019 - Flyff Private Server - 7 Replies
So I copied a system which is wiki system which also allows you to view the model of the item when you double click it. https://prnt.sc/l9f6h5 It doesn't show the model sir. Although I already have the files for it. Someone knows how to fix this?
[Private Wiki]Schnelles Wiki für alle
03/26/2015 - Metin2 PServer Advertising - 63 Replies
Heute stelle ich euch mein Projekt "Private Wiki Cloud" vor Für die, die nicht viel lesen wollen direkt einmal ein paar Beispiele: Metin2013 Private Wiki Cloud - Metin2013 Schwarzstahl-Panzer - Metin2013 Sensenmanntruhe - Metin2013 Sensenmann - Metin2013
Model viewer und model dateien finden und in cinema 4d importieren
09/20/2012 - Aion - 1 Replies
Hallo Ich würde gerne mir die Aion Models fuer ein anderes Game nehmen und diese in cinema 4d importieren. Bisher habe ich die .pak datei entpackt und in der dort entstandenen zip datei viele dateien gefunden. Nach suchen bin ich zur erkenntnis gekommen das ie .cgf dateien die model sind (richtig?) MNun weiss ich aber nicht wie ich mir diese anschauen kann und dann in cinema 4d importieren kann. gibt es dafuer irgendein tool?
Wiki: Bearbeitungen in der Wiki geöffnet!
11/27/2011 - Metin2 - 15 Replies
Liebe Spieler! Um euch die Benutzung der Wiki zu vereinfachen, haben wir heute die Bearbeitung für alle User geöffnet. Das heißt, ihr könnt nun die Wiki bearbeiten, ohne euch einen Account anzulegen - einfach nur auf "Bearbeiten" in der jeweiligen Seite klicken! Wir hoffen, dadurch wieder mehr User für die Wiki zu gewinnen und euch die Verwendung zu vereinfachen. :) Dazu sei aber noch gesagt: Wer glaubt, Unsinn treiben zu müssen, indem er Seiten verunstaltet oder falsche Informationen...



All times are GMT +2. The time now is 16:46.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.