The_HydroX

Displaying HTML -> without extendet Stuff

7 posts in this topic

Posted (edited)

Hey guys,

 

ragemp has cef, so lets use it! ( useable @ 0.2 ;) )

(it's my Code, so my leader has nothing to say :P)

 

1.

// 
// [ The_HydroX | Nick | 2017 ]
// 

let devWindow = {
	browser: mp.browsers.new('package://[YOUR CLIENT PACKAGE]/index.html'),
	keyCode: 0x7B, // F12
	windowOpen: false
}

I define a new object, named devWindow.

the browser window will be spawned when we call 

mp.browsers.new('package://devLog/index.html')

 

2.

I want to change the visibility of the Frame / cef / whatEver.

// keyDown
mp.keys.bind(devWindow.keyCode, true, function(){
	if (!devWindow.windowOpen) {
		devWindow.browser.execute('showWindow();');
		devWindow.windowOpen = !devWindow.windowOpen;
	} else {
		devWindow.browser.execute('hideWindow();');
		devWindow.windowOpen = !devWindow.windowOpen;
	}
});

i do this with keyBinding.

 

3.

you can execute functions they are defined @ the index.html
like:

function showWindow() {
	$('.devWindow').show();
}

function hideWindow() {
	$('.devWindow').hide();
}

 

yes, its very simple. ;)

 

sry for my englisch ^^

GreetZ from Dresden

The_HydroX

Edited by The_HydroX
available @ 0.2 - sry
1 person likes this

Share this post


Link to post
Share on other sites

Please can you specify the files, where i have to put this code ?

Share this post


Link to post
Share on other sites

I'd suggest you try to use "browser.active = toggle".

Share this post


Link to post
Share on other sites
vor 1 Stunde schrieb ragempdev:

I'd suggest you try to use "browser.active = toggle".

oh. will try it asap ;)

Share this post


Link to post
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

  • Recently Browsing   0 members

    No registered users viewing this page.