Jump to content
×
×
  • Create New...
  • 0

External links in Login window.


JosanG

Question

Hi all. I tried some times to customize my client's login windows by linking each visible button with a link to be opened in a new tab in web browser.

 

I've truly no idea about how to do that, so i would appreciate any kind of help you can give to me. 

 

Thank you in advance!

Link to comment
Share on other sites

22 answers to this question

Recommended Posts

  • 0

Hi cCorax, thank you so much for your reply. 

 

Buttons are already defined, but when pressed in the login windows, appears no further action.

 

I've looked in syserr and couldn't find an error in here about that problem.

 

Ty again!

Link to comment
Share on other sites

  • 0

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

  • 0
  • 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:

Hidden Content

    Give reaction to this post to see the hidden content.

  • Metin2 Dev 4
  • Love 5
  • Not Good 1
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


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.