Register for your free account! | Forgot your password?

Go Back   elitepvpers > Popular Games > Silkroad Online > SRO Coding Corner
You last visited: Today at 19:26

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

Advertisement



[WIP] Get SRO Source Code - by re-writing it

Discussion on [WIP] Get SRO Source Code - by re-writing it within the SRO Coding Corner forum part of the Silkroad Online category.

Reply
 
Old 06/10/2020, 16:48   #166
 
b0ykoe's Avatar
 
elite*gold: 72
Join Date: Sep 2011
Posts: 762
Received Thanks: 225
Quote:
Originally Posted by ZeonNETWORK View Post
@
it's not possible yet to unregister/replace a class yet?
for example replace the new underbar with the old one
there is actually a feature for it in it.

here you can find the ressources for the client:

here you can find the ifdefine


and you simply have to add the following code in "source\DevKit_DLL\CMakeLists.txt"

Code:
option(CONFIG_OLD_UNDERBAR "Turn the old EXP Bar ON/OFF" OFF)

if (CONFIG_OLD_UNDERBAR)
    add_definitions(-DCONFIG_OLD_UNDERBAR)
endif()
in the end you can use the cmake compiler flags to turn it off and on
b0ykoe is offline  
Thanks
2 Users
Old 06/10/2020, 18:44   #167
 
elite*gold: 0
Join Date: Feb 2013
Posts: 75
Received Thanks: 10
Quote:
Originally Posted by b0ykoe View Post
there is actually a feature for it in it.

here you can find the ressources for the client:

here you can find the ifdefine


and you simply have to add the following code in "source\DevKit_DLL\CMakeLists.txt"

Code:
option(CONFIG_OLD_UNDERBAR "Turn the old EXP Bar ON/OFF" OFF)

if (CONFIG_OLD_UNDERBAR)
    add_definitions(-DCONFIG_OLD_UNDERBAR)
endif()
in the end you can use the cmake compiler flags to turn it off and on
Thanks but i meant the actual way to replace the example .. there're many examples like for ex item mall

+ the 2dt files still bugged with the coordinates of Pet's controls
+ it doesn't have the control for hide/show pets control so we can't say it's fully functional Old underbar

that's why i'm thinking of override/replace
ZeonNETWORK is offline  
Old 06/11/2020, 01:06   #168
 
elite*gold: 0
Join Date: May 2018
Posts: 244
Received Thanks: 119
Quote:
Originally Posted by ZeonNETWORK View Post
Thanks but i meant the actual way to replace the example .. there're many examples like for ex item mall

+ the 2dt files still bugged with the coordinates of Pet's controls
+ it doesn't have the control for hide/show pets control so we can't say it's fully functional Old underbar

that's why i'm thinking of override/replace
there is already override func
check IFChatViewer

DllMain.cpp
Code:
#ifdef CONFIG_CHATVIEWER
        OverrideObject<CIFChatViewer, 0x00EEC168>();
#endif // CONFIG_CHATVIEWER
Hercules* is offline  
Old 06/28/2020, 10:45   #169
 
elite*gold: 0
Join Date: Nov 2008
Posts: 49
Received Thanks: 1
How can I hide the CIFCloseButton on the ginterface?
How do I ensure that the window I created does not move (i want to cancel draggable)?
hadescik is offline  
Old 06/28/2020, 14:05   #170
 
elite*gold: 100
Join Date: Apr 2008
Posts: 860
Received Thanks: 1,465
Quote:
Originally Posted by hadescik View Post
How can I hide the CIFCloseButton on the ginterface?
How do I ensure that the window I created does not move (i want to cancel draggable)?
The button, the title and the handle-bar are part of CIFMainFrame. You can access the members and call ShowGWnd(false) in the OnCreate function of your own window. When you hide the dragable area, you can't drag the window.

florian0 is offline  
Old 07/08/2020, 21:13   #171
 
elite*gold: 0
Join Date: Nov 2008
Posts: 49
Received Thanks: 1
i tried but i got crash.

m_IRM.GetResObj(2, 1)->ShowGWnd(false);
hadescik is offline  
Old 07/09/2020, 21:33   #172
 
