Outerra forum
Anteworld - Outerra Game => Modding: Importer, Tools & Utilities => JavaScript development => Topic started by: SteelRat on April 13, 2015, 10:00:45 am
-
Hi developers!
What am I doing wrong?
<!DOCTYPE html>
<html>
<head>
<title>Template msg box</title>
<link type="text/css" rel="stylesheet" href="file:///www/css/outerra-theme.css">
<script type="text/javascript" src="file:///www/lib/ot.js"></script>
<script type="text/javascript">
outerra({
requires: [
'file:///www/lib/component/message-box/message-box.js'
],
body: function (ot, script) {
var msgBox = new ot.components.ext.MessageBox('msgBox', {
// public api
//afterAction: undefined, // function (buttonId) {
// public params
allowHtml: true,
title: 'Template msg box',
message: '<h4>Message Test</h4>',
buttons: 'CANCEL|NO|YES' // pipe separated button names e.g. 'CANCEL|NO|YES'
});
msgBox.render();
}
});
</script>
</head>
<body></body>
</html>
if
<link type="text/css" rel="stylesheet" href="file:///www/css/outerra-theme.css">
https://onedrive.live.com/redir?resid=BA7B7E2655BF556D!1605&authkey=!ANTKdVg5FW0OUhU&v=3&ithint=photo%2cjpg
else if
<link type="text/css" rel="stylesheet" href="file:///www/css/outerra.css">
https://onedrive.live.com/redir?resid=BA7B7E2655BF556D!1606&authkey=!AP6qZPvTy2MbAQ4&v=3&ithint=photo%2cpng
-
Wow, didnt know you can do your own windows ...
-
Wow, didnt know you can do your own windows ...
create folder in
InstallPach\outerra\Anteworld\MyDesktops
create file in folder
myDesktop.html
insert in file this
<!DOCTYPE html>
<html>
<head>
<title>Template Desktop</title>
<link type="text/css" rel="stylesheet" href="file:///www/css/outerra-theme.css">
<script type="text/javascript" src="file:///www/lib/ot.js"></script>
<script type="text/javascript">
outerra({
requires: [
'file:///www/lib/component/desktopwindow.js'
],
body: function (ot, script) {
var win = new ot.components.DesktopWindow('win', {
title = "Template Desktop",
width: 500,
height: 500,
minWidth: 100,
minHeight: 100,
populateBody: function (body) {
body.add(new ot.components.Component('body'));
}
});
win.render();
}
});
</script>
</head>
<body class="window-body full-size">
<div cid="body">
BODY
</div>
</body>
</html>
write in console
var win = window.open("../MyDesktops/myDesktop.html"); close();
press ENTER)
-
That will be handy ... thanks !
-
Awesome work SteelRat! This is extremely helpful!!!
Think there is a way to call this from an aircraft/vehicle .js script?
-
Awesome work SteelRat! This is extremely helpful!!!
Think there is a way to call this from an aircraft/vehicle .js script?
Well need a special button for that - a object info button !
-
Awesome work SteelRat! This is extremely helpful!!!
Think there is a way to call this from an aircraft/vehicle .js script?
It will be more difficult!
In aircraft/vehicle .js not metod
window.open();
But I will find a way)
-
That would be great! I believe cameni once mentioned that it would be possible.
Regards,
Uriah
-
That would be great! I believe cameni once mentioned that it would be possible.
Regards,
Uriah
I think I should be an interface.
-
Cameni mentioned you could access the console from the js files
var world = this.$query_interface("ot::js::world.get");
var vehicle = world.create_instance("outerra/ddg/ddg", pos, {x:0, y:0, z:0, w:1}, false);
I was going to see if I could find a way to get the get_hpr() command to return in a js file tonight.
-
Solved the problem.
<!DOCTYPE html>
<html>
<head>
<title>Message box sample</title>
<link type="text/css" rel="stylesheet" href="file:///www/css/outerra-theme.css">
<script type="text/javascript" src="file:///www/lib/ot.js"></script>
<script type="text/javascript">
var msg = "<p><h3>Hi!</h3></p>";
msg += "<p>My name is Outerra user interface.<p>";
msg += "<p>Welcome to the sandbox.<p>";
msg += '<img src="http://www.outerra.com/webackx.png" width="90%">';
outerra({
requires: [
'file:///www/lib/component/message-box/message-box.js'
],
body: function (ot, script) {
var msgBox = new ot.components.ext.MessageBox('msgBox', {
// public api
afterAction: function (buttonId) {
close();
},
height: 240,
maxHeight: 240,
// public params
allowHtml: true,
title: 'Message box sample',
message: msg,
buttons: 'YES' // pipe separated button names e.g. 'CANCEL|NO|YES'
});
msgBox.render();
}
});
</script>
</head>
<body class="window-body full-size">
</body>
</html>
https://onedrive.live.com/redir?resid=BA7B7E2655BF556D!1607&authkey=!AHgeT3t1Q649Krk&v=3&ithint=photo%2cjpg
-
Cameni mentioned you could access the console from the js files
var world = this.$query_interface("ot::js::world.get");
var vehicle = world.create_instance("outerra/ddg/ddg", pos, {x:0, y:0, z:0, w:1}, false);
I was going to see if I could find a way to get the get_hpr() command to return in a js file tonight.
http://pastebin.com/j2YXqj7H
I'm here about another, or I do not understand.)