Skip to content

Commit

Permalink
Implementation of Nils' UI work for updated theming, functionality an…
Browse files Browse the repository at this point in the history
…d style for the editors suite
  • Loading branch information
Areloch committed Sep 9, 2023
1 parent dc1d6e7 commit 33f35d3
Show file tree
Hide file tree
Showing 908 changed files with 15,324 additions and 3,008 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<ImageAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="Images_btn_Palette_h_image"
imageFile="@assetFile=btn_Palette_h.png"
AssetName="Images_btn_Palette_d_image"
imageFile="@assetFile=btn_Palette_d.png"
UseMips="true"
isHDRImage="false"
imageType="Albedo" />
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<ImageAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="Images_btn_Palette_n_image"
AssetName="Images_btn_Pallete_n_image"
imageFile="@assetFile=btn_Palette_n.png"
UseMips="true"
isHDRImage="false"
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<ImageAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="btn_VMovie_d_image"
imageFile="@assetFile=btn_VMovie_d.png"
UseMips="true"
isHDRImage="false"
imageType="Albedo" />
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<ImageAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="btn_VMovie_h_image"
imageFile="@assetFile=btn_VMovie_h.png"
UseMips="true"
isHDRImage="false"
imageType="Albedo" />
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<ImageAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="btn_VMovie_n_image"
imageFile="@assetFile=btn_VMovie_n.png"
UseMips="true"
isHDRImage="false"
imageType="Albedo" />
56 changes: 30 additions & 26 deletions Templates/BaseGame/game/tools/VPathEditor/GUI/VPathEditor.gui
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,19 @@ new VPathEditor(EVPathEditor) {
GizmoProfile = "GlobalGizmoProfile";

new GuiWindowCollapseCtrl(VPathEditorTreeWindow) {
canCollapse = "0";
canMove = "0";
internalName = "";
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "1";
Profile = "GuiWindowProfile";
Profile = "ToolsGuiWindowProfile";
HorizSizing = "windowRelative";
VertSizing = "windowRelative";
Position = getWord($pref::Video::mode, 0) - 209
SPC getWord(EditorGuiToolbar.extent, 1) - 1;
Extent = "210 167";
MinExtent = "210 100";
Position = getWord($pref::Video::mode, 0) - 360
SPC getWord(EditorGuiToolbar.extent, 1) + 6;
Extent = "360 167";
MinExtent = "300 100";
canSave = "1";
Visible = "1";
tooltipprofile = "GuiToolTipProfile";
Expand All @@ -63,14 +65,13 @@ new VPathEditor(EVPathEditor) {
AnchorRight = "0";
resizeWidth = "1";
resizeHeight = "1";
canMove = "1";
canClose = "0";
canMinimize = "0";
canMaximize = "0";
minSize = "50 50";
closeCommand = "EditorGui.setEditor( WorldEditorInspectorPlugin );";
EdgeSnap = "1";
text = "Path Editor";
text = ":: Verve Path Editor";

new GuiContainer(){
profile = GuiDefaultProfile;
Expand Down Expand Up @@ -149,7 +150,7 @@ new VPathEditor(EVPathEditor) {
Profile = "GuiButtonProfile";
HorizSizing = "left";
VertSizing = "bottom";
position = "193 4";
position = "339 4";
Extent = "16 16";
MinExtent = "8 2";
canSave = "1";
Expand All @@ -162,15 +163,15 @@ new VPathEditor(EVPathEditor) {
canSaveDynamicFields = "0";
};
new GuiBitmapButtonCtrl() {
bitmap = "core/gui/images/new";
bitmapAsset = "ToolsModule:new_n_image";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
isContainer = "0";
Profile = "GuiButtonProfile";
HorizSizing = "left";
VertSizing = "bottom";
position = "176 3";
position = "322 3";
Extent = "17 17";
MinExtent = "8 2";
canSave = "1";
Expand All @@ -184,17 +185,21 @@ new VPathEditor(EVPathEditor) {
};
};
new GuiWindowCollapseCtrl(VPathEditorOptionsWindow) {
canCollapse = "0";
canMove = "0";
canCollapse = "0";
canMove = "0";
internalName = "Window";
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "1";
Profile = "GuiWindowProfile";
Profile = "ToolsGuiWindowProfile";
HorizSizing = "windowRelative";
VertSizing = "windowRelative";
Position = getWord($pref::Video::mode, 0) - 209
SPC getWord(EditorGuiToolbar.extent, 1) + getWord(VPathEditorTreeWindow.extent, 1) - 2;
Extent = "210 530";
MinExtent = "210 298";
Position = getWord($pref::Video::mode, 0) - 360
SPC getWord(EditorGuiToolbar.extent, 1) + getWord(VPathEditorTreeWindow.extent, 1) + 6;
Extent = "360" SPC getWord($pref::Video::mode, 1) - getWord(VPathEditorTreeWindow.extent, 1) - getWord(EditorGuiToolbar.extent, 1) - 65;
MinExtent = "300 300";
canSave = "1";
Visible = "1";
tooltipprofile = "GuiToolTipProfile";
Expand All @@ -207,14 +212,13 @@ new VPathEditor(EVPathEditor) {
AnchorRight = "0";
resizeWidth = "1";
resizeHeight = "1";
canMove = "1";
canClose = "0";
canMinimize = "0";
canMaximize = "0";
minSize = "50 50";
closeCommand = "EditorGui.setEditor( WorldEditorPlugin );";
EdgeSnap = "1";
text = "Properties";
text = ":: Verve Path - Properties";

new GuiContainer(){ //Node Properties
isContainer = "1";
Expand All @@ -227,15 +231,15 @@ new VPathEditor(EVPathEditor) {
Margin = "3 3 3 3";

new GuiTextCtrl(){
Profile = "GuiDefaultProfile";
Profile = "EditorTextProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "5 0";
Extent = "86 18";
text = "Node Properties";
};
new GuiTextCtrl(){
Profile = "GuiTextRightProfile";
Profile = "ToolsGuiTextRightProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "7 21";
Expand All @@ -253,7 +257,7 @@ new VPathEditor(EVPathEditor) {
AltCommand = "EVPathEditor.setNodePosition( $ThisControl.getValue() );";
};
new GuiTextCtrl(){
Profile = "GuiTextRightProfile";
Profile = "ToolsGuiTextRightProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "7 42";
Expand All @@ -271,7 +275,7 @@ new VPathEditor(EVPathEditor) {
AltCommand = "EVPathEditor.setNodeRotation( $ThisControl.getValue() );";
};
new GuiTextCtrl(){
Profile = "GuiTextRightProfile";
Profile = "ToolsGuiTextRightProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "7 63";
Expand All @@ -289,7 +293,7 @@ new VPathEditor(EVPathEditor) {
AltCommand = "EVPathEditor.setNodeWeight( $ThisControl.getValue() );";
};
new GuiTextCtrl(){
Profile = "GuiTextRightProfile";
Profile = "ToolsGuiTextRightProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "7 84";
Expand All @@ -307,7 +311,7 @@ new VPathEditor(EVPathEditor) {
Command = "OnOrientationChanged();";
};
new GuiTextCtrl(){
Profile = "GuiTextRightProfile";
Profile = "ToolsGuiTextRightProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "7 105";
Expand Down Expand Up @@ -336,7 +340,7 @@ new VPathEditor(EVPathEditor) {
Margin = "0 0 3 3";

new GuiTextCtrl(){
Profile = "GuiDefaultProfile";
Profile = "ToolsGuiTextProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "5 0";
Expand Down Expand Up @@ -401,8 +405,8 @@ new VPathEditor(EVPathEditor) {
Profile = "GuiInspectorFieldInfoMLTextProfile";
HorizSizing = "width";
VertSizing = "top";
Position = "1 485";
Extent = "202 42";
position = "8" SPC getWord(VPathEditorOptionsWindow.extent, 1) - 40;
Extent = "330 42";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -224,5 +224,5 @@ function VPathInspector::onInspectorFieldModified( %this, %object, %fieldName, %

function VPathInspector::onFieldSelected( %this, %fieldName, %fieldTypeStr, %fieldDoc )
{
VPathFieldInfoControl.setText( "<font:Arial Bold:14>" @ %fieldName @ "<font:Arial Italic:14> (" @ %fieldTypeStr @ ") " NL "<font:Arial:14>" @ %fieldDoc );
VPathFieldInfoControl.setText( "<font:Arial Bold:14>" @ %fieldName @ "<font:Arial Italic:14> (" @ %fieldTypeStr @ ") " @ " : " @ "<font:Arial:14>" @ %fieldDoc );
}
121 changes: 121 additions & 0 deletions Templates/BaseGame/game/tools/VPathEditor/Scripts/GuiScript.tscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------

function EVPathEditor::maxSize(%this, %window)
{
// Resize the windows to the max height
// and force these to the right side if set
if(EditorSettings.value( "WorldEditor/forceSidebarToSide" ) == 1 && %this.resizing == true)
{
// prevent onResize after a resize
%this.resizing = false;

%fixedWindow = VPathEditorTreeWindow;
%fluidWindow = VPathEditorOptionsWindow;
%top = EditorGuiToolbar.extent.y + 6;
%bottom = %top + 65 - 6;
%maxHeight = Canvas.extent.y - %top - %bottom;

// --- Fixed window (top) ------------------------------------------------
// put it back if it moved
%fixedWindow.position.x = Canvas.extent.x - %fixedWindow.extent.x;
%fixedWindow.position.y = %top;

// don't go beyond the canvas
if(%fixedWindow.extent.y > %maxHeight)
%fixedWindow.extent.y = %maxHeight - %fluidWindow.extent.y;

%position = %fixedWindow.position.x SPC %fixedWindow.position.y;
%extent = %window.extent.x SPC %fixedWindow.extent.y;
%fixedWindow.resize(%position.x, %position.y, %extent.x, %extent.y);

// --- Fluid window (bottom) ---------------------------------------------
// position is relative to the top window
%position = %fixedWindow.position.x SPC %fixedWindow.extent.y + %top;
%extent = %window.extent.x SPC Canvas.extent.y - %fixedWindow.extent.y - %bottom;
%fluidWindow.resize(%position.x, %position.y, %extent.x, %extent.y);

// --- AssetBrowser window ----------------------------------------------
if(isObject(AssetBrowserWindow))
{
// Only resize the AssetBrowser if it's docked
if(AssetBrowserWindow.docked == true)
{
// The width is relative to the sidepanel
%browserWidth = Canvas.extent.x - %extent.x;
%browserHeight = AssetBrowserWindow.extent.y;
%browserPosY = Canvas.extent.y - AssetBrowserWindow.extent.y - 33;
AssetBrowserWindow.resize(0, %browserPosY, %browserWidth, %browserHeight);
}
}
// --- Windowed Console --------------------------------------------------
if(isObject(windowConsoleControl))
{
// Only resize the AssetBrowser if it's docked
if(windowConsoleControl.docked == true)
{
// The width is relative to the sidepanel
%consoleWidth = Canvas.extent.x - %extent.x;
%consoleHeight = windowConsoleControl.extent.y;
%consolePosY = Canvas.extent.y - windowConsoleControl.extent.y - 33;
windowConsoleControl.resize(0, %consolePosY, %consoleWidth, %consoleHeight);
}
}
}
}

function VPathEditorTreeWindow::onMouseDragged(%this)
{
%parent = EVPathEditor;

if(%parent.resizing == false)
{
%parent.resizing = true;
%parent.maxSize(%this);
}
}

function VPathEditorOptionsWindow::onMouseDragged(%this)
{
%parent = EVPathEditor;

if(%parent.resizing == false)
{
%parent.resizing = true;
%parent.maxSize(%this);
}
}

function EVPathEditor::onResize(%this, %newPosition, %newExtent)
{
// Window to focus on (mostly the fluid window)
%window = RoadEditorOptionsWindow;

if(%this.resizing == false)
{
// Only resize once
%this.resizing = true;
%this.maxSize(%window);
}

FieldInfoControl.position = 5 SPC EWInspectorWindow.extent.y - 40;
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,18 +36,18 @@ function VPathEditorPlugin::onWorldEditorStartup( %this )
//----------------------------------------------------------------------

// Add ourselves to the window menu.
%accel = EditorGui.addToEditorsMenu( "Path Editor", "", VPathEditorPlugin );
%accel = EditorGui.addToEditorsMenu( "Verve Path Editor", "", VPathEditorPlugin );

// Add ourselves to the ToolsToolbar
%tooltip = "Path Editor (" @ %accel @ ")";
EditorGui.addToToolsToolbar( "VPathEditorPlugin", "VPathEditorPalette", "ToolsModule:btn_Palette_n_image", %tooltip );
%tooltip = "Verve Path Editor (" @ %accel @ ")";
EditorGui.addToToolsToolbar( "VPathEditorPlugin", "VPathEditorPalette", "ToolsModule:btn_VMovie_n_image", %tooltip );

// Find and Store the Button.
%this.ToolbarButton = ToolsToolbarArray.findObjectByInternalName( "VPathEditorPalette", false );

// Extend Width.
%extent = EWToolsToolbar.getExtent();
EWToolsToolbar.setExtent( ( getWord( %extent, 0 ) + 33 ) SPC getWord( %extent, 1 ) );
EWToolsToolbar.setExtent( ( getWord( %extent, 0 ) + 32 ) SPC getWord( %extent, 1 ) );

//----------------------------------------------------------------------
//
Expand Down
1 change: 1 addition & 0 deletions Templates/BaseGame/game/tools/VPathEditor/main.tscript
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ function InitializeVPathEditor()
// Scripts.
exec( "./Scripts/Plugin." @ $TorqueScriptFileExtension );
exec( "./Scripts/Editor." @ $TorqueScriptFileExtension );
exec( "./Scripts/GuiScript." @ $TorqueScriptFileExtension );
}

function DestroyVPathEditor()
Expand Down
Loading

0 comments on commit 33f35d3

Please sign in to comment.