elite*gold: 100
Join Date: Apr 2008
Posts: 860
Received Thanks: 1,465
Quote:
Originally Posted by hadescik View Post
i tried but i got crash.

m_IRM.GetResObj(2, 1)->ShowGWnd(false);
Better use the member of CIFMainFrame

Code:
m_close->ShowGWnd(false);
You have to declare m_close as protected in order to access it.
florian0 is offline  
Old 07/10/2020, 06:41   #173
 
elite*gold: 0
Join Date: Apr 2012
Posts: 263
Received Thanks: 267
can you share src runing on visual studio 2010
i can't make it run on visual studio 2010

who can upload src after build it on vs 2017 or 2015 or 2019?

Quote:
Originally Posted by florian0 View Post
Better use the member of CIFMainFrame

Code:
m_close->ShowGWnd(false);
You have to declare m_close as protected in order to access it.
Quote:
Originally Posted by concucu View Post
Bro. How to fix the position, even if the screen size is changed?
bác share src cho e với , e cài mãi chả được , thử đủ visual 2010-2019 vẫn lỗi
thaidu0ngpr0 is offline  
Old 07/10/2020, 10:46   #174
 
elite*gold: 100
Join Date: Apr 2008
Posts: 860
Received Thanks: 1,465
Quote:
Originally Posted by thaidu0ngpr0 View Post
can you share src runing on visual studio 2010
i can't make it run on visual studio 2010

who can upload src after build it on vs 2017 or 2015 or 2019?
You can use CMake to generate project files for any Visual Studio Version. Just change the make_project_vs2010.cmd. Change Visual Studio 2010 to any of the valid generators listed here:


Sharing generated project files is not a good idea. These are usually generated for a specific configuration. Paths might be hardcoded. CMake might be called during the build process to generate intermediate files. You will also have a really hard time integrating newer versions into your project files.

CMake makes your life easier. Please set up the build environment as described in the documentation:
I made guides with a lot of screenshots. You can follow along every step. Feel free to ask if you got stuck.
florian0 is offline  
Old 07/10/2020, 14:05   #175
 
elite*gold: 0
Join Date: Apr 2012
Posts: 263
Received Thanks: 267
Quote:
Originally Posted by florian0 View Post
You can use CMake to generate project files for any Visual Studio Version. Just change the make_project_vs2010.cmd. Change Visual Studio 2010 to any of the valid generators listed here:


Sharing generated project files is not a good idea. These are usually generated for a specific configuration. Paths might be hardcoded. CMake might be called during the build process to generate intermediate files. You will also have a really hard time integrating newer versions into your project files.

CMake makes your life easier. Please set up the build environment as described in the documentation:
I made guides with a lot of screenshots. You can follow along every step. Feel free to ask if you got stuck.
I tried many different ways but it still didn't work
thaidu0ngpr0 is offline  
Old 07/10/2020, 14:34   #176
 
elite*gold: 100
Join Date: Apr 2008
Posts: 860
Received Thanks: 1,465
Quote:
Originally Posted by thaidu0ngpr0 View Post
I tried many different ways but it still didn't work
Without any hint whats going wrong, I can't help you. So far, everyone who had a problem usually did a mistake during installation. Being it not installing VS2005, ticking the wrong option in the CMake-installer or not using Git for downloading.
If you followed every step as described, please report the error message or (mis-)behavior you get. I'm sure we can get that sorted.
florian0 is offline  
Old 07/11/2020, 04:53   #177
 
elite*gold: 0
Join Date: Apr 2012
Posts: 263
Received Thanks: 267
Quote:
Originally Posted by florian0 View Post
Without any hint whats going wrong, I can't help you. So far, everyone who had a problem usually did a mistake during installation. Being it not installing VS2005, ticking the wrong option in the CMake-installer or not using Git for downloading.
If you followed every step as described, please report the error message or (mis-)behavior you get. I'm sure we can get that sorted.
do you have cmake version support visual studio 2005?
thaidu0ngpr0 is offline  
Old 07/11/2020, 13:02   #178
 
elite*gold: 100
Join Date: Apr 2008
Posts: 860
Received Thanks: 1,465
Quote:
Originally Posted by thaidu0ngpr0 View Post
do you have cmake version support visual studio 2005?
I never thought anybody would, out of the endless options of IDEs to use, actually want to use Visual Studio 2005 ...

