Metin2 [C++&PY] Map Name on The Application Window

Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

Vanilla

Elite
Elite
Joined
Jan 28, 2019
Messages
839
Credits
1,190

Expression ;

CLIENT SRC

UserInterface / Locale_inc.h
opens and is inserted into it;
C++:
Expand Collapse Copy
#define ENABLE_MAP_NAME_ON_APP_TITLE // The map name you are in appears in the title section of the exen.


UserInterface / PythonApplicationModule.cpp opens and has the following code;
C++:
Expand Collapse Copy
PyObject* appLoop(PyObject* poSelf, PyObject* poArgs)
It is added to the top;
C++:
Expand Collapse Copy
#if defined(ENABLE_MAP_NAME_ON_APP_TITLE)
PyObject* appSetText(PyObject* poSelf, PyObject* poArgs)
{
    char* szName;
    if (!PyTuple_GetString(poArgs, 0, &szName))
        return Py_BuildException();

    CPythonApplication& rkApp = CPythonApplication::Instance();
    rkApp.SetText(szName);
    return Py_BuildNone();
}
#endif
The following code is found;
C++:
Expand Collapse Copy
 { "Loop", appLoop, METH_VARARGS },
It is added to the top;
C++:
Expand Collapse Copy
#if defined(ENABLE_MAP_NAME_ON_APP_TITLE)
        { "SetText", appSetText, METH_VARARGS },
#endif
The following code is found;
C++:
Expand Collapse Copy
PyModule_AddIntConstant(poModule, "CAMERA_STOP", CPythonApplication::CAMERA_STOP);
Add to the bottom;
C++:
Expand Collapse Copy
#if defined(ENABLE_MAP_NAME_ON_APP_TITLE)
    PyModule_AddIntConstant(poModule, "ENABLE_MAP_NAME_ON_APP_TITLE", 1);
#else
    PyModule_AddIntConstant(poModule, "ENABLE_MAP_NAME_ON_APP_TITLE", 0);
#endif

UserInterface / PythonNetworkStream.cpp opens and the following block of code exists;
C++:
Expand Collapse Copy
bool CPythonNetworkStream::RecvPhasePacket
It is located inside the block of code;
C++:
Expand Collapse Copy
case PHASE_GAME: // °ÔÀÓ È¸é
        SetGamePhase();

It is added to the bottom;
C++:
Expand Collapse Copy
#if defined(ENABLE_MAP_NAME_ON_APP_TITLE)
        PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "SetApplicationText", Py_BuildValue("()"));
#endif
Client / root / game.py opens and contains the following section; // ATTENTION TO TAB SETTINGS !!!
Python:
Expand Collapse Copy
 def StartGame(self):
        self.RefreshInventory()
        self.RefreshEquipment()
        self.RefreshCharacter()
        self.RefreshSkill()

It is added on top;
Python:
Expand Collapse Copy
 if app.ENABLE_MAP_NAME_ON_APP_TITLE:
        def SetApplicationText(self):
            mapName = background.GetCurrentMapName()
            if mapName in localeInfo.MINIMAP_ZONE_NAME_DICT:
                app.SetText(localeInfo.APP_TITLE + " - " + localeInfo.MINIMAP_ZONE_NAME_DICT[mapName])
 
Last edited:
Back
Top