Quaftar

Moderatör
Moderatör
Premium Üye
Geliştirici
Yardımsever Üye
Editör
Mesaj
735
Çözümler
55
Beğeni
1.380
Puan
1.179
Ticaret Puanı
0
:mmt-videolar:
Honeycam-2021-03-26-23-04-52.gif

Client/UserInterface/InstanceBaseEffect.cpp:
bul:
void CInstanceBase::UpdateTextTailLevel(DWORD level)

değiştir:
void CInstanceBase::UpdateTextTailLevel(DWORD level)
{
#ifdef ENABLE_LEVEL_SHOW_HIDE
    static D3DXCOLOR s_kPlayerLevelColor = D3DXCOLOR(152.0f/255.0f, 255.0f/255.0f, 51.0f/255.0f, 1.0f);
    static D3DXCOLOR s_kMobLevelColor = D3DXCOLOR(119.0f/255.0f, 246.0f/255.0f, 168.0f/255.0f, 1.0f);
#endif

    char szText[256];
    sprintf(szText, "Lv %d ", level);
#ifdef ENABLE_LEVEL_SHOW_HIDE
    if (IsPC())
        CPythonTextTail::Instance().AttachLevel(GetVirtualID(), szText, s_kPlayerLevelColor);
    else if (IsEnemy() || IsStone())
        CPythonTextTail::Instance().AttachLevel(GetVirtualID(), szText, s_kMobLevelColor);
    else
        CPythonTextTail::Instance().DetachLevel(GetVirtualID());
#else
    CPythonTextTail::Instance().AttachLevel(GetVirtualID(), szText, s_kPlayerLevelColor);
#endif
}
Client/UserInterface/Locale_inc.h:
ekle:
#define ENABLE_LEVEL_SHOW_HIDE
Client/UserInterface/Packet.h:
bul.
typedef struct packet_add_char

    DWORD    dwVID;

altına ekle:
#ifdef ENABLE_LEVEL_SHOW_HIDE
    DWORD    dwLevel;
#endif
Client/UserInterface/PythonNetworkStreamPhaseGameActor.cpp:
bul:
    kNetActorData.m_dwLevel = 0; // 몬스터 레벨 표시 안함

de?tir:

#ifdef ENABLE_LEVEL_SHOW_HIDE
    kNetActorData.m_dwLevel = chrAddPacket.dwLevel;
#else
    kNetActorData.m_dwLevel = 0; // 몬스터 레벨 표시 안함
#endif
Client/UserInterface/PythonSystem.cpp:
bul:

m_Config.bShowSalesText        = true;

altına ekle:

#ifdef ENABLE_LEVEL_SHOW_HIDE
    m_Config.bShowLevel            = true;
#endif

bul:

bool CPythonSystem::IsAutoTiling()

altına ekle:

#ifdef ENABLE_LEVEL_SHOW_HIDE
bool CPythonSystem::IsShowLevel()
{
    return m_Config.bShowLevel;
}

void CPythonSystem::SetShowLevelFlag(int iFlag)
{
    m_Config.bShowLevel = iFlag == 1 ? true : false;
}
#endif

bul:

        else if (!stricmp(command, "SHOW_SALESTEXT"))
            m_Config.bShowSalesText = atoi(value) == 1 ? true : false;

altına ekle:

#ifdef ENABLE_LEVEL_SHOW_HIDE
        else if (!stricmp(command, "SHOW_LEVEL"))
            m_Config.bShowLevel = atoi(value) == 1 ? true : false;
#endif

bul:
    if (m_Config.bShowSalesText == 0)
        fprintf(fp, "SHOW_SALESTEXT        %d\n", m_Config.bShowSalesText);
altına ekle:

#ifdef ENABLE_LEVEL_SHOW_HIDE
    fprintf(fp, "SHOW_LEVEL            %d\n", m_Config.bShowLevel);
#endif
Client/UserInterface/PythonSystem.h:
bul:

            bool            bShowSalesText;
altına ekle:
#ifdef ENABLE_LEVEL_SHOW_HIDE
            bool            bShowLevel;
#endif

bul:
        void                            SetShowSalesTextFlag(int iFlag);
altına ekle:
#ifdef ENABLE_LEVEL_SHOW_HIDE
        bool                            IsShowLevel();
        void                            SetShowLevelFlag(int iFlag);
#endif
Client/UserInterface/PythonSystemModule.cpp:
bul:

PyObject * systemIsShowSalesText(PyObject * poSelf, PyObject * poArgs)

altına ekle:
#ifdef ENABLE_LEVEL_SHOW_HIDE
PyObject * systemSetShowLevel(PyObject * poSelf, PyObject * poArgs)
{
    int iFlag;
    if (!PyTuple_GetInteger(poArgs, 0, &iFlag))
        return Py_BuildException();
    
    CPythonSystem::Instance().SetShowLevelFlag(iFlag);
    
    return Py_BuildNone();
}

PyObject * systemIsShowLevel(PyObject * poSelf, PyObject * poArgs)
{
    return Py_BuildValue("i", CPythonSystem::Instance().IsShowLevel());
}
#endif

bul:

        { "IsShowSalesText",            systemIsShowSalesText,            METH_VARARGS },

altına ekle:

#ifdef ENABLE_LEVEL_SHOW_HIDE
        { "IsShowLevel",                systemIsShowLevel,                METH_VARARGS },
        { "SetShowLevelFlag",            systemSetShowLevel,                METH_VARARGS },
