What's new

Welcome to Onforum.net - Web and gaming resource community

Join us now to get access to all our features. Once registered and logged in, you will be able to create topics, post replies to existing threads, give reputation to your fellow members, get your own private messenger, and so, so much more. It's also quick and totally free, so what are you waiting for?

Ask question

Ask Questions and Get Answers from Our Community

Answer

Answer Questions and Become an Expert on Your Topic

Contact Staff

Our Experts are Ready to Answer your Questions

Quests /Python [MINI-PY]Change Help Window and add more pages

Aioria

Member
Joined
Apr 17, 2019
Messages
61
Reaction score
9
Points
8
Location
Rome
Credits
0
Hi guys! First of all sorry for my bad english.

This is a mini-release i've done years ago, and now i'll post it here, hoping some guy can enjoy it.
This edit was done cause i've ever hate the button-config to mount on horse, and always open the help window instead, so we're gonna change them.

Unpack "root/game.py" and search:

Code:
    def    __PressHKey(self):
        if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
            net.SendChatPacket("/user_horse_ride")
        else:
            self.interface.OpenHelpWindow()
replace with:

Code:
    def    __PressHKey(self):
        if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
            self.interface.OpenHelpWindow()
        else:
            net.SendChatPacket("/user_horse_ride")
In this way you'll mount on horse by pressing "H" and open help window with "CTRL+H"
You can even disable the help window and let the horse command like always by replace:

Code:
            self.interface.OpenHelpWindow()
with "pass"

You can even add help window pages and use them like wiki or others if you're good enough (i'm not :D)

So, just open the file "root/uihelp.py" and replace:

Code:
ENABLE_HELP_MULTIPAGE = 0

with

ENABLE_HELP_MULTIPAGE = 1
then can go to "root/helpwindow2.py" and make your edits, you can add lot of pages if you want, images, ecc

This is an example without edits of helpwindow2.py




Sorry if this is just a mini release! Love you.
 
Last edited:

[RaffaeL]

Administrator
Administrator
Joined
Apr 12, 2019
Messages
101
Reaction score
94
Points
28
Location
Everywhere
Credits
0
Hi guys! First of all sorry for my bad english.

This is a mini-release i've done years ago, and now i'll post it here, hoping some guy can enjoy it.
This edit was done cause i've ever hate the button-config to mount on horse, and always open the help window instead, so we're gonna change them.

Unpack "root/game.py" and search:

Code:
    def    __PressHKey(self):
        if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
            net.SendChatPacket("/user_horse_ride")
        else:
            self.interface.OpenHelpWindow()
replace with:

Code:
    def    __PressHKey(self):
        if app.IsPressed(app.DIK_LCONTROL) or app.IsPressed(app.DIK_RCONTROL):
            self.interface.OpenHelpWindow()
        else:
            net.SendChatPacket("/user_horse_ride")
In this way you'll mount on horse by pressing "H" and open help window with "CTRL+H"
You can even disable the help window and let the horse command like always by replace:

Code:
            self.interface.OpenHelpWindow()
with "pass"

You can even add help window pages and use them like wiki or others if you're good enough (i'm not :D)

So, just open the file "root/uihelp.py" and replace:

Code:
ENABLE_HELP_MULTIPAGE = 0

with

ENABLE_HELP_MULTIPAGE = 1
then can go to "root/helpwindow2.py" and make your edits, you can add lot of pages if you want, images, ecc

This is an example without edits of helpwindow2.py




Sorry if this is just a mini release! Love you.
You can even add help window pages and use them like wiki or others if you're good enough (i'm not :D)
You don't need to be overskilled to add those pages. Just:
Python:
#Second page
{
            "name" : "page_2",
            "type" : "window",

            "x" : SCREEN_WIDTH * 150 / 800,
            "y" : SCREEN_HEIGHT * START_HEIGHT / 600,
            "width" : 0,
            "height" : 0,

            "children" :
            (
                {
                    "name" : "help_02_01", "type" : "text", "outline" : 1,
                    "x" : 0, "y" : SCREEN_HEIGHT * HEIGHT_STEP*0,
                    "text" : "Your 1st text here",
                },
                {
                    "name" : "help_02_02", "type" : "text", "outline" : 1,
                    "x" : 0, "y" : HEIGHT_STEP*1,
                    "text" : "Your 2nd text here",
                },
                {
                    "name" : "help_02_03", "type" : "text", "outline" : 1,
                    "x" : 0, "y" : HEIGHT_STEP*1,
                    "text" : "Your 3rd text here",
                },
            ),
        },
#3rd page
        {
            "name" : "page_3",
            "type" : "window",

            "x" : SCREEN_WIDTH * 150 / 800,
            "y" : SCREEN_HEIGHT * START_HEIGHT / 600,
            "width" : 0,
            "height" : 0,

            "children" :
            (
                {
                    "name" : "help_03_01", "type" : "text", "outline" : 1,
                    "x" : 0, "y" : SCREEN_HEIGHT * HEIGHT_STEP*0,
                    "text" : "Your 1st text here",
                },
                {
                    "name" : "help_03_02", "type" : "text", "outline" : 1,
                    "x" : 0, "y" : HEIGHT_STEP*1,
                    "text" : "Your 2nd text here",
                },
                {
                    "name" : "help_03_03", "type" : "text", "outline" : 1,
                    "x" : 0, "y" : HEIGHT_STEP*1,
                    "text" : "Your 3rd text here",
                },

                ## An so on.....
            ),
        },

Then, search bellow in the same file, and add buttons for those pages. Just copy-paste the existing code, for button.
 

shape1
shape2
shape3
shape4
shape7
shape8
Top