Compare commits
2 Commits
8951795e9b
...
d7bd0d02ee
| Author | SHA1 | Date | |
|---|---|---|---|
| d7bd0d02ee | |||
| 720b4d45f2 |
@ -1,5 +1,7 @@
|
||||
package engine.tools.ui;
|
||||
|
||||
import game.ui.text.TextFormats;
|
||||
import openfl.text.TextFormat;
|
||||
import openfl.text.TextField;
|
||||
import engine.ui.UIPane;
|
||||
import lime.app.Event;
|
||||
@ -14,6 +16,7 @@ class UITool{
|
||||
public static var ccmd_dev_uitool = ConVar.registerCCmd("dev_uitool", (args:Array<String>) -> { open();});
|
||||
public static var uiEditorWindow:openfl.display.Window;
|
||||
public static var uiEditorSprite:Sprite;
|
||||
private static var tf:TextField;
|
||||
public static function spawnUIEditorWindow(){
|
||||
var secondWindow = Lib.application.createWindow({title: "UI Outliner"});
|
||||
if(uiEditorSprite == null){
|
||||
@ -26,16 +29,33 @@ class UITool{
|
||||
secondWindow.onClose.add(()->{
|
||||
uiEditorWindow = null;
|
||||
});
|
||||
var tf:TextField = new TextField();
|
||||
tf = new TextField();
|
||||
TextFormats.getFormats();
|
||||
var tformat = TextFormats.formats.cInputFmt;
|
||||
tf.setTextFormat(tformat);
|
||||
tf.autoSize = LEFT;
|
||||
uiEditorSprite.addChild(tf);
|
||||
update([]);
|
||||
}
|
||||
|
||||
|
||||
public static var ccmd_dev_uitool_refresh = ConVar.registerCCmd("dev_uitool_refresh", update);
|
||||
|
||||
|
||||
|
||||
public static function update(args:Array<String>){
|
||||
tf.text = "";
|
||||
for(pane in UIPane.panelist){
|
||||
//check if pane is toplevel
|
||||
Console.devMsg("Pane: "+ pane.name);
|
||||
//Get all Root UI Panes
|
||||
if(pane.parent == null) {
|
||||
tf.appendText("-");
|
||||
tf.appendText(pane.name+"\n");
|
||||
}
|
||||
}
|
||||
uiEditorSprite.addChild(tf);
|
||||
}
|
||||
|
||||
public static function open(){
|
||||
if(uiEditorWindow == null){
|
||||
spawnUIEditorWindow();
|
||||
|
||||
@ -6,10 +6,12 @@ package engine.ui;
|
||||
// | ____ | | | |_ \ | ____|
|
||||
// | | | | | \__/ | | |____
|
||||
// |__| |__| \______/ |______|
|
||||
// file: UIPane.hx
|
||||
// author: and.schaafsma@gmail.com
|
||||
// purpose: Class for resizable and scalable UI Panels
|
||||
// My hope is that this code is so awful I'm never allowed to write UI code again.
|
||||
/*
|
||||
/ file: UIPane.hx
|
||||
/ author: and.schaafsma@gmail.com
|
||||
/ purpose: Class for resizable and scalable UI Panels
|
||||
/ My hope is that this code is so awful I'm never allowed to write UI code again.
|
||||
*/
|
||||
import game.ui.console.Console;
|
||||
import openfl.display.Sprite;
|
||||
import openfl.display.BitmapData;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user