#endif
Client/UserInterface/PythonTextTail.cpp:
ekle:
#include "PythonSystem.h"

bul:

değiştir

void CPythonTextTail::Render()
{
    TTextTailList::iterator itor;

    for (itor = m_CharacterTextTailList.begin(); itor != m_CharacterTextTailList.end(); ++itor)
    {
        TTextTail * pTextTail = *itor;
        pTextTail->pTextInstance->Render();
        if (pTextTail->pMarkInstance && pTextTail->pGuildNameTextInstance)
        {
            pTextTail->pMarkInstance->Render();
            pTextTail->pGuildNameTextInstance->Render();
        }
        if (pTextTail->pTitleTextInstance)
        {
            pTextTail->pTitleTextInstance->Render();
        }
#ifdef ENABLE_LEVEL_SHOW_HIDE
        if (pTextTail->pLevelTextInstance && (pTextTail->bIsPC == TRUE && CPythonSystem::Instance().IsShowLevel()))
#else
        if (pTextTail->pLevelTextInstance)
#endif
        {
            pTextTail->pLevelTextInstance->Render();
        }
    }

    for (itor = m_ItemTextTailList.begin(); itor != m_ItemTextTailList.end(); ++itor)
    {
        TTextTail * pTextTail = *itor;

        RenderTextTailBox(pTextTail);
        pTextTail->pTextInstance->Render();
        if (pTextTail->pOwnerTextInstance)
            pTextTail->pOwnerTextInstance->Render();
    }

    for (TChatTailMap::iterator itorChat = m_ChatTailMap.begin(); itorChat!=m_ChatTailMap.end(); ++itorChat)
    {
        TTextTail * pTextTail = itorChat->second;
        if (pTextTail->pOwner->isShow())
            RenderTextTailName(pTextTail);
    }
}

bul:
    m_CharacterTextTailMap.insert(TTextTailMap::value_type(dwVirtualID, pTextTail));

altına ekle.
#ifdef ENABLE_LEVEL_SHOW_HIDE
    pTextTail->bIsPC = pCharacterInstance->IsPC() != FALSE;
#endif
Client/UserInterface/PythonTextTail.h:
bul:
            float                            fHeight;

altına ekle:
#ifdef ENABLE_LEVEL_SHOW_HIDE
            BOOL                            bIsPC;
#endif

Root/uisystemoption.py:
import dbg
import ui
import snd
import systemSetting
import net
import chat
import app
import localeInfo
import constInfo
import chrmgr
import player
import musicInfo
import os
import uiPrivateShopBuilder
import interfaceModule

import uiSelectMusic
import background

MUSIC_FILENAME_MAX_LEN = 25

blockMode = 0

class PopupDialog(ui.ScriptWindow):
    def __init__(self, parent):
        print "PopupDialog::PopupDialog()"
        ui.ScriptWindow.__init__(self)

        self.__Load()
        self.__Bind()

    def __del__(self):
        ui.ScriptWindow.__del__(self)
        print "PopupDialog::~PopupDialog()"

    def __Load(self):
        try:
            pyScrLoader = ui.PythonScriptLoader()
            pyScrLoader.LoadScriptFile(self, "UIScript/PopupDialog.py")
        except:
            import exception
            exception.Abort("PopupDialog.__Load")

    def __Bind(self):
        try:
            self.textLine=self.GetChild("message")
            self.okButton=self.GetChild("accept")
        except:
            import exception
            exception.Abort("PopupDialog.__Bind")

        self.okButton.SAFE_SetEvent(self.__OnOK)

    def Open(self, msg):
        self.textLine.SetText(msg)
        self.SetCenterPosition()
        self.Show()
        self.SetTop()

    def __OnOK(self):
        self.Hide()