There are two ways to accomplish this:

1. Use an older CMake Version. CMake dropped the Visual Studio 2005 generator in 3.12, so any previous version will still have it. BUT! SRO_DevKit depends on 3.12 because it has add_compile_definitions, which makes it easier to add defines to the command line. You have to change all occurrences to add_definitions instead.

florian0 is offline  
Thanks
2 Users
Old 07/20/2020, 19:43   #179
 
elite*gold: 0
Join Date: Nov 2008
Posts: 49
Received Thanks: 1
I want to access the CIFflorian0 object from the outside and apply SetText to the CIFStatic fields inside, but I could not access it from the outside.

How can I access the CIFflorian0 instance from outside?
hadescik is offline  
Old 07/20/2020, 23:44   #180
 
elite*gold: 100
Join Date: Apr 2008
Posts: 860
Received Thanks: 1,465
Quote:
Originally Posted by hadescik View Post
I want to access the CIFflorian0 object from the outside and apply SetText to the CIFStatic fields inside, but I could not access it from the outside.

How can I access the CIFflorian0 instance from outside?
You can get a pointer to the window (and other windows) with m_IRM of CGInterface.

Code:
CIFflorian0 *pWnd = g_pCGInterface->m_IRM.GetResObj<CIFflorian0>(1338, 1);
However, I would recommend to make a function for retrieving the pointer instead of using m_IRM directly.

Code:
CIFflorian0 *pWnd = g_pCGInterface->GetFlorian0Window();
Code:
CIFflorian0 *CGInterface::GetFlorian0Window() {
  return m_IRM.GetResObj<CIFflorian0>(1338, 1);
}
Now you have a pointer to the window and you can access all the members of the window with it.

You can get a pointer to the controls with m_IRM of the Window.

Code:
CIFflorian0 *pWnd = g_pCGInterface->GetFlorian0Window();

CIFStatic *pLabel = pWnd->m_IRM.GetResObj<CIFStatic>(1234, 1);
pLabel->SetText(L"Hello World");
However, I would recommend hiding this functionality inside another function so the code stays readable.

Code:
CIFflorian0 *pWnd = g_pCGInterface->GetFlorian0Window();

pWnd->SetLabelText(L"Hello World");
Code:
void CIFflorian0::SetLabelText(const wchar_t *text) {
  m_IRM.GetResObj<CIFStatic>(1234, 1)->SetText(text);
}
If you're using the controls on the window frequently, you can save time by storing the pointer to the control in the class instead of calling GetResObj every time. An example can be found here:
florian0 is offline  
Reply

Tags
ussless


Similar Threads Similar Threads
[Source] Fix the old exp bar - by writing code!
05/17/2020 - SRO PServer Guides & Releases - 18 Replies
Hello beloved, dead community, its time for another release. Its more of a proof of concept and I hope it might inspire people to continue working on it. You don't need the source to accomplish cool things. Just write your own source. http://i.epvpimg.com/d7hJbab.png Ye, its super ugly looking. I choose to be a coder, not a designer. I'd be happy, if someone supplies me a proper version of the 2dt and ddj files so I can update this embarrassing screenshot. Anyway. It allows you to...
[Release/WIP]EP6 Source code
04/15/2018 - Shaiya PServer Guides & Releases - 33 Replies
Hi guys, First of all, I want to say that this release is not recommended for public servers yet. Shortly ago I changed my server to ep6 using shen1l's pet.dll, the server crashed every day, after checking the dump files I discovered that the problem was in pet.dll, but without the source code it would be harder to find the cause of the problem. So I decided to start a project and release the source code for everyone, so that everyone can solve their problems more easily, and also so that...
[C++ Source] My Free Farm Bot [WIP]
06/28/2011 - Browsergames - 0 Replies
I decided to release this on here as i have no more use for it and no intention to continue the project. I am releasing 2 projects: One basic library for mff called libmff(although it is not really a library) there is an example on how to use it in the package. And a helper with a fancy gui. Note that there is almost no error checking on the helper and that it crashes if you for example forget to select a product. You need libcurl and boost for both and GWEN(the gui toolkit by garry) for...



All times are GMT +2. The time now is 19:26.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

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