Jump to content

External links in Login window.


Recommended Posts

  • Active Member

If you want open url in ingame browser

	def OpenWebWindow(self):
		width, height = int(max(wndMgr.GetScreenWidth() / 2, 800)), int(min(wndMgr.GetScreenHeight() / 1.5, 600))
		x, y = wndMgr.GetScreenWidth() / 2 - width / 2, wndMgr.GetScreenHeight() / 2 - height / 2
		self.webWindow = ui.BoardWithTitleBar()
		self.webWindow.AddFlag("movable")
		self.webWindow.AddFlag("attach")
		self.webWindow.SetSize(width, height)
		self.webWindow.SetPosition(x, y)
		app.ShowWebPage("http://google.com", (x+10, y+40, x+width-20, y+height-40))
		self.webWindow.Show()
		self.webWindow.SetTop()
		
	def HideWebWindow(self):
		self.webWindow.Hide()
		app.HideWebPage()

If you want open url in normal web browser

def OpenUrlWithBrowser(self):
	import os
	url="http://google.com"
	os.popen("start %s" % (url))
Link to comment
Share on other sites

  • Premium

This is the my version:

loginwindow.py (in locale):

		{
			"name" : "WepPageButton",
			"type" : "button",

			"x" : , #write here the x coordinate
			"y" : , #write here the y coordinate

			"default_image" : "d:/ymir work/ui/public/large_button_01.sub",
			"over_image" : "d:/ymir work/ui/public/large_button_02.sub",
			"down_image" : "d:/ymir work/ui/public/large_button_03.sub",

			"text" : , #write here the button text
		},

intrologin.py (in root)

search:

import uiScriptLocale

Write under:

import webbrowser

Now search:

self.loginExitButton		= GetObject("LoginExitButton")

Write under:

self.WepPageButton			= GetObject("WepPageButton")

Now search:

self.loginExitButton.SetEvent(ui.__mem_func__(self.__OnClickExitButton))

Write under:

self.WepPageButton.SetEvent(ui.__mem_func__(self.__WebPageTest))

Now create this function:

	def __WebPageTest(self):
		webbrowser.open_new("write here your url")

The last thing put this, in the lib folder:

This is the hidden content, please

  • Metin2 Dev 16
  • Think 1
  • Love 10
Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • 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.