class OptionDialog(ui.ScriptWindow):

    def __init__(self):
        ui.ScriptWindow.__init__(self)
        self.__Initialize()
        self.__Load()
        self.RefreshShowLevel()

    def __del__(self):
        ui.ScriptWindow.__del__(self)
        print " -------------------------------------- DELETE SYSTEM OPTION DIALOG"

    def __Initialize(self):
        self.tilingMode = 0
        self.titleBar = 0
        self.changeMusicButton = 0
        self.selectMusicFile = 0
        self.ctrlMusicVolume = 0
        self.ctrlSoundVolume = 0
        self.musicListDlg = 0
        self.tilingApplyButton = 0
        self.cameraModeButtonList = []
        self.fogModeButtonList = []
        self.tilingModeButtonList = []
        self.fonttypeButtonList = []
        self.nightModeOptionButtonList = []
        self.texturesOptionButtonList = []
        self.showLevelButtonList = []
        self.ctrlShadowQuality = 0
        
    def Destroy(self):
        self.ClearDictionary()

        self.__Initialize()
        print " -------------------------------------- DESTROY SYSTEM OPTION DIALOG"

    def __Load_LoadScript(self, fileName):
        try:
            pyScriptLoader = ui.PythonScriptLoader()
            pyScriptLoader.LoadScriptFile(self, fileName)
        except:
            import exception
            exception.Abort("System.OptionDialog.__Load_LoadScript")

    def __Load_BindObject(self):
        try:
            GetObject = self.GetChild
            self.titleBar = GetObject("titlebar")
            self.selectMusicFile = GetObject("bgm_file")
            self.changeMusicButton = GetObject("bgm_button")
            self.ctrlMusicVolume = GetObject("music_volume_controller")
            self.ctrlSoundVolume = GetObject("sound_volume_controller")            
            self.cameraModeButtonList.append(GetObject("camera_short"))
            self.cameraModeButtonList.append(GetObject("camera_long"))
            self.cameraModeButtonList.append(GetObject("camera_uzak"))
            self.fogModeButtonList.append(GetObject("fog_level0"))
            self.fogModeButtonList.append(GetObject("fog_level1"))
            self.fogModeButtonList.append(GetObject("fog_level2"))
            self.tilingModeButtonList.append(GetObject("tiling_cpu"))
            self.tilingModeButtonList.append(GetObject("tiling_gpu"))
            self.tilingApplyButton=GetObject("tiling_apply")
            self.fonttypeButtonList.append(GetObject("font_type_arial"))
            self.fonttypeButtonList.append(GetObject("font_type_tahoma"))
            self.fonttypeButtonList.append(GetObject("font_type_geneva"))
            self.nightModeOptionButtonList.append(GetObject("night_on"))
            self.nightModeOptionButtonList.append(GetObject("night_off"))
            self.texturesOptionButtonList.append(GetObject("texture_classic"))
            self.texturesOptionButtonList.append(GetObject("texture_snow"))
            self.texturesOptionButtonList.append(GetObject("texture_desert"))
            self.texturesOptionButtonList.append(GetObject("texture_green"))
            self.showLevelButtonList.append(GetObject("showlevel_on_button"))
            self.showLevelButtonList.append(GetObject("showlevel_off_button"))
            self.ctrlShadowQuality = GetObject("shadow_bar")
            self.ctrlShopNamesRange = GetObject("salestext_range_controller")
        except:
            import exception
            exception.Abort("OptionDialog.__Load_BindObject")

    def __Load(self):
        self.__Load_LoadScript("uiscript/systemoptiondialog.py")
        self.__Load_BindObject()

        self.SetCenterPosition()
        
        self.popupDialog = PopupDialog(self)
        
        self.titleBar.SetCloseEvent(ui.__mem_func__(self.Close))

        self.ctrlMusicVolume.SetSliderPos(float(systemSetting.GetMusicVolume()))
        self.ctrlMusicVolume.SetEvent(ui.__mem_func__(self.OnChangeMusicVolume))

        self.ctrlSoundVolume.SetSliderPos(float(systemSetting.GetSoundVolume()) / 5.0)
        self.ctrlSoundVolume.SetEvent(ui.__mem_func__(self.OnChangeSoundVolume))

        self.ctrlShadowQuality.SetSliderPos(float(systemSetting.GetShadowLevel()) / 5.0)
        self.ctrlShadowQuality.SetEvent(ui.__mem_func__(self.OnChangeShadowQuality))

        self.ctrlShopNamesRange.SetSliderPos(float(uiPrivateShopBuilder.GetShopNamesRange()))
        self.ctrlShopNamesRange.SetEvent(ui.__mem_func__(self.OnChangeShopNamesRange))

        self.changeMusicButton.SAFE_SetEvent(self.__OnClickChangeMusicButton)

        self.cameraModeButtonList[0].SAFE_SetEvent(self.__OnClickCameraModeShortButton)
        self.cameraModeButtonList[1].SAFE_SetEvent(self.__OnClickCameraModeLongButton)
        self.cameraModeButtonList[2].SAFE_SetEvent(self.__OnClickCameraModeUzakButton)

        self.fogModeButtonList[0].SAFE_SetEvent(self.__OnClickFogModeLevel0Button)
        self.fogModeButtonList[1].SAFE_SetEvent(self.__OnClickFogModeLevel1Button)
        self.fogModeButtonList[2].SAFE_SetEvent(self.__OnClickFogModeLevel2Button)

        self.tilingModeButtonList[0].SAFE_SetEvent(self.__OnClickTilingModeCPUButton)
        self.tilingModeButtonList[1].SAFE_SetEvent(self.__OnClickTilingModeGPUButton)

        self.fonttypeButtonList[0].SAFE_SetEvent(self.__OnClickArialButton)
        self.fonttypeButtonList[1].SAFE_SetEvent(self.__OnClickTahomaButton)
        self.fonttypeButtonList[2].SAFE_SetEvent(self.__OnClickGenevaButton)

        self.nightModeOptionButtonList[0].SAFE_SetEvent(self.__OnClickNightModeOptionEnableButton)
        self.nightModeOptionButtonList[1].SAFE_SetEvent(self.__OnClickNightModeOptionDisableButton)

        self.texturesOptionButtonList[0].SAFE_SetEvent(self.__OnClickChangeTextureClassic)
        self.texturesOptionButtonList[1].SAFE_SetEvent(self.__OnClickChangeTextureSnow)
        self.texturesOptionButtonList[2].SAFE_SetEvent(self.__OnClickChangeTextureDesert)
        self.texturesOptionButtonList[3].SAFE_SetEvent(self.__OnClickChangeTextureGreen)

        self.showLevelButtonList[0].SAFE_SetEvent(self.__OnClickShowLevelOnButton)
        self.showLevelButtonList[1].SAFE_SetEvent(self.__OnClickShowLevelOffButton)

        self.tilingApplyButton.SAFE_SetEvent(self.__OnClickTilingApplyButton)

        self.__SetCurTilingMode()

        self.__ClickRadioButton(self.fogModeButtonList, constInfo.GET_FOG_LEVEL_INDEX())
        self.__ClickRadioButton(self.cameraModeButtonList, constInfo.GET_CAMERA_MAX_DISTANCE_INDEX())

        if os.path.exists("gameoption.cfg"):
            fd = open( "gameoption.cfg" , "r")
            fonttype = fd.readline()
            fd.close()
            if fonttype == "0":
                self.__ClickRadioButton(self.fonttypeButtonList, 0)
            elif fonttype == "1":
                self.__ClickRadioButton(self.fonttypeButtonList, 1)
            elif fonttype == "2":
                self.__ClickRadioButton(self.fonttypeButtonList, 2)
        else:
            self.__ClickRadioButton(self.fonttypeButtonList, 0)

        if musicInfo.fieldMusic==musicInfo.METIN2THEMA:
            self.selectMusicFile.SetText(uiSelectMusic.DEFAULT_THEMA)
        else:
            self.selectMusicFile.SetText(musicInfo.fieldMusic[:MUSIC_FILENAME_MAX_LEN])

    def OnChangeShopNamesRange(self):
        pos = self.ctrlShopNamesRange.GetSliderPos()
        uiPrivateShopBuilder.SetShopNamesRange(pos)
        if systemSetting.IsShowSalesText():
            uiPrivateShopBuilder.UpdateADBoard()

    def __OnClickTilingModeCPUButton(self):
        self.__NotifyChatLine(localeInfo.SYSTEM_OPTION_CPU_TILING_1)
        self.__NotifyChatLine(localeInfo.SYSTEM_OPTION_CPU_TILING_2)
        self.__NotifyChatLine(localeInfo.SYSTEM_OPTION_CPU_TILING_3)
        self.__SetTilingMode(0)

    def __OnClickTilingModeGPUButton(self):
        self.__NotifyChatLine(localeInfo.SYSTEM_OPTION_GPU_TILING_1)
        self.__NotifyChatLine(localeInfo.SYSTEM_OPTION_GPU_TILING_2)
        self.__NotifyChatLine(localeInfo.SYSTEM_OPTION_GPU_TILING_3)
        self.__SetTilingMode(1)

    def __OnClickTilingApplyButton(self):
        self.__NotifyChatLine(localeInfo.SYSTEM_OPTION_TILING_EXIT)
        if 0==self.tilingMode:
            background.EnableSoftwareTiling(1)
        else:
            background.EnableSoftwareTiling(0)

        net.ExitGame()

    def __OnClickChangeMusicButton(self):
        if not self.musicListDlg:
            
            self.musicListDlg=uiSelectMusic.FileListDialog()
            self.musicListDlg.SAFE_SetSelectEvent(self.__OnChangeMusic)

        self.musicListDlg.Open()

        
    def __ClickRadioButton(self, buttonList, buttonIndex):
        try:
            selButton=buttonList[buttonIndex]
        except IndexError:
            return

        for eachButton in buttonList:
            eachButton.SetUp()

        selButton.Down()


    def __SetTilingMode(self, index):
        self.__ClickRadioButton(self.tilingModeButtonList, index)
        self.tilingMode=index

    def __SetCameraMode(self, index):
        constInfo.SET_CAMERA_MAX_DISTANCE_INDEX(index)
        self.__ClickRadioButton(self.cameraModeButtonList, index)

    def __SetFogLevel(self, index):
        constInfo.SET_FOG_LEVEL_INDEX(index)
        self.__ClickRadioButton(self.fogModeButtonList, index)

    def __OnClickCameraModeShortButton(self):
        self.__SetCameraMode(0)

    def __OnClickCameraModeLongButton(self):
        self.__SetCameraMode(1)

    def __OnClickCameraModeUzakButton(self):
        self.__SetCameraMode(2)

    def __OnClickFogModeLevel0Button(self):
        self.__SetFogLevel(0)

    def __OnClickFogModeLevel1Button(self):
        self.__SetFogLevel(1)

    def __OnClickFogModeLevel2Button(self):
        self.__SetFogLevel(2)

    def __OnChangeMusic(self, fileName):
        self.selectMusicFile.SetText(fileName[:MUSIC_FILENAME_MAX_LEN])

        if musicInfo.fieldMusic != "":
            snd.FadeOutMusic("BGM/"+ musicInfo.fieldMusic)

        if fileName==uiSelectMusic.DEFAULT_THEMA:
            musicInfo.fieldMusic=musicInfo.METIN2THEMA
        else:
            musicInfo.fieldMusic=fileName

        musicInfo.SaveLastPlayFieldMusic()
        
        if musicInfo.fieldMusic != "":
            snd.FadeInMusic("BGM/" + musicInfo.fieldMusic)

    def OnChangeMusicVolume(self):
        pos = self.ctrlMusicVolume.GetSliderPos()
        snd.SetMusicVolume(pos * net.GetFieldMusicVolume())
        systemSetting.SetMusicVolume(pos)

    def OnChangeSoundVolume(self):
        pos = self.ctrlSoundVolume.GetSliderPos()
        snd.SetSoundVolumef(pos)
        systemSetting.SetSoundVolumef(pos)

    def OnChangeShadowQuality(self):
        pos = self.ctrlShadowQuality.GetSliderPos()
        systemSetting.SetShadowLevel(int(pos / 0.2))

    def __OnClickArialButton(self):
        if os.path.exists("gameoption.cfg"):
            os.remove("gameoption.cfg")
        f = open( "gameoption.cfg", "w")
        f.write("0")
        f.close()
        self.popupDialog.Open(localeInfo.LANG_RESTART_FOR_CHANGE)
        self.__ClickRadioButton(self.fonttypeButtonList, 0)
        
    def __OnClickTahomaButton(self):
        if os.path.exists("gameoption.cfg"):
            os.remove("gameoption.cfg")
        f = open( "gameoption.cfg", "w")
        f.write("1")
        f.close()
        self.popupDialog.Open(localeInfo.LANG_RESTART_FOR_CHANGE)
        self.__ClickRadioButton(self.fonttypeButtonList, 1)
        
    def __OnClickGenevaButton(self):
        if os.path.exists("gameoption.cfg"):
            os.remove("gameoption.cfg")
        f = open( "gameoption.cfg", "w")
        f.write("2")
        f.close()
        self.popupDialog.Open(localeInfo.LANG_RESTART_FOR_CHANGE)
        self.__ClickRadioButton(self.fonttypeButtonList, 2)

    def __OnClickNightModeOptionEnableButton(self):
        systemSetting.SetNightMode(True)
        background.RegisterEnvironmentData(1, constInfo.ENVIRONMENT_NIGHT)
        background.SetEnvironmentData(1)
        self.RefreshNightOption()
        
    def __OnClickNightModeOptionDisableButton(self):
        systemSetting.SetNightMode(False)
        background.SetEnvironmentData(0)
        self.RefreshNightOption()
        
    def RefreshNightOption(self):
        if systemSetting.GetNightMode():
            self.nightModeOptionButtonList[0].Down()
            self.nightModeOptionButtonList[1].SetUp()
        else:
            self.nightModeOptionButtonList[0].SetUp()
            self.nightModeOptionButtonList[1].Down()

    def __OnClickChangeTextureClassic(self):
        systemSetting.SetSnowTexturesMode(False)
        systemSetting.SetDesertTexturesMode(False)
        systemSetting.SetGreenTexturesMode(False)
        self.RefreshTextures()
        if background.GetCurrentMapName():
            classic_maps = [
                "metin2_map_a1",
                "metin2_map_b1",
                "metin2_map_c1"
            ]
            classic_map_textures = {
                "metin2_map_a1" : "textureset\metin2_a1.txt",
                "metin2_map_b1" : "textureset\metin2_b1.txt",
                "metin2_map_c1" : "textureset\metin2_c1.txt", }
            if str(background.GetCurrentMapName()) in classic_maps:
                background.TextureChange(classic_map_textures[str(background.GetCurrentMapName())])

    def __OnClickChangeTextureSnow(self):
        systemSetting.SetSnowTexturesMode(True)
        systemSetting.SetDesertTexturesMode(False)
        systemSetting.SetGreenTexturesMode(False)
        self.RefreshTextures()
        if background.GetCurrentMapName():
            snow_maps = [
                "metin2_map_a1",
                "metin2_map_b1",
                "metin2_map_c1"
            ]
            snow_maps_textures = {
                "metin2_map_a1" : "textureset\metin2_a1_snown.txt",
                "metin2_map_b1" : "textureset\metin2_b1_snown.txt",
                "metin2_map_c1" : "textureset\metin2_c1_snown.txt", }
            if str(background.GetCurrentMapName()) in snow_maps:
                background.TextureChange(snow_maps_textures[str(background.GetCurrentMapName())])

    def __OnClickChangeTextureDesert(self):
        systemSetting.SetSnowTexturesMode(False)
        systemSetting.SetDesertTexturesMode(True)
        systemSetting.SetGreenTexturesMode(False)
        self.RefreshTextures()
        if background.GetCurrentMapName():
            desert_maps = [
                "metin2_map_a1",
                "metin2_map_b1",
                "metin2_map_c1"
            ]
            desert_maps_textures = {
                "metin2_map_a1" : "textureset\metin2_a1_desert.txt",
                "metin2_map_b1" : "textureset\metin2_b1_desert.txt",
                "metin2_map_c1" : "textureset\metin2_c1_desert.txt", }
            if str(background.GetCurrentMapName()) in desert_maps:
                background.TextureChange(desert_maps_textures[str(background.GetCurrentMapName())])        

    def __OnClickChangeTextureGreen(self):
        systemSetting.SetSnowTexturesMode(False)
        systemSetting.SetDesertTexturesMode(False)
        systemSetting.SetGreenTexturesMode(True)
        self.RefreshTextures()
        if background.GetCurrentMapName():
            green_maps = [
                "metin2_map_a1",
                "metin2_map_b1",
                "metin2_map_c1"
            ]
            green_maps_textures = {
                "metin2_map_a1" : "textureset\metin2_a1_green.txt",
                "metin2_map_b1" : "textureset\metin2_b1_green.txt",
                "metin2_map_c1" : "textureset\metin2_c1_green.txt", }
            if str(background.GetCurrentMapName()) in green_maps:
                background.TextureChange(green_maps_textures[str(background.GetCurrentMapName())])        
    
    def RefreshTextures(self):
        if systemSetting.IsSnowTexturesMode():
            self.texturesOptionButtonList[0].SetUp()
            self.texturesOptionButtonList[1].Down()
            self.texturesOptionButtonList[2].SetUp()
            self.texturesOptionButtonList[3].SetUp()
        elif systemSetting.IsDesertTexturesMode():
            self.texturesOptionButtonList[0].SetUp()
            self.texturesOptionButtonList[1].SetUp()
            self.texturesOptionButtonList[2].Down()
            self.texturesOptionButtonList[3].SetUp()
        elif systemSetting.IsGreenTexturesMode():
            self.texturesOptionButtonList[0].SetUp()
            self.texturesOptionButtonList[1].SetUp()
            self.texturesOptionButtonList[2].SetUp()
            self.texturesOptionButtonList[3].Down()
        else:
            self.texturesOptionButtonList[0].Down()
            self.texturesOptionButtonList[1].SetUp()
            self.texturesOptionButtonList[2].SetUp()
            self.texturesOptionButtonList[3].SetUp()
            

    def __OnClickShowLevelOnButton(self):
        systemSetting.SetShowLevelFlag(True)
        self.RefreshShowLevel()
        
    def __OnClickShowLevelOffButton(self):
        systemSetting.SetShowLevelFlag(False)
        self.RefreshShowLevel()
        

    def RefreshShowLevel(self):
        if systemSetting.IsShowLevel():
            self.showLevelButtonList[0].Down()
            self.showLevelButtonList[1].SetUp()
        else:
            self.showLevelButtonList[0].SetUp()
            self.showLevelButtonList[1].Down()
            

    def OnCloseInputDialog(self):
        self.inputDialog.Close()
        self.inputDialog = None
        return True

    def OnCloseQuestionDialog(self):
        self.questionDialog.Close()
        self.questionDialog = None
        return True

    def OnPressEscapeKey(self):
        self.Close()
        return True
    
    def Show(self):
        ui.ScriptWindow.Show(self)

    def Close(self):
        self.__SetCurTilingMode()
        self.Hide()

    def __SetCurTilingMode(self):
        if background.IsSoftwareTiling():
            self.__SetTilingMode(0)
        else:
            self.__SetTilingMode(1)    

    def __NotifyChatLine(self, text):
        chat.AppendChat(chat.CHAT_TYPE_INFO, text)

