Outerra forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

Download Outerra Tech Demo. Unofficial Outerra Discord server, MicroProse Discord server for OWS.

Author Topic: Message box  (Read 13371 times)

SteelRat

  • Sr. Member
  • ****
  • Posts: 380
  • newbie
Message box
« on: April 13, 2015, 10:00:45 am »

Hi developers!

What am I doing wrong?

Code: [Select]
<!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
Code: [Select]
<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
Code: [Select]
<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
Logged

PytonPago

  • Hero Member
  • *****
  • Posts: 2284
  • It´s way too complex, dont let me try to explain !
Re: Message box
« Reply #1 on: April 13, 2015, 11:40:49 am »

Wow, didnt know you can do your own windows  ...
Logged
We are still undeveloped as long as we don´t realize, that all our science is still descriptive, and than beyond that description lies a whole new world we just haven´t even started to fully understand.

SteelRat

  • Sr. Member
  • ****
  • Posts: 380
  • newbie
Re: Message box
« Reply #2 on: April 13, 2015, 12:13:03 pm »

Wow, didnt know you can do your own windows  ...

create folder in
Code: [Select]
InstallPach\outerra\Anteworld\MyDesktops
create file in folder
Code: [Select]
myDesktop.html
insert in file this
Code: [Select]
<!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
Code: [Select]
var win = window.open("../MyDesktops/myDesktop.html"); close();press ENTER)
Logged

PytonPago

  • Hero Member
  • *****
  • Posts: 2284
  • It´s way too complex, dont let me try to explain !
Re: Message box
« Reply #3 on: April 13, 2015, 01:21:40 pm »

That will be handy ... thanks !
Logged
We are still undeveloped as long as we don´t realize, that all our science is still descriptive, and than beyond that description lies a whole new world we just haven´t even started to fully understand.

Uriah

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 569
  • We do these things not because they are easy. -JFK
Re: Message box
« Reply #4 on: April 13, 2015, 01:24:46 pm »

Awesome work SteelRat! This is extremely helpful!!!

Think there is a way to call this from an aircraft/vehicle .js script?
« Last Edit: April 13, 2015, 01:49:25 pm by Uriah »
Logged

PytonPago

  • Hero Member
  • *****
  • Posts: 2284
  • It´s way too complex, dont let me try to explain !
Re: Message box
« Reply #5 on: April 13, 2015, 01:53:56 pm »

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 !
Logged
We are still undeveloped as long as we don´t realize, that all our science is still descriptive, and than beyond that description lies a whole new world we just haven´t even started to fully understand.

SteelRat

  • Sr. Member
  • ****
  • Posts: 380
  • newbie
Re: Message box
« Reply #6 on: April 13, 2015, 02:31:51 pm »

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
Code: [Select]
window.open();But I will find a way)
« Last Edit: April 13, 2015, 02:35:17 pm by SteelRat »
Logged

Uriah

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 569
  • We do these things not because they are easy. -JFK
Re: Message box
« Reply #7 on: April 13, 2015, 03:31:09 pm »

That would be great! I believe cameni once mentioned that it would be possible.

Regards,
Uriah
Logged

SteelRat

  • Sr. Member
  • ****
  • Posts: 380
  • newbie
Re: Message box
« Reply #8 on: April 13, 2015, 06:38:03 pm »

That would be great! I believe cameni once mentioned that it would be possible.

Regards,
Uriah

I think I should be an interface.
Logged

zzz

  • Sr. Member
  • ****
  • Posts: 266
  • newbie
Re: Message box
« Reply #9 on: April 15, 2015, 11:49:05 am »

Cameni mentioned you could access the console from the js files

Code: [Select]
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.
Logged

SteelRat

  • Sr. Member
  • ****
  • Posts: 380
  • newbie
Re: Message box
« Reply #10 on: April 15, 2015, 12:04:52 pm »

Solved the problem.

Code: [Select]
<!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
Logged

SteelRat

  • Sr. Member
  • ****
  • Posts: 380
  • newbie
Re: Message box
« Reply #11 on: April 15, 2015, 12:19:09 pm »

Cameni mentioned you could access the console from the js files

Code: [Select]
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.)
Logged