Giter Site home page Giter Site logo

igor8518 / msfs-webui-devkit Goto Github PK

View Code? Open in Web Editor NEW

This project forked from dga711/msfs-webui-devkit

0.0 1.0 0.0 115 KB

This devkit is a mod and guidance for easier development of WebUI (Panels, MFD..) in Microsoft Flightsimulator 2020.

JavaScript 90.06% CSS 5.98% Python 3.96%

msfs-webui-devkit's Introduction

MSFS 2020 WebUI DevKit

This devkit is a mod and guidance for easier development of WebUI (Panels, MFD..) in Microsoft Flightsimulator 2020.

The goal is to make the process of developing UIs in MSFS as painless as possible with more stuff to come.

⚠️ The init code changed with version 0.9.0, check the Usage section

Features

  • Hotreload HTML/CSS/JS changes without restarting the sim or flight
  • View console.log output in game
  • Console input field to directly run JS commands
  • Action buttons
  • Basic HTML inspector
  • Panel FPS counter
  • [TODO] Devtool like debugging UI / see devtools-backend-refurb
  • [TODO] Load content from local webserver
  • ...

      

Hotkeys

  • ALT + T = Show/Hide Panel
  • ALT + R = Reload page
  • ALT + X = Run JS command

Installation

  • Download the latest zip release here.
  • Extract the "msfs-webui-devkit" folder to the community folder in your MSFS installation
    or
  • Clone the repo into your community folder

Usage

Part 1: The code

⚠️ This changed with version 0.9.0. Get rid of the former initialization code and follow the instructions below

To show the debugging UI in the panel/mfd of your choice you should put this code into the corresponding HTML file of the instrument or page.

⚠️ It must come after the script-tag for common.js

<script type="text/javascript" src="/JS/debug.js"></script>

Tip: To show the UI on all screens on all planes, put the script tag into VCockpit.html

Part 2: The ingame UI

In game, on any panel where you activated the code, it should show an opaque UI Element in the top right corner.

Press on the "R" button to refresh the HTML Content of the panel.
Press on the "C" button to clear the console log. Press "X" to show the console output.

Important: To be able to click on it on cockpit panels you have to bind the "New UI Window Mode" key in MsFs. Then press that key and click on a glass panel. It will pop out in a window.

Part 3: Console Logging

In the JS corresponding to the activated panel, any console.log() output should show up in the console panel in game.

Part 4: Console Input

At the bottom of the debug panel is an input field. You can run JS commands here like console.log("test") and run them by clicking the "->" button or pressing ALT+X

Part 5: Action Buttons

g_modDebugMgr.AddDebugButton("InsertTitleHere", function() {dosomething}); This will show a button in the open debug UI which executes the function when clicked.

Known Limitations

  • Sometimes seems to fail refresh of sources no matter what you do.
    HTML/CSS usually always refreshes. When it fails for JS for you, a workaround would be to add a querystring to the import in the HTML file of the panel to bust the cache. Ofc I will work on ways to make this obsolete.

Contributing

Pull requests and further information on the insides are welcome. For major changes, please open an issue first to discuss what you would like to change.

Contributors ✨


dga711

🤔 💻

Smirow

🐛 💻

Knighty

💻

kaosfere

💻

License

MIT

msfs-webui-devkit's People

Contributors

dga711 avatar kaosfere avatar smirow avatar knighty avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.