Server/common/service.h:
ekle:
#define ENABLE_LEVEL_SHOW_HIDE
Server/game/building.cpp:
bul:
    pack.dwVID          = m_dwVID;

altına ekle:
#ifdef ENABLE_LEVEL_SHOW_HIDE
    pack.dwLevel        = 0;
#endif
Server/game/char.cpp:
bul:
    pack.dwVID        = m_vid;

altına ekle:
#ifdef ENABLE_LEVEL_SHOW_HIDE
    if (IsPC())
    {
        pack.dwLevel    = GetLevel();
    }
    else
    {
        pack.dwLevel    = 0;
    }
#endif
Server/game/packet.h:
bul.
typedef struct packet_add_char

    DWORD    dwVID;

altına ekle:
#ifdef ENABLE_LEVEL_SHOW_HIDE
    DWORD    dwLevel;
#endif

Uiscript/systemoptiondialog.py:
import uiScriptLocale

ROOT_PATH = "d:/ymir work/ui/public/"

TEMPORARY_X = +13
TEXT_TEMPORARY_X = -10
BUTTON_TEMPORARY_X = 5
PVP_X = -10

window = {
    "name" : "SystemOptionDialog",
    "style" : ("movable", "float",),

    "x" : 0,
    "y" : 0,

    "width" : 297,
    "height" : 400,

    "children" :
    (
        {
            "name" : "board",
            "type" : "board",

            "x" : 0,
            "y" : 0,

            "width" : 297,
            "height" : 400,

            "children" :
            (
                ## Title
                {
                    "name" : "titlebar",
                    "type" : "titlebar",
                    "style" : ("attach",),

                    "x" : 8,
                    "y" : 8,

                    "width" : 284,
                    "color" : "gray",

                    "children" :
                    (
                        { 
                        "name":"titlename", "type":"text", "x":0, "y":3, 
                        "horizontal_align":"center", "text_horizontal_align":"center",
                        "text": uiScriptLocale.SYSTEMOPTION_TITLE, 
                         },
                    ),
                },

                
                ## Music
                {
                    "name" : "music_name",
                    "type" : "text",

                    "x" : 30,
                    "y" : 75,

                    "text" : uiScriptLocale.OPTION_MUSIC,
                },
                
                {
                    "name" : "music_volume_controller",
                    "type" : "sliderbar",

                    "x" : 110,
                    "y" : 75,
                },
                
                {
                    "name" : "bgm_button",
                    "type" : "button",

                    "x" : 25,
                    "y" : 152,

                    "text" : uiScriptLocale.OPTION_MUSIC_CHANGE,

                    "default_image" : ROOT_PATH + "Middle_Button_01.sub",
                    "over_image" : ROOT_PATH + "Middle_Button_02.sub",
                    "down_image" : ROOT_PATH + "Middle_Button_03.sub",
                },
                
                {
                    "name" : "bgm_file",
                    "type" : "text",

                    "x" : 110,
                    "y" : 152,

                    "text" : uiScriptLocale.OPTION_MUSIC_DEFAULT_THEMA,
                },
                
                ## Sound
                {
                    "name" : "sound_name",
                    "type" : "text",

                    "x" : 30,
                    "y" : 50,

                    "text" : uiScriptLocale.OPTION_SOUND,
                },
                
                {
                    "name" : "sound_volume_controller",
                    "type" : "sliderbar",

                    "x" : 110,
                    "y" : 50,
                },    
                ## 카메라
                {
                    "name" : "camera_mode",
                    "type" : "text",

                    "x" : 40 + TEXT_TEMPORARY_X,
                    "y" : 182,

                    "text" : uiScriptLocale.OPTION_CAMERA_DISTANCE,
                },
                
                {
                    "name" : "camera_short",
                    "type" : "radio_button",

                    "x" : 110,
                    "y" : 182,

                    "text" : uiScriptLocale.OPTION_CAMERA_DISTANCE_SHORT,

                    "default_image" : ROOT_PATH + "Small_Button_01.sub",
                    "over_image" : ROOT_PATH + "Small_Button_02.sub",
                    "down_image" : ROOT_PATH + "Small_Button_03.sub",
                },
                
                {
                    "name" : "camera_long",
                    "type" : "radio_button",

                    "x" : 110+50,
                    "y" : 182,

                    "text" : uiScriptLocale.OPTION_CAMERA_DISTANCE_LONG,

                    "default_image" : ROOT_PATH + "Small_Button_01.sub",
                    "over_image" : ROOT_PATH + "Small_Button_02.sub",
                    "down_image" : ROOT_PATH + "Small_Button_03.sub",
                },
                {
                    "name" : "camera_uzak",
                    "type" : "radio_button",


                    "x" : 110+100,
                    "y" : 182,


                    "text" : uiScriptLocale.OPTION_CAMERA_DISTANCE_UZAK,


                    "default_image" : ROOT_PATH + "Small_Button_01.sub",
                    "over_image" : ROOT_PATH + "Small_Button_02.sub",
                    "down_image" : ROOT_PATH + "Small_Button_03.sub",
                },

                ## 안개
                {
                    "name" : "fog_mode",
                    "type" : "text",

                    "x" : 30,
                    "y" : 212,

                    "text" : uiScriptLocale.OPTION_FOG,
                },
                
                {
                    "name" : "fog_level0",
                    "type" : "radio_button",

                    "x" : 110,
                    "y" : 212,

                    "text" : uiScriptLocale.OPTION_FOG_DENSE,

                    "default_image" : ROOT_PATH + "small_Button_01.sub",
                    "over_image" : ROOT_PATH + "small_Button_02.sub",
                    "down_image" : ROOT_PATH + "small_Button_03.sub",
                },
                
                {
                    "name" : "fog_level1",
                    "type" : "radio_button",

                    "x" : 110+50,
                    "y" : 212,

                    "text" : uiScriptLocale.OPTION_FOG_MIDDLE,
                    
                    "default_image" : ROOT_PATH + "small_Button_01.sub",
                    "over_image" : ROOT_PATH + "small_Button_02.sub",
                    "down_image" : ROOT_PATH + "small_Button_03.sub",
                },
                
                {
                    "name" : "fog_level2",
                    "type" : "radio_button",

                    "x" : 110 + 100,
                    "y" : 212,

                    "text" : uiScriptLocale.OPTION_FOG_LIGHT,
                    
                    "default_image" : ROOT_PATH + "small_Button_01.sub",
                    "over_image" : ROOT_PATH + "small_Button_02.sub",
                    "down_image" : ROOT_PATH + "small_Button_03.sub",
                },

                ## 타일 가속
                {
                    "name" : "tiling_mode",
                    "type" : "text",

                    "x" : 30,
                    "y" : 242,

                    "text" : uiScriptLocale.OPTION_TILING,
                },
                
                {
                    "name" : "tiling_cpu",
                    "type" : "radio_button",

                    "x" : 110,
                    "y" : 242,

                    "text" : uiScriptLocale.OPTION_TILING_CPU,

                    "default_image" : ROOT_PATH + "small_Button_01.sub",
                    "over_image" : ROOT_PATH + "small_Button_02.sub",
                    "down_image" : ROOT_PATH + "small_Button_03.sub",
                },
                
                {
                    "name" : "tiling_gpu",
                    "type" : "radio_button",

                    "x" : 158,
                    "y" : 242,

                    "text" : uiScriptLocale.OPTION_TILING_GPU,

                    "default_image" : ROOT_PATH + "small_Button_01.sub",
                    "over_image" : ROOT_PATH + "small_Button_02.sub",
                    "down_image" : ROOT_PATH + "small_Button_03.sub",
                },
                
                {
                    "name" : "tiling_apply",
                    "type" : "button",

                    "x" : 210,
                    "y" : 242,

                    "text" : uiScriptLocale.OPTION_TILING_APPLY,

                    "default_image" : ROOT_PATH + "small_Button_01.sub",
                    "over_image" : ROOT_PATH + "small_Button_02.sub",
                    "down_image" : ROOT_PATH + "small_Button_03.sub",
                },


                ## 그림자
                {
                    "name" : "shadow_mode",
                    "type" : "text",

                    "x" : 30,
                    "y" : 100,

                    "text" : "G?ge Menzili",
                },
                
                {
                    "name" : "shadow_bar",
                    "type" : "sliderbar",

                    "x" : 110,
                    "y" : 100,
                },
                {
                    "name" : "font_type_name",
                    "type" : "text",

                    "x" : 30,
                    "y" : 272,

                    "text" : "Yaz?Tipi",
                },
                
                {
                    "name" : "font_type_arial",
                    "type" : "radio_button",

                    "x" : 110,
                    "y" : 272,

                    "text" : "Arial",

                    "default_image" : ROOT_PATH + "small_Button_01.sub",
                    "over_image" : ROOT_PATH + "small_Button_02.sub",
                    "down_image" : ROOT_PATH + "small_Button_03.sub",
                },
                
                {
                    "name" : "font_type_tahoma",
                    "type" : "radio_button",

                    "x" : 110+50,
                    "y" : 272,

                    "text" : "Tahoma",

                    "default_image" : ROOT_PATH + "small_Button_01.sub",
                    "over_image" : ROOT_PATH + "small_Button_02.sub",
                    "down_image" : ROOT_PATH + "small_Button_03.sub",
                },
                {
                    "name" : "font_type_geneva",
                    "type" : "radio_button",

                    "x" : 110+100,
                    "y" : 272,

                    "text" : "Geneva",

                    "default_image" : ROOT_PATH + "small_Button_01.sub",
                    "over_image" : ROOT_PATH + "small_Button_02.sub",
                    "down_image" : ROOT_PATH + "small_Button_03.sub",
                },
                {
                    "name" : "night_mode",
                    "type" : "text",

                    "x" : 30,
                    "y" : 302,

                    "text" : "Gece Modu",
                },
                
                {
                    "name" : "night_on",
                    "type" : "radio_button",

                    "x" : 110,
                    "y" : 302,

                    "text" : "Aktif",

                    "default_image" : ROOT_PATH + "middle_Button_01.sub",
                    "over_image" : ROOT_PATH + "middle_Button_02.sub",
                    "down_image" : ROOT_PATH + "middle_Button_03.sub",
                },
                
                {
                    "name" : "night_off",
                    "type" : "radio_button",

                    "x" : 110+70,
                    "y" : 302,

                    "text" : "Disaktif",
                    
                    "default_image" : ROOT_PATH + "middle_Button_01.sub",
                    "over_image" : ROOT_PATH + "middle_Button_02.sub",
                    "down_image" : ROOT_PATH + "middle_Button_03.sub",
                },
                {
                    "name" : "textures_mode",
                    "type" : "text",

                    "x" : 30,
                    "y" : 332,

                    "text" : "Zemin Stili",
                },
                
                {
                    "name" : "texture_classic",
                    "type" : "radio_button",

                    "x" : 110,
                    "y" : 332,

                    "text" : "Orjinal",

                    "default_image" : ROOT_PATH + "small_Button_01.sub",
                    "over_image" : ROOT_PATH + "small_Button_02.sub",
                    "down_image" : ROOT_PATH + "small_Button_03.sub",
                },
                
                {
                    "name" : "texture_snow",
                    "type" : "radio_button",

                    "x" : 110+42,
                    "y" : 332,

                    "text" : "Karl?,

                    "default_image" : ROOT_PATH + "small_Button_01.sub",
                    "over_image" : ROOT_PATH + "small_Button_02.sub",
                    "down_image" : ROOT_PATH + "small_Button_03.sub",
                },
                
                {
                    "name" : "texture_desert",
                    "type" : "radio_button",

                    "x" : 110+84,
                    "y" : 332,

                    "text" : "현l",

                    "default_image" : ROOT_PATH + "small_Button_01.sub",
                    "over_image" : ROOT_PATH + "small_Button_02.sub",
                    "down_image" : ROOT_PATH + "small_Button_03.sub",
                },
                {
                    "name" : "texture_green",
                    "type" : "radio_button",

                    "x" : 110+126,
                    "y" : 332,

                    "text" : "Orman",

                    "default_image" : ROOT_PATH + "small_Button_01.sub",
                    "over_image" : ROOT_PATH + "small_Button_02.sub",
                    "down_image" : ROOT_PATH + "small_Button_03.sub",
                },
                {
                    "name" : "level_on_off",
                    "type" : "text",

                    "x" : 30,
                    "y" : 362,

                    "text" : uiScriptLocale.OPTION_LEVEL,
                },
                {
                    "name" : "showlevel_on_button",
                    "type" : "radio_button",
                    "x" : 110,
                    "y" : 362,
                    "text" : uiScriptLocale.OPTION_LEVEL_VIEW_ON,
                    "default_image" : ROOT_PATH + "middle_button_01.sub",
                    "over_image" : ROOT_PATH + "middle_button_02.sub",
                    "down_image" : ROOT_PATH + "middle_button_03.sub",
                },
                {
                    "name" : "showlevel_off_button",
                    "type" : "radio_button",
                    "x" : 110+70,
                    "y" : 362,
                    "text" : uiScriptLocale.OPTION_LEVEL_VIEW_OFF,
                    "default_image" : ROOT_PATH + "middle_button_01.sub",
                    "over_image" : ROOT_PATH + "middle_button_02.sub",
                    "down_image" : ROOT_PATH + "middle_button_03.sub",
                },            
                ## Range
                
                {
                    "name" : "salestext_range",
                    "type" : "text",
                    "x" : 30,
                    "y" : 127,
                    "text" : "Pazar Menzili",
                },
                {
                    "name" : "salestext_range_controller",
                    "type" : "sliderbar",
                    "x" : 110,
                    "y" : 127,
                },                    
            ),
        },
    ),
}
 
Geri
Üst