Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 05/30/21 in all areas

  1. ScriptWindow (as the name suggests) are window created using scriptfiles (you can find a lot of them in uiscript and in locale/xx/ui). These script files are (in short) a dictionary of items with settings of certain keys used by PythonScriptLoader class to assign to the elements the properties linked with the keys. Let's show here an example: All the scripts have local variable named window (the dictionary that contains all the settings). The first dictionary's (window) keys describe the scriptwindow properties, the window name, the height/width, the x/y where the window spawn, the style of the window (in this case moveable mean the window can be moved with the mouse and float mean the window has an order how the children are show and they can be moved over other children using SetTop). the window usually has a "children" key that describe a tuple of dictionaries. The tuple start with "(" and end with ")," and it contains other dictionaries that describe the children properties. and example is the "Board" child that is a "board_with_titlebar" element (so a board with a titlebar and a close button on the top side). the "type" key is really important, it describe what kind of element is going to be create. You can read all types available and all keys you can use to assign properties to the elements in the class PythonScriptLoader (especially in def LoadChildren) in ui.py. The self.GetChild you mentioned is used to obtain the element using its "name" property. The script window are a really clever way to make a window, but it has some limit. The window made by using the script window can contain in the script only the "static" elements, the elements that are always created with the board. To create dynamically the elements you have to code them and to assign the properties using the class methods defined in ui.py An example on how you can create a button would be: import ui ... ... ... class MyBoardExample(ui.Window): ... ... ... ... def LoadDynamicElements(self): race = player.GetRace() race_image_default = "d:/ymir work/ui/game/race_%d_default.sub"%race race_image_down = "d:/ymir work/ui/game/race_%d_down.sub"%race race_image_over = "d:/ymir work/ui/game/race_%d_over.sub"%race self.MainCharRaceButton = ui.Button() self.MainCharRaceButton.SetParent(self) #giving the parent to link the button the main board self.MainCharRaceButton.SetPosition(105, 456) #giving position using local coordinates self.MainCharRaceButton.SetUpVisual(race_image_default) #setting up visual (the image shown when button is in default state) self.MainCharRaceButton.SetDownVisual(race_image_down) #setting down visual (the image show when button is pressed) self.MainCharRaceButton.SetOverVisual(race_image_over) #setting over visual (the image shown when mouse come over the button) self.MainCharRaceButton.SAFE_SetEvent(self.__OnClickMainCharRaceButton) #setting an event to the button defined above self.MainCharRaceButton.Show() #the show is necessary to see the button In the e.g. i created a button that change its visual based on the player character race. WARNING: the code above wont work since the images and the event are invented and they don't exist
    2 points
  2. M2 Download Center Download Here ( Internal ) Hello, This little thing is marks your pet seal into your inventory like the autopotion. This arrives with the v17.5 patch. Open PetSystem.cpp and replace or make it fit for you: void CPetActor::SetSummonItem(LPITEM pItem) { if (NULL == pItem) { LPITEM pSummonItem = ITEM_MANAGER::instance().FindByVID(m_dwSummonItemVID); if (NULL != pSummonItem) pSummonItem->SetSocket(1, FALSE); m_dwSummonItemVID = 0; m_dwSummonItemVnum = 0; return; } pItem->SetSocket(1, TRUE); m_dwSummonItemVID = pItem->GetVID(); m_dwSummonItemVnum = pItem->GetVnum(); } After that open the uiInventory.py and paste this code below the autopotion if-statement in the RefreshBagSlotWindow function. elif itemVnum >= 53001 and itemVnum <= 53256: metinSocket = [player.GetItemMetinSocket(globalSlotNumber, j) for j in xrange(player.METIN_SOCKET_MAX_NUM)]# <!> globalSlotNumber may be different <!> isActivated = 0 != metinSocket[1] if isActivated: self.wndItem.ActivateSlot(i) else: self.wndItem.DeactivateSlot(i)
    1 point
  3. M2 Download Center Download Here ( Internal ) Hello everyone, today I`m going to show to how to make a VIP system from SRC. You need Launcher SRC, Server SRC. So, let`s begin. 1.Launcher: Go to UserInterface/InstanceBase.h and search After that add: Search After that add: 1.2 Go to InstanceBase.cpp and search After that add: In same file search: And after that add: Search: After that add: 1.3: In file InstanceBaseEffect.cpp search After that add: Search: After that add: Search: After that add: 1.4 In fine PythonCharacterModule.cpp search: And after that add: Search: And after that add: Launcher part done. 2.SERVER 2.1 In file common/length.h search: And after that add: 2.2 In file game/src/affect.h search: And after add: 2.3 In file game/src/char.cpp search: And after add: Search And after that add: 2.4 In file game/src/config.cpp search And mofify like that: 2.5 In file db/src/ClientManager.cpp search: And after that add: 3.MYSQL 3.1 Go to your database->COMMON->RIGHT CLICK ON gmlist->DESIGN TABLE->SELECT mAuthority from Fields TAB->VALUES->ADD VIP AFTER PLAYER. 4.CLIENT 4.1. In file ROOT/PlayerSettingModule.py search And after that add: 4.2 In locale go to effect folder(WHERE YOU HAVE GM.MSE) and add THIS FILES: NEW LINK - FIXED Post any problems/bugs and we will solve them tohether Sorry for my bad english..:(
    1 point
  4. M2 Download Center Download Here ( Internal ) Hello Since most of the work I do is in NodeJS (JavaScript and TypeScript), I needed to make a script to access the Metin2 API. GitHub: [Hidden Content] It has a JavaScript and a TypeScript version. To use just edit either file and set your server's data. This code is synchronous, meaning, it will block while waiting for a response from the server. It can be made asynchronous with Promises. On both files there's also a list of the most useful commands available, you can create more on the game source. You can find how to use it on the GitHub repository. Hope it's useful to someone.
    1 point
  5. About Ch1 Core2 that doesn't start, maybe problem can be in your start script or miss hardlink to gamecore. Why do you setup IP in this way?
    1 point
  6. You have only 2 cores in the channel? What files are you using? Do you use any multilang system?
    1 point
  7. Update Added multi-language support. Instructions can be found on the README. [Hidden Content] Multi-language It ships with support for two languages, English (default) and Portuguese. These can be used as examples to add more languages. To add more languages, you must edit both src\i18n.ts and src_electron\i18n.ts. Three things are needed, import the translation file (.json) that must go inside the folder localization\, and add the language on resources and supportedLngs. Do not edit the placeholders ( {{ }} ) when creating a new language, otherwise it won't work as expected. To add flags edit the file src\components\Buttons.ts. There are flags for every language that are supported by the official, just need to add the button.
    1 point
  8. The basic changes are: From: def __SelectSkillGroup(self, index): for btn in self.skillGroupButton: btn.SetUp() self.skillGroupButton[index].Down() if self.__CanUseHorseSkill(): if 0 == index: index = net.GetMainActorSkillGroup()-1 elif 1 == index: index = self.PAGE_HORSE self.curSelectedSkillGroup = index self.__SetSkillSlotData(net.GetMainActorRace(), index+1, net.GetMainActorEmpire()) To: [Hidden Content] After some minutes of debugging I rewrote this shit, there're more changes, when i'll have some free time (at Monday), i'll post the code. Without skill group +/- horse riding: [Hidden Content] With skill group +/- horse riding: [Hidden Content]
    1 point
  9. You're right, but if you really want to use something like this, you should do a customizable class, like: [Hidden Content]
    1 point
  10. And we don't mean to make fun of and ignore you but we do
    0 points
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.