Skocz do zawartości
  • 👋 Witaj na MPCForum!

    Przeglądasz forum jako gość, co oznacza, że wiele świetnych funkcji jest jeszcze przed Tobą! 😎

    • Pełny dostęp do działów i ukrytych treści
    • Możliwość pisania i odpowiadania w tematach
    • System prywatnych wiadomości
    • Zbieranie reputacji i rozwijanie swojego profilu
    • Członkostwo w jednej z największych społeczności graczy

    👉 Dołączenie zajmie Ci mniej niż minutę – a zyskasz znacznie więcej!

    Zarejestruj się teraz

[Pomoc] Przy dodaniu nowego buttonu w taskbar


Owocek14

Rekomendowane odpowiedzi

Opublikowano

chodzi mi o to żę jak mam

 

Code:
toggleButtonDict[TaskBar.BUTTON_CHARACTER]=self.GetChild("CharacterButton")

and under it add this

Code:
toggleButtonDict[TaskBar.BUTTON_WEBOVE_STRANKY]=self.GetChild("Webove_stranky")

Warning!! if you change the ("Webove_stranky") to something other, you have to change it also in taskbar.py in locale!! because this determines what button has the function which we can make with this tutorial. Ok, next find this

Code:
BUTTON_CHAT = 4

and under it add this code.

Code:
BUTTON_WEBOVE_STRANKY = 5

Ok now we finished the uitaskbar.py part..open interfacemodule.py First and necessary part of this! you must write on the top or betwen the other imports this

Code:
import os

find this

Code:
self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_CHAT, ui.__mem_func__(self.ToggleChat))

now under it add this

Code:
self.wndTaskBar.SetToggleButtonEvent(uiTaskBar.TaskBar.BUTTON_WEBOVE_STRANKY, ui.__mem_func__(self.OtevritWeb))

ooookkkk and the last part of this you have to add the definition of this

Code:
self.OtevritWeb

You can add it where you want. So, here is code you have to add.

Code:
[TAB]def OtevritWeb(self):
[TAB][TAB]chat.AppendChat(CHAT_TYPE_INFO, "Otevírání webových stránek..")
[TAB][TAB]os.startfile("www.website.cz")

you have to replace the "[TAB]" )with the tabulator xD..)
Ok now pack root, put in your client and start game. Now if you click on the new button you open the website which you can define in this

Code:
os.startfile("www.website.cz")

To co mam zrobić z końcówką? jak dodać aby otwierało się przez taskbar a nie przez F5 chodzi mi o bs'a bo mam dodanego pod f5 a chcę w taskbarze

Opublikowano

Tak jak mowilem na moje oko to:
[TAB]def OtevritWeb(self):
[TAB][TAB]chat.AppendChat(CHAT_TYPE_INFO, "Otevírání webových stránek..")
[TAB][TAB]os.startfile("www.website.cz")
na to:
[TAB]def OtevritWeb(self):
[TAB][TAB]pyScrLoader = ui.PythonScriptLoader()
[TAB][TAB]pyScrLoader.LoadScriptFile(self, "xxx/xxx.py")
nie wiem jak ty masz tego bsa dodanego, najlepiej zapodaj kod, to co ci podalem otwiera plik .py i laduje okno, za xxx lokalizacje tego .py co chcesz otworzyc

Zarchiwizowany

Ten temat przebywa obecnie w archiwum. Dodawanie nowych odpowiedzi zostało zablokowane.

×
×
  • Dodaj nową pozycję...