Code Monkey home page Code Monkey logo

journal's Introduction

Journal

Console for Flax Engine with command handling

GitHub release Github license

How to use console?

  1. In Flax Editor go to Journal/Source/Journal/ and place ConsoleManager.cs script in the scene where u want (for example in Scene actor)
  2. Go to Journal/Content/ drag ConsolePrefab into "ConsolePrefab" field in script
  3. If you want to customize console UI:
    1. Go to Journal/Content/ in editor and drag ConsolePrefab on to the scene
    2. In ConsoleManager script set CreateConsoleFromPrefab unchecked
    3. Drag console actor to ConsoleActor field

How to add commands to console?

Like this:

using FlaxEngine;
using Journal;

namespace Game
{
	public class Test : Script 
	{
 		public override void OnStart() 
		{
			ConsoleManager.RegisterCommand("hello", Hello); // <---
		}
  
		public void Hello()
		{
			Debug.Log("Hello, world!");
			// Do something here
		}
	}
}

Shortcuts

  • Tab: Selecting hints when editing
  • Arrow Up: Get previous commands
  • Arrow Down: Get recent commands

Installation

With Flax Plugin Manager:

  1. Download, unpack & run Flax Plugin Manager [Click here]
  2. Select your project & add Journal

With Git:

  1. Use this command somewhere in your project folder git clone https://github.com/Crawcik/Journal.git
    (for example in <your-flax-project-path>/Plugins/)

Normal way:

  1. Download this project .zip or .tar.gz
  2. Unpack it in folder near your project (for example <your-flax-project-path>/Plugins/Journal/)
  3. Add in your .flaxproj file path to plugin, like in this example:
{
	"GameTarget": "GameTarget",
	"EditorTarget": "GameEditorTarget",
	"References": [
		{
			"Name": "$(EnginePath)/Flax.flaxproj"
		},
		{
			"Name": "$(ProjectPath)/Plugins/Journal/Journal.flaxproj"
		}
	],
}
  1. Go to <your-flax-project-path>/Source/Game/Game.Build.cs and add "Journal" module, here is example: if you don't want to use commands this is optional
public override void Setup(BuildOptions options)
{
	base.Setup(options);

	options.PrivateDependencies.Add("Journal"); // Adds reference to Journal types
}
  1. If something doesn't work: check logs, try deleting Cache folder or generate project files manually

Also here is official tutorial for installing plugins: https://docs.flaxengine.com/manual/scripting/plugins/plugin-project.html

journal's People

Contributors

crawcik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

journal's Issues

Textbox does not catch focus when console opened

Reproducing:

  1. Create new empty (floor and block scene) flax project
  2. Setup Journal as default prefab UI

Result:
When pressing call key ( ` ), command window appears and cursor ( _ ) blink animates, but UI does not have focus.
To make things complex, default scene has mouse cursor locked to camera rotation - so mouse cursor is not visible, and of course cannot do 'click textbox' things! Only way to get focus is pressing DN or Right key to call recent list(actually empty) and 'restore' the focus to textbox. otherwise Journal UI does not take any text input.

I thought console UI must take the focus right away when called, for fluent functioning. Is current mechanism intended, or Journal incomaptible with 1st person mode mouse/keybind?

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.