- [Graph Panel] Fix title of the non-active panel not updating when save all.

This commit is contained in:
Tanasart 2023-11-12 20:09:24 +07:00
parent 2fae5272a7
commit 2f73cc686d
10 changed files with 41 additions and 48 deletions

View file

@ -154,6 +154,7 @@
{"name":"pixel builder","order":149,"path":"folders/nodes/icons/pixel builder.yy",},
{"name":"render","order":140,"path":"folders/nodes/icons/render.yy",},
{"name":"rigidSim","order":146,"path":"folders/nodes/icons/rigidSim.yy",},
{"name":"smokeSim","order":150,"path":"folders/nodes/icons/smokeSim.yy",},
{"name":"strandSim","order":148,"path":"folders/nodes/icons/strandSim.yy",},
{"name":"transform","order":145,"path":"folders/nodes/icons/transform.yy",},
{"name":"value","order":144,"path":"folders/nodes/icons/value.yy",},
@ -224,7 +225,6 @@
{"name":"button","order":34,"path":"folders/widgets/button.yy",},
{"name":"rotator","order":35,"path":"folders/widgets/rotator.yy",},
{"name":"text","order":36,"path":"folders/widgets/text.yy",},
{"name":"smokeSim","order":150,"path":"folders/nodes/icons/smokeSim.yy",},
],
"ResourceOrderSettings": [
{"name":"s_node_corner","order":16,"path":"sprites/s_node_corner/s_node_corner.yy",},

View file

@ -151,8 +151,8 @@
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"effect","folderPath":"folders/nodes/data/pixel builder/effect.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"render","folderPath":"folders/nodes/data/render.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"simulation","folderPath":"folders/nodes/data/simulation.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"smokeSim","folderPath":"folders/nodes/data/simulation/smokeSim.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"rigidSim","folderPath":"folders/nodes/data/simulation/rigidSim.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"smokeSim","folderPath":"folders/nodes/data/simulation/smokeSim.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"strandSim","folderPath":"folders/nodes/data/simulation/strandSim.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"VFX","folderPath":"folders/nodes/data/simulation/VFX.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"affector","folderPath":"folders/nodes/data/simulation/VFX/affector.yy",},
@ -183,6 +183,7 @@
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"pixel builder","folderPath":"folders/nodes/icons/pixel builder.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"render","folderPath":"folders/nodes/icons/render.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"rigidSim","folderPath":"folders/nodes/icons/rigidSim.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"smokeSim","folderPath":"folders/nodes/icons/smokeSim.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"strandSim","folderPath":"folders/nodes/icons/strandSim.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"transform","folderPath":"folders/nodes/icons/transform.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"value","folderPath":"folders/nodes/icons/value.yy",},
@ -258,7 +259,6 @@
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"button","folderPath":"folders/widgets/button.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"rotator","folderPath":"folders/widgets/rotator.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"text","folderPath":"folders/widgets/text.yy",},
{"resourceType":"GMFolder","resourceVersion":"1.0","name":"smokeSim","folderPath":"folders/nodes/icons/smokeSim.yy",},
],
"IncludedFiles": [
{"resourceType":"GMIncludedFile","resourceVersion":"1.0","name":"ApolloHelp.html","ConfigValues":{"Itch":{"CopyToMask":"0",},},"CopyToMask":-1,"filePath":"datafiles",},

View file

@ -371,15 +371,7 @@ event_inherited();
return 0;
}
var node_count = ds_list_size(_list);
//if(ADD_NODE_PAGE == NODE_PAGE_DEFAULT && array_length(global.FAV_NODES) == 0) {
// draw_set_text(f_h3, fa_center, fa_bottom, COLORS._main_text_sub);
// draw_text(content_pane.w / 2, content_pane.h / 2 - ui(8), "No favorites");
// draw_set_text(f_p0, fa_center, fa_top, COLORS._main_text_sub);
// draw_text(content_pane.w / 2, content_pane.h / 2 - ui(4), "Right click on a node and select 'Add to favorite'\nto add node to favorite panel.");
//}
var node_count = ds_list_size(_list);
var group_labels = [];
if(PREFERENCES.dialog_add_node_view == 0) { //grid
@ -422,18 +414,17 @@ event_inherited();
var _nx = grid_space + (grid_width + grid_space) * cProg;
var _boxx = _nx + (grid_width - grid_size) / 2;
var cc = c_white;
if(is_instanceof(_node, NodeObject)) cc = c_white;
else if(is_instanceof(_node, NodeAction)) cc = COLORS.add_node_blend_action;
else if(is_instanceof(_node, AddNodeItem)) cc = COLORS.add_node_blend_generic;
else cc = COLORS.dialog_add_node_collection;
BLEND_OVERRIDE
draw_sprite_stretched_ext(THEME.node_bg, 0, _boxx, yy, grid_size, grid_size, cc, 1);
BLEND_NORMAL
BLEND_OVERRIDE;
if(is_instanceof(_node, NodeObject))
draw_sprite_stretched(THEME.node_bg, 0, _boxx, yy, grid_size, grid_size);
else if(is_instanceof(_node, NodeAction))
draw_sprite_stretched_ext(THEME.node_bg, 0, _boxx, yy, grid_size, grid_size, COLORS.add_node_blend_action, 1);
else if(is_instanceof(_node, AddNodeItem))
draw_sprite_stretched_ext(THEME.node_bg, 0, _boxx, yy, grid_size, grid_size, COLORS.add_node_blend_generic, 1);
else
draw_sprite_stretched_ext(THEME.node_bg, 0, _boxx, yy, grid_size, grid_size, COLORS.dialog_add_node_collection, 1);
BLEND_NORMAL;
if(_hover && point_in_rectangle(_m[0], _m[1], _nx, yy, _nx + grid_width, yy + grid_size)) {
draw_sprite_stretched_ext(THEME.node_active, 0, _boxx, yy, grid_size, grid_size, COLORS._main_accent, 1);
if(mouse_press(mb_left, sFOCUS))
@ -477,10 +468,12 @@ event_inherited();
if(fav) draw_sprite_ui_uniform(THEME.star, 0, _boxx + grid_size - ui(10), yy + grid_size - ui(10), 0.7, COLORS._main_accent, 1.);
}
draw_set_text(f_p2, fa_center, fa_top, COLORS._main_text);
draw_text_ext_add(_boxx + grid_size / 2, yy + grid_size + 4, _node.getName(), -1, grid_width);
var _name = _node.getName();
var name_height = string_height_ext(_node.getName(), -1, grid_width) + 8;
draw_set_text(f_p2, fa_center, fa_top, COLORS._main_text);
draw_text_ext_add(_boxx + grid_size / 2, yy + grid_size + 4, _name, -1, grid_width);
var name_height = string_height_ext(_name, -1, grid_width - 4) + 8;
curr_height = max(curr_height, grid_size + grid_space + name_height);
if(++cProg >= col) {

View file

@ -297,7 +297,8 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
function stepBegin() { #region
var con = getContent();
if(con) con.panelStepBegin(self);
for( var i = 0, n = array_length(content); i < n; i++ )
content[i].panelStepBegin(self);
if(o_main.panel_dragging != noone) dragging = -1;
@ -385,19 +386,15 @@ function Panel(_parent, _x, _y, _w, _h) constructor {
if(FOCUS == self && con)
FOCUS_STR = con.context_str;
} else {
for(var i = 0; i < ds_list_size(childs); i++) {
var _panel = childs[| i];
_panel.stepBegin();
}
for(var i = 0; i < ds_list_size(childs); i++)
childs[| i].stepBegin();
}
}
} #endregion
static step = function() { #region
for(var i = 0; i < ds_list_size(childs); i++) {
var _panel = childs[| i];
_panel.step();
}
for(var i = 0; i < ds_list_size(childs); i++)
childs[| i].step();
} #endregion
static draw = function() { #region

View file

@ -2,6 +2,7 @@
/// @param {Struct.Project}
function Panel_Graph(project = PROJECT) : PanelContent() constructor {
title = __txt("Graph");
title_raw = "";
context_str = "Graph";
icon = THEME.panel_graph;
@ -542,6 +543,8 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
mouse_grid_x = round(m_x / project.graphGrid.size) * project.graphGrid.size;
mouse_grid_y = round(m_y / project.graphGrid.size) * project.graphGrid.size;
setTitle();
} #endregion
function focusNode(_node) { #region
@ -1284,9 +1287,6 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
ds_list_delete(node_context, j);
nodes_list = node_context[| i].getNodeList();
toCenterNode();
var node = getCurrentContext();
title = node.display_name == ""? node.name : node.display_name;
break;
}
}
@ -1501,16 +1501,19 @@ function Panel_Graph(project = PROJECT) : PanelContent() constructor {
context_frame_ey = context_frame_sy + 16;
} #endregion
function setTitle() { #region
title = title_raw + (project.modified? "*" : "");
} #endregion
function drawContent(panel) { #region >>>>>>>>>>>>>>>>>>>> MAIN DRAW <<<<<<<<<<<<<<<<<<<<
if(!project.active) return;
if(project.path == "") title = "New project";
else title = filename_name_only(project.path);
title += project.modified? "*" : "";
if(project.path == "") title_raw = "New project";
else title_raw = filename_name_only(project.path);
dragGraph();
var context = getCurrentContext();
if(context != noone) title += " > " + (context.display_name == ""? context.name : context.display_name);
if(context != noone) title_raw += " > " + (context.display_name == ""? context.name : context.display_name);
bg_color = context == noone? COLORS.panel_bg_clear : merge_color(COLORS.panel_bg_clear, context.getColor(), 0.05);
draw_clear(bg_color);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

View file

@ -2,10 +2,10 @@
"resourceType": "GMSprite",
"resourceVersion": "1.0",
"name": "s_node_3d_point_affector",
"bbox_bottom": 59,
"bbox_left": 4,
"bbox_bottom": 61,
"bbox_left": 2,
"bbox_right": 61,
"bbox_top": 4,
"bbox_top": 2,
"bboxMode": 0,
"collisionKind": 1,
"collisionTolerance": 0,
@ -13,14 +13,14 @@
"edgeFiltering": false,
"For3D": false,
"frames": [
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"cc497e53-a320-436d-8b85-1c4873ebfb1f",},
{"resourceType":"GMSpriteFrame","resourceVersion":"1.1","name":"eb554c28-3115-4dc4-b7a4-5722656750cb",},
],
"gridX": 0,
"gridY": 0,
"height": 64,
"HTile": false,
"layers": [
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"605130f5-1c72-488d-a143-43e833223f94","blendMode":0,"displayName":"default","isLocked":false,"opacity":100.0,"visible":true,},
{"resourceType":"GMImageLayer","resourceVersion":"1.0","name":"1da6641f-3dd1-4c05-86d8-073a2246c097","blendMode":0,"displayName":"default","isLocked":false,"opacity":100.0,"visible":true,},
],
"nineSlice": null,
"origin": 4,
@ -54,7 +54,7 @@
"timeUnits": 1,
"tracks": [
{"resourceType":"GMSpriteFramesTrack","resourceVersion":"1.0","name":"frames","builtinName":0,"events":[],"inheritsTrackColour":true,"interpolation":1,"isCreationTrack":false,"keyframes":{"resourceType":"KeyframeStore<SpriteFrameKeyframe>","resourceVersion":"1.0","Keyframes":[
{"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"cc497e53-a320-436d-8b85-1c4873ebfb1f","path":"sprites/s_node_3d_point_affector/s_node_3d_point_affector.yy",},},},"Disabled":false,"id":"6911bb1c-bfd2-4198-99a8-786a0aa40e79","IsCreationKey":false,"Key":0.0,"Length":1.0,"Stretch":false,},
{"resourceType":"Keyframe<SpriteFrameKeyframe>","resourceVersion":"1.0","Channels":{"0":{"resourceType":"SpriteFrameKeyframe","resourceVersion":"1.0","Id":{"name":"eb554c28-3115-4dc4-b7a4-5722656750cb","path":"sprites/s_node_3d_point_affector/s_node_3d_point_affector.yy",},},},"Disabled":false,"id":"9d748969-b939-42fd-ab06-85253e6d7bd4","IsCreationKey":false,"Key":0.0,"Length":1.0,"Stretch":false,},
],},"modifiers":[],"spriteId":null,"trackColour":0,"tracks":[],"traits":0,},
],
"visibleRange": null,