mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2025-02-15 22:55:13 +01:00
gmroom resize
This commit is contained in:
parent
6457706823
commit
cba206ba16
15 changed files with 169 additions and 77 deletions
|
@ -483,9 +483,9 @@
|
||||||
{"name":"BBMOD_Vec3","order":5,"path":"scripts/BBMOD_Vec3/BBMOD_Vec3.yy",},
|
{"name":"BBMOD_Vec3","order":5,"path":"scripts/BBMOD_Vec3/BBMOD_Vec3.yy",},
|
||||||
{"name":"BBMOD_Vec4","order":6,"path":"scripts/BBMOD_Vec4/BBMOD_Vec4.yy",},
|
{"name":"BBMOD_Vec4","order":6,"path":"scripts/BBMOD_Vec4/BBMOD_Vec4.yy",},
|
||||||
{"name":"bin_function","order":11,"path":"scripts/bin_function/bin_function.yy",},
|
{"name":"bin_function","order":11,"path":"scripts/bin_function/bin_function.yy",},
|
||||||
{"name":"binder_gamemaker_room","order":5,"path":"scripts/binder_gamemaker_room/binder_gamemaker_room.yy",},
|
{"name":"binder_gamemaker_room","order":8,"path":"scripts/binder_gamemaker_room/binder_gamemaker_room.yy",},
|
||||||
{"name":"binder_gamemaker_tile","order":4,"path":"scripts/binder_gamemaker_tile/binder_gamemaker_tile.yy",},
|
{"name":"binder_gamemaker_tile","order":7,"path":"scripts/binder_gamemaker_tile/binder_gamemaker_tile.yy",},
|
||||||
{"name":"binder_gamemaker","order":3,"path":"scripts/binder_gamemaker/binder_gamemaker.yy",},
|
{"name":"binder_gamemaker","order":6,"path":"scripts/binder_gamemaker/binder_gamemaker.yy",},
|
||||||
{"name":"biterator","order":1,"path":"scripts/biterator/biterator.yy",},
|
{"name":"biterator","order":1,"path":"scripts/biterator/biterator.yy",},
|
||||||
{"name":"buffer_object","order":1,"path":"scripts/buffer_object/buffer_object.yy",},
|
{"name":"buffer_object","order":1,"path":"scripts/buffer_object/buffer_object.yy",},
|
||||||
{"name":"buttonAnchor","order":5,"path":"scripts/buttonAnchor/buttonAnchor.yy",},
|
{"name":"buttonAnchor","order":5,"path":"scripts/buttonAnchor/buttonAnchor.yy",},
|
||||||
|
@ -635,7 +635,7 @@
|
||||||
{"name":"function_register","order":2,"path":"scripts/function_register/function_register.yy",},
|
{"name":"function_register","order":2,"path":"scripts/function_register/function_register.yy",},
|
||||||
{"name":"fx_controller","order":1,"path":"scripts/fx_controller/fx_controller.yy",},
|
{"name":"fx_controller","order":1,"path":"scripts/fx_controller/fx_controller.yy",},
|
||||||
{"name":"gameframe","order":3,"path":"scripts/gameframe/gameframe.yy",},
|
{"name":"gameframe","order":3,"path":"scripts/gameframe/gameframe.yy",},
|
||||||
{"name":"gamemakerPathBox","order":6,"path":"scripts/gamemakerPathBox/gamemakerPathBox.yy",},
|
{"name":"gamemakerPathBox","order":9,"path":"scripts/gamemakerPathBox/gamemakerPathBox.yy",},
|
||||||
{"name":"getGradientData","order":1,"path":"scripts/getGradientData/getGradientData.yy",},
|
{"name":"getGradientData","order":1,"path":"scripts/getGradientData/getGradientData.yy",},
|
||||||
{"name":"gif_reader","order":4,"path":"scripts/gif_reader/gif_reader.yy",},
|
{"name":"gif_reader","order":4,"path":"scripts/gif_reader/gif_reader.yy",},
|
||||||
{"name":"globals","order":2,"path":"scripts/globals/globals.yy",},
|
{"name":"globals","order":2,"path":"scripts/globals/globals.yy",},
|
||||||
|
@ -858,7 +858,7 @@
|
||||||
{"name":"node_gamma_map","order":15,"path":"scripts/node_gamma_map/node_gamma_map.yy",},
|
{"name":"node_gamma_map","order":15,"path":"scripts/node_gamma_map/node_gamma_map.yy",},
|
||||||
{"name":"node_global","order":3,"path":"scripts/node_global/node_global.yy",},
|
{"name":"node_global","order":3,"path":"scripts/node_global/node_global.yy",},
|
||||||
{"name":"node_glow","order":11,"path":"scripts/node_glow/node_glow.yy",},
|
{"name":"node_glow","order":11,"path":"scripts/node_glow/node_glow.yy",},
|
||||||
{"name":"node_gm_room","order":1,"path":"scripts/node_gm_room/node_gm_room.yy",},
|
{"name":"node_gm_room","order":4,"path":"scripts/node_gm_room/node_gm_room.yy",},
|
||||||
{"name":"node_gradient_extract","order":13,"path":"scripts/node_gradient_extract/node_gradient_extract.yy",},
|
{"name":"node_gradient_extract","order":13,"path":"scripts/node_gradient_extract/node_gradient_extract.yy",},
|
||||||
{"name":"node_gradient_out","order":5,"path":"scripts/node_gradient_out/node_gradient_out.yy",},
|
{"name":"node_gradient_out","order":5,"path":"scripts/node_gradient_out/node_gradient_out.yy",},
|
||||||
{"name":"node_gradient_palette","order":11,"path":"scripts/node_gradient_palette/node_gradient_palette.yy",},
|
{"name":"node_gradient_palette","order":11,"path":"scripts/node_gradient_palette/node_gradient_palette.yy",},
|
||||||
|
@ -1288,7 +1288,7 @@
|
||||||
{"name":"panel_file_explorer","order":12,"path":"scripts/panel_file_explorer/panel_file_explorer.yy",},
|
{"name":"panel_file_explorer","order":12,"path":"scripts/panel_file_explorer/panel_file_explorer.yy",},
|
||||||
{"name":"panel_function","order":1,"path":"scripts/panel_function/panel_function.yy",},
|
{"name":"panel_function","order":1,"path":"scripts/panel_function/panel_function.yy",},
|
||||||
{"name":"panel_globalvar","order":1,"path":"scripts/panel_globalvar/panel_globalvar.yy",},
|
{"name":"panel_globalvar","order":1,"path":"scripts/panel_globalvar/panel_globalvar.yy",},
|
||||||
{"name":"panel_gm_explorer","order":2,"path":"scripts/panel_gm_explorer/panel_gm_explorer.yy",},
|
{"name":"panel_gm_explorer","order":5,"path":"scripts/panel_gm_explorer/panel_gm_explorer.yy",},
|
||||||
{"name":"panel_gradient","order":2,"path":"scripts/panel_gradient/panel_gradient.yy",},
|
{"name":"panel_gradient","order":2,"path":"scripts/panel_gradient/panel_gradient.yy",},
|
||||||
{"name":"panel_graph_auto_organize","order":10,"path":"scripts/panel_graph_auto_organize/panel_graph_auto_organize.yy",},
|
{"name":"panel_graph_auto_organize","order":10,"path":"scripts/panel_graph_auto_organize/panel_graph_auto_organize.yy",},
|
||||||
{"name":"panel_graph_connection_settings","order":6,"path":"scripts/panel_graph_connection_settings/panel_graph_connection_settings.yy",},
|
{"name":"panel_graph_connection_settings","order":6,"path":"scripts/panel_graph_connection_settings/panel_graph_connection_settings.yy",},
|
||||||
|
@ -1975,8 +1975,8 @@
|
||||||
{"name":"s_gear_24","order":69,"path":"sprites/s_gear_24/s_gear_24.yy",},
|
{"name":"s_gear_24","order":69,"path":"sprites/s_gear_24/s_gear_24.yy",},
|
||||||
{"name":"s_gizmo","order":4,"path":"sprites/s_gizmo/s_gizmo.yy",},
|
{"name":"s_gizmo","order":4,"path":"sprites/s_gizmo/s_gizmo.yy",},
|
||||||
{"name":"s_globe","order":233,"path":"sprites/s_globe/s_globe.yy",},
|
{"name":"s_globe","order":233,"path":"sprites/s_globe/s_globe.yy",},
|
||||||
{"name":"s_gmlayer","order":4,"path":"sprites/s_gmlayer/s_gmlayer.yy",},
|
{"name":"s_gmlayer","order":2,"path":"sprites/s_gmlayer/s_gmlayer.yy",},
|
||||||
{"name":"s_gmroom","order":3,"path":"sprites/s_gmroom/s_gmroom.yy",},
|
{"name":"s_gmroom","order":1,"path":"sprites/s_gmroom/s_gmroom.yy",},
|
||||||
{"name":"s_grad_blend","order":70,"path":"sprites/s_grad_blend/s_grad_blend.yy",},
|
{"name":"s_grad_blend","order":70,"path":"sprites/s_grad_blend/s_grad_blend.yy",},
|
||||||
{"name":"s_gradient_mask","order":12,"path":"sprites/s_gradient_mask/s_gradient_mask.yy",},
|
{"name":"s_gradient_mask","order":12,"path":"sprites/s_gradient_mask/s_gradient_mask.yy",},
|
||||||
{"name":"s_graph","order":71,"path":"sprites/s_graph/s_graph.yy",},
|
{"name":"s_graph","order":71,"path":"sprites/s_graph/s_graph.yy",},
|
||||||
|
|
|
@ -103,6 +103,7 @@
|
||||||
{"$GMFolder":"","%Name":"window","folderPath":"folders/functions/window.yy","name":"window","resourceType":"GMFolder","resourceVersion":"2.0",},
|
{"$GMFolder":"","%Name":"window","folderPath":"folders/functions/window.yy","name":"window","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
{"$GMFolder":"","%Name":"game engines","folderPath":"folders/game engines.yy","name":"game engines","resourceType":"GMFolder","resourceVersion":"2.0",},
|
{"$GMFolder":"","%Name":"game engines","folderPath":"folders/game engines.yy","name":"game engines","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
{"$GMFolder":"","%Name":"gamemaker","folderPath":"folders/game engines/gamemaker.yy","name":"gamemaker","resourceType":"GMFolder","resourceVersion":"2.0",},
|
{"$GMFolder":"","%Name":"gamemaker","folderPath":"folders/game engines/gamemaker.yy","name":"gamemaker","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
|
{"$GMFolder":"","%Name":"spr","folderPath":"folders/game engines/gamemaker/spr.yy","name":"spr","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
{"$GMFolder":"","%Name":"main","folderPath":"folders/main.yy","name":"main","resourceType":"GMFolder","resourceVersion":"2.0",},
|
{"$GMFolder":"","%Name":"main","folderPath":"folders/main.yy","name":"main","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
{"$GMFolder":"","%Name":"components","folderPath":"folders/main/components.yy","name":"components","resourceType":"GMFolder","resourceVersion":"2.0",},
|
{"$GMFolder":"","%Name":"components","folderPath":"folders/main/components.yy","name":"components","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
{"$GMFolder":"","%Name":"misc","folderPath":"folders/misc.yy","name":"misc","resourceType":"GMFolder","resourceVersion":"2.0",},
|
{"$GMFolder":"","%Name":"misc","folderPath":"folders/misc.yy","name":"misc","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||||
|
|
|
@ -30,7 +30,6 @@ event_inherited();
|
||||||
|
|
||||||
display_grid_size = ui(64);
|
display_grid_size = ui(64);
|
||||||
display_grid_size_to = display_grid_size;
|
display_grid_size_to = display_grid_size;
|
||||||
|
|
||||||
display_list_size = ui(28);
|
display_list_size = ui(28);
|
||||||
display_list_size_to = display_list_size;
|
display_list_size_to = display_list_size;
|
||||||
|
|
||||||
|
@ -61,7 +60,8 @@ event_inherited();
|
||||||
var name = __txt(cat.name);
|
var name = __txt(cat.name);
|
||||||
maxLen = max(maxLen, string_width(name));
|
maxLen = max(maxLen, string_width(name));
|
||||||
}
|
}
|
||||||
category_width = maxLen + ui(56);
|
|
||||||
|
category_width = maxLen + ui(32);
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
function isTop() { return true; }
|
function isTop() { return true; }
|
||||||
|
@ -305,7 +305,7 @@ event_inherited();
|
||||||
catagory_pane = new scrollPane(category_width, dialog_h - ui(66), function(_y, _m) {
|
catagory_pane = new scrollPane(category_width, dialog_h - ui(66), function(_y, _m) {
|
||||||
draw_clear_alpha(COLORS._main_text, 0);
|
draw_clear_alpha(COLORS._main_text, 0);
|
||||||
|
|
||||||
var ww = category_width - ui(32);
|
var ww = catagory_pane.surface_w;
|
||||||
var hh = 0;
|
var hh = 0;
|
||||||
var hg = ui(28);
|
var hg = ui(28);
|
||||||
|
|
||||||
|
@ -394,9 +394,12 @@ event_inherited();
|
||||||
|
|
||||||
return hh;
|
return hh;
|
||||||
});
|
});
|
||||||
|
catagory_pane.scroll_color_bg = undefined;
|
||||||
|
catagory_pane.scroll_color_bar_alpha = .5;
|
||||||
|
|
||||||
content_pane = new scrollPane(dialog_w - category_width - ui(8), dialog_h - ui(66), function(_y, _m) {
|
content_pane = new scrollPane(dialog_w - category_width - ui(34), dialog_h - ui(66), function(_y, _m) {
|
||||||
draw_clear_alpha(c_white, 0);
|
draw_clear_alpha(c_white, 0);
|
||||||
|
|
||||||
var _hover = sHOVER && content_pane.hover;
|
var _hover = sHOVER && content_pane.hover;
|
||||||
var _focus = sFOCUS && content_pane.active;
|
var _focus = sFOCUS && content_pane.active;
|
||||||
var _list = node_list;
|
var _list = node_list;
|
||||||
|
@ -823,9 +826,11 @@ event_inherited();
|
||||||
dialog_h_max = ui(800);
|
dialog_h_max = ui(800);
|
||||||
|
|
||||||
onResize = function() {
|
onResize = function() {
|
||||||
catagory_pane.resize(category_width, dialog_h - ui(66));
|
var _ch = dialog_h - ui(66);
|
||||||
content_pane.resize(dialog_w - category_width - ui(8), dialog_h - ui(66));
|
|
||||||
search_pane.resize(dialog_w - ui(36), dialog_h - ui(66));
|
catagory_pane.resize( category_width, _ch);
|
||||||
|
content_pane.resize( dialog_w - category_width - ui(34), _ch);
|
||||||
|
search_pane.resize( dialog_w - ui(36), _ch);
|
||||||
|
|
||||||
PREFERENCES.dialog_add_node_w = dialog_w;
|
PREFERENCES.dialog_add_node_w = dialog_w;
|
||||||
PREFERENCES.dialog_add_node_h = dialog_h;
|
PREFERENCES.dialog_add_node_h = dialog_h;
|
||||||
|
|
|
@ -14,21 +14,23 @@ if !ready exit;
|
||||||
var th = ui(32);
|
var th = ui(32);
|
||||||
var tx = dialog_x + ui(14);
|
var tx = dialog_x + ui(14);
|
||||||
var ty = dialog_y + ui(14);
|
var ty = dialog_y + ui(14);
|
||||||
|
var sy = ty + th + ui(6);
|
||||||
|
|
||||||
if(search_string == "") {
|
if(search_string == "") {
|
||||||
catagory_pane.setFocusHover(sFOCUS, sHOVER);
|
catagory_pane.setFocusHover(sFOCUS, sHOVER);
|
||||||
catagory_pane.draw(dialog_x + ui(14), dialog_y + ui(52));
|
catagory_pane.draw(dialog_x + ui(8), sy);
|
||||||
|
|
||||||
var _x = dialog_x + category_width - ui(12);
|
var _x = dialog_x + category_width + ui(16);
|
||||||
draw_sprite_stretched(THEME.ui_panel_bg, 1, _x, dialog_y + ui(52), dialog_w - category_width - ui(2), dialog_h - ui(66));
|
draw_sprite_stretched(THEME.ui_panel_bg, 1, _x, sy, dialog_w - category_width - ui(28), dialog_h - ui(66));
|
||||||
content_pane.setFocusHover(sFOCUS, sHOVER);
|
content_pane.setFocusHover(sFOCUS, sHOVER);
|
||||||
content_pane.draw(_x, dialog_y + ui(52));
|
content_pane.draw(_x, sy);
|
||||||
|
|
||||||
node_selecting = 0;
|
node_selecting = 0;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
draw_sprite_stretched(THEME.ui_panel_bg, 1, dialog_x + ui(14), dialog_y + ui(52), dialog_w - ui(28), dialog_h - ui(66));
|
draw_sprite_stretched(THEME.ui_panel_bg, 1, dialog_x + ui(14), sy, dialog_w - ui(28), dialog_h - ui(66));
|
||||||
search_pane.setFocusHover(sFOCUS, sHOVER);
|
search_pane.setFocusHover(sFOCUS, sHOVER);
|
||||||
search_pane.draw(dialog_x + ui(16), dialog_y + ui(52));
|
search_pane.draw(dialog_x + ui(16), sy);
|
||||||
|
|
||||||
tw -= ui(32);
|
tw -= ui(32);
|
||||||
}
|
}
|
||||||
|
|
|
@ -204,8 +204,8 @@ function __Binder_Gamemaker(path) constructor {
|
||||||
if(_asst == noone) continue;
|
if(_asst == noone) continue;
|
||||||
|
|
||||||
if(struct_has(resourcesMap, _rpth)) {
|
if(struct_has(resourcesMap, _rpth)) {
|
||||||
struct_override(resourcesMap, _asst);
|
struct_override(resourcesMap[$ _rpth], _asst);
|
||||||
_asst = resourcesMap;
|
_asst = resourcesMap[$ _rpth];
|
||||||
}
|
}
|
||||||
|
|
||||||
resMap[$ _rpth] = _asst;
|
resMap[$ _rpth] = _asst;
|
||||||
|
|
|
@ -124,15 +124,19 @@ function GMRoom_Background(_room, _gm, _raw) : GMRoom_Layer(_room, _gm, _raw) co
|
||||||
spr = noone;
|
spr = noone;
|
||||||
|
|
||||||
static link = function() {
|
static link = function() {
|
||||||
spr = gmBinder.getResourceFromPath(struct_try_get(raw.spriteId, "path"));
|
spr = is_struct(raw.spriteId)? gmBinder.getResourceFromPath(struct_try_get(raw.spriteId, "path")) : noone;
|
||||||
}
|
}
|
||||||
|
|
||||||
static doRefreshPreview = function() {
|
static doRefreshPreview = function() {
|
||||||
|
var _c = raw.colour;
|
||||||
|
|
||||||
if(spr != noone && spr.thumbnail != noone) {
|
if(spr != noone && spr.thumbnail != noone) {
|
||||||
if(raw.htiled || raw.vtiled)
|
var _t = raw.htiled || raw.vtiled;
|
||||||
draw_sprite_tiled(spr.thumbnail, 0, 0, 0);
|
if(_t) draw_sprite_tiled_ext(spr.thumbnail, 0, 0, 0, 1, 1, _c, 1);
|
||||||
else
|
else draw_sprite_ext(spr.thumbnail, 0, 0, 0, 1, 1, 0, _c, 1);
|
||||||
draw_sprite(spr.thumbnail, 0, 0, 0);
|
|
||||||
|
} else {
|
||||||
|
draw_clear(_c);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,7 +11,60 @@ function GMRoom_Tile(_room, _gm, _raw) : GMRoom_Layer(_room, _gm, _raw) construc
|
||||||
}
|
}
|
||||||
|
|
||||||
static doRefreshPreview = function() {
|
static doRefreshPreview = function() {
|
||||||
|
if(tileset == noone || tileset.spriteObject == noone) return;
|
||||||
|
|
||||||
|
var _form = struct_try_get(tiles, "TileDataFormat", 0);
|
||||||
|
var _ow = tiles.SerialiseWidth;
|
||||||
|
var _oh = tiles.SerialiseHeight;
|
||||||
|
|
||||||
|
var _spr = tileset.spriteObject;
|
||||||
|
var _tw = tileset.raw.tileWidth;
|
||||||
|
var _th = tileset.raw.tileHeight;
|
||||||
|
if(_spr.thumbnail == noone) return;
|
||||||
|
|
||||||
|
var _tile = _spr.thumbnail;
|
||||||
|
var _col = ceil(_spr.raw.width / _tw);
|
||||||
|
var _data = getArray();
|
||||||
|
var _i = 0;
|
||||||
|
|
||||||
|
for( var i = 0; i < _oh; i++ )
|
||||||
|
for( var j = 0; j < _ow; j++ ) {
|
||||||
|
var _in = _data[_i++];
|
||||||
|
if(_in <= 0) continue;
|
||||||
|
|
||||||
|
var _gx = j * _tw;
|
||||||
|
var _gy = i * _th;
|
||||||
|
|
||||||
|
var _tix = _tw * _in % _col;
|
||||||
|
var _tiy = _th * floor(_in / _col);
|
||||||
|
|
||||||
|
draw_sprite_part(_tile, 0, _tix, _tiy, _tw, _th, _gx, _gy);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
static getArray = function() {
|
||||||
|
var _form = struct_try_get(tiles, "TileDataFormat", 0);
|
||||||
|
var _ow = tiles.SerialiseWidth;
|
||||||
|
var _oh = tiles.SerialiseHeight;
|
||||||
|
var _data = array_create(_ow * _oh);
|
||||||
|
|
||||||
|
if(_form == 0) {
|
||||||
|
_data = tiles.TileSerialiseData;
|
||||||
|
|
||||||
|
} else if(_form == 1) {
|
||||||
|
var _d = tiles.TileCompressedData;
|
||||||
|
var _amo, _til, _i = 0;
|
||||||
|
|
||||||
|
for( var i = 0, n = array_length(_d); i < n; i += 2 ) {
|
||||||
|
_amo = -_d[i + 0];
|
||||||
|
_til = _d[i + 1];
|
||||||
|
_til = max(0, _til + bool(_til));
|
||||||
|
|
||||||
|
repeat(_amo) _data[_i++] = _til;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return _data;
|
||||||
}
|
}
|
||||||
|
|
||||||
static setArray = function(arr) {
|
static setArray = function(arr) {
|
||||||
|
@ -45,8 +98,6 @@ function GMRoom_Tile(_room, _gm, _raw) : GMRoom_Layer(_room, _gm, _raw) construc
|
||||||
}
|
}
|
||||||
|
|
||||||
static resizeBBOX = function(bbox) {
|
static resizeBBOX = function(bbox) {
|
||||||
var _form = struct_try_get(tiles, "TileDataFormat", 0);
|
|
||||||
|
|
||||||
var _ow = tiles.SerialiseWidth;
|
var _ow = tiles.SerialiseWidth;
|
||||||
var _oh = tiles.SerialiseHeight;
|
var _oh = tiles.SerialiseHeight;
|
||||||
|
|
||||||
|
@ -57,23 +108,7 @@ function GMRoom_Tile(_room, _gm, _raw) : GMRoom_Layer(_room, _gm, _raw) construc
|
||||||
|
|
||||||
var _grdo = ds_grid_create(_ow, _oh);
|
var _grdo = ds_grid_create(_ow, _oh);
|
||||||
var _grdn = ds_grid_create(_nw, _nh);
|
var _grdn = ds_grid_create(_nw, _nh);
|
||||||
var _data;
|
var _data = getArray();
|
||||||
|
|
||||||
if(_form == 0) {
|
|
||||||
_data = tiles.TileSerialiseData;
|
|
||||||
|
|
||||||
} else if(_form == 1) {
|
|
||||||
var _d = tiles.TileCompressedData;
|
|
||||||
var _amo, _til, _i = 0;
|
|
||||||
|
|
||||||
for( var i = 0, n = array_length(_d); i < n; i += 2 ) {
|
|
||||||
_amo = -_d[i + 0];
|
|
||||||
_til = _d[i + 1];
|
|
||||||
_til = max(0, _til + bool(_til));
|
|
||||||
|
|
||||||
repeat(_amo) _data[_i++] = _til;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
var _i = 0;
|
var _i = 0;
|
||||||
for( var i = 0; i < _oh; i++ )
|
for( var i = 0; i < _oh; i++ )
|
||||||
|
|
|
@ -27,7 +27,7 @@ function Node_Color_replace(_x, _y, _group = noone) : Node_Processor(_x, _y, _gr
|
||||||
|
|
||||||
__init_mask_modifier(7); // inputs 11, 12
|
__init_mask_modifier(7); // inputs 11, 12
|
||||||
|
|
||||||
newInput(13, nodeValue_Enum_Scroll("Mode", self, 0, [ "Closet", "Random" ]));
|
newInput(13, nodeValue_Enum_Scroll("Mode", self, 0, [ "Closest", "Random" ]));
|
||||||
|
|
||||||
newInput(14, nodeValueSeed(self));
|
newInput(14, nodeValueSeed(self));
|
||||||
|
|
||||||
|
|
|
@ -24,6 +24,7 @@ function Node_GMRoom(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
|
|
||||||
room_resize_apply = button( function() { applyResizeRoom(); } ).setIcon(THEME.toolbar_check, 0);
|
room_resize_apply = button( function() { applyResizeRoom(); } ).setIcon(THEME.toolbar_check, 0);
|
||||||
room_resize_cancel = button( function() { room_resizing = false; } ).setIcon(THEME.toolbar_check, 1);
|
room_resize_cancel = button( function() { room_resizing = false; } ).setIcon(THEME.toolbar_check, 1);
|
||||||
|
room_resize_grid = button( function() { room_resizing = false; } ).setIcon(THEME.toolbar_check, 1);
|
||||||
|
|
||||||
tb_room_resize_w = new textBox(TEXTBOX_INPUT.number, function(v) /*=>*/ { room_resizing_area[2] = room_resizing_area[0] + round(v); }).setHide(1).setFont(f_p3);
|
tb_room_resize_w = new textBox(TEXTBOX_INPUT.number, function(v) /*=>*/ { room_resizing_area[2] = room_resizing_area[0] + round(v); }).setHide(1).setFont(f_p3);
|
||||||
tb_room_resize_h = new textBox(TEXTBOX_INPUT.number, function(v) /*=>*/ { room_resizing_area[3] = room_resizing_area[1] + round(v); }).setHide(1).setFont(f_p3);
|
tb_room_resize_h = new textBox(TEXTBOX_INPUT.number, function(v) /*=>*/ { room_resizing_area[3] = room_resizing_area[1] + round(v); }).setHide(1).setFont(f_p3);
|
||||||
|
@ -42,7 +43,7 @@ function Node_GMRoom(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text_sub);
|
draw_set_text(f_p2, fa_left, fa_center, COLORS._main_text_sub);
|
||||||
draw_text_add(_x + ui(16), _wdy + _wdh / 2, "Room Size");
|
draw_text_add(_x + ui(16), _wdy + _wdh / 2, "Room Size");
|
||||||
|
|
||||||
var _wdw = _w - ui(128 + 8) - (room_resizing? _wdh * 2 : _wdh);
|
var _wdw = _w - ui(128 + 8) - (room_resizing? _wdh * 2 : _wdh) - ui(8);
|
||||||
|
|
||||||
draw_sprite_stretched_ext(THEME.textbox, 3, _wdx, _wdy, _wdw / 2, _wdh, COLORS._main_icon_light);
|
draw_sprite_stretched_ext(THEME.textbox, 3, _wdx, _wdy, _wdw / 2, _wdh, COLORS._main_icon_light);
|
||||||
draw_sprite_stretched_ext(THEME.textbox, 3, _wdx + _wdw / 2, _wdy, _wdw / 2, _wdh, COLORS._main_icon_light);
|
draw_sprite_stretched_ext(THEME.textbox, 3, _wdx + _wdw / 2, _wdy, _wdw / 2, _wdh, COLORS._main_icon_light);
|
||||||
|
@ -67,8 +68,8 @@ function Node_GMRoom(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
}
|
}
|
||||||
|
|
||||||
if(room_resizing) {
|
if(room_resizing) {
|
||||||
var _bx = _wdx + _wdw;
|
var _bx = _wdx + _wdw + ui(8);
|
||||||
if(buttonInstant(THEME.button_def, _bx, _wdy, _wdh, _wdh, _m, _hover, _focus, __txt("Cancel"), THEME.toolbar_check, 1,
|
if(buttonInstant(THEME.button_left, _bx, _wdy, _wdh, _wdh, _m, _hover, _focus, __txt("Cancel"), THEME.toolbar_check, 1,
|
||||||
COLORS._main_value_negative, 1, 1, COLORS._main_icon_light) == 2)
|
COLORS._main_value_negative, 1, 1, COLORS._main_icon_light) == 2)
|
||||||
room_resizing = false;
|
room_resizing = false;
|
||||||
|
|
||||||
|
@ -77,12 +78,14 @@ function Node_GMRoom(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
var _tooltip = misalign? __txt("Warning: room size not divisible by tile size. May cause tile shifting.") : __txt("Apply");
|
var _tooltip = misalign? __txt("Warning: room size not divisible by tile size. May cause tile shifting.") : __txt("Apply");
|
||||||
|
|
||||||
_bx += _wdh;
|
_bx += _wdh;
|
||||||
if(buttonInstant(THEME.button_def, _bx, _wdy, _wdh, _wdh, _m, _hover, _focus, _tooltip, THEME.toolbar_check, 0,
|
if(buttonInstant(THEME.button_right, _bx, _wdy, _wdh, _wdh, _m, _hover, _focus, _tooltip, THEME.toolbar_check, 0,
|
||||||
COLORS._main_value_positive, 1, 1, COLORS._main_icon_light) == 2)
|
COLORS._main_value_positive, 1, 1, COLORS._main_icon_light) == 2)
|
||||||
applyResizeRoom();
|
applyResizeRoom();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
if(buttonInstant(THEME.button_def, _wdx + _wdw, _wdy, _wdh, _wdh, _m, _hover, _focus, __txt("Resize"), THEME.canvas_resize, 0,
|
var _bx = _wdx + _wdw + ui(8);
|
||||||
|
|
||||||
|
if(buttonInstant(THEME.button_def, _bx, _wdy, _wdh, _wdh, _m, _hover, _focus, __txt("Resize"), THEME.canvas_resize, 0,
|
||||||
COLORS._main_icon_light, 1, 1, COLORS._main_icon_light) == 2) {
|
COLORS._main_icon_light, 1, 1, COLORS._main_icon_light) == 2) {
|
||||||
|
|
||||||
room_resizing = true;
|
room_resizing = true;
|
||||||
|
@ -367,15 +370,20 @@ function Node_GMRoom(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
_l.refreshPreview();
|
_l.refreshPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
triggerRender();
|
PANEL_PREVIEW.canvas_x -= _dx * _preview_scale;
|
||||||
|
PANEL_PREVIEW.canvas_y -= _dx * _preview_scale;
|
||||||
|
|
||||||
|
run_in(1, function() /*=>*/ {return triggerRender()});
|
||||||
}
|
}
|
||||||
|
|
||||||
////- Update
|
////- Update
|
||||||
|
|
||||||
|
_preview_scale = 1;
|
||||||
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
static drawOverlay = function(hover, active, _x, _y, _s, _mx, _my, _snx, _sny) {
|
||||||
preview_alpha = room_resizing? .5 : 1;
|
preview_alpha = room_resizing? .5 : 1;
|
||||||
if(!room_resizing) return;
|
if(!room_resizing) return;
|
||||||
|
|
||||||
|
_preview_scale = _s;
|
||||||
var rw = gmRoom.roomSettings.Width;
|
var rw = gmRoom.roomSettings.Width;
|
||||||
var rh = gmRoom.roomSettings.Height;
|
var rh = gmRoom.roomSettings.Height;
|
||||||
|
|
||||||
|
@ -406,6 +414,41 @@ function Node_GMRoom(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
draw_set_color(_hov == 4? COLORS._main_accent : COLORS._main_icon);
|
draw_set_color(_hov == 4? COLORS._main_accent : COLORS._main_icon);
|
||||||
draw_rectangle_dashed(_cx0, _cy0, _cx1, _cy1, 1 + (_hov == 4));
|
draw_rectangle_dashed(_cx0, _cy0, _cx1, _cy1, 1 + (_hov == 4));
|
||||||
|
|
||||||
|
var _padL = abs(_area[0]);
|
||||||
|
var _padT = abs(_area[1]);
|
||||||
|
var _padR = abs(_area[2] - rw);
|
||||||
|
var _padB = abs(_area[3] - rh);
|
||||||
|
var _cx = _x + rw * _s / 2;
|
||||||
|
var _cy = _y + rh * _s / 2;
|
||||||
|
|
||||||
|
if(_padL != 0) {
|
||||||
|
draw_set_color(COLORS._main_icon);
|
||||||
|
draw_line_dashed(_cx0, _cy, _x0, _cy);
|
||||||
|
draw_set_text(f_p2, fa_center, fa_center, COLORS._main_icon_light);
|
||||||
|
draw_text((_cx0 + _x0) / 2, _cy, _padL);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(_padR != 0) {
|
||||||
|
draw_set_color(COLORS._main_icon);
|
||||||
|
draw_line_dashed(_x1, _cy, _cx1, _cy);
|
||||||
|
draw_set_text(f_p2, fa_center, fa_center, COLORS._main_icon_light);
|
||||||
|
draw_text((_x1 + _cx1) / 2, _cy, _padR);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(_padT != 0) {
|
||||||
|
draw_set_color(COLORS._main_icon);
|
||||||
|
draw_line_dashed(_cx, _cy0, _cx, _y0);
|
||||||
|
draw_set_text(f_p2, fa_center, fa_center, COLORS._main_icon_light);
|
||||||
|
draw_text(_cx, (_cy0 + _y0) / 2, _padT);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(_padB != 0) {
|
||||||
|
draw_set_color(COLORS._main_icon);
|
||||||
|
draw_line_dashed(_cx, _y1, _cx, _cy1);
|
||||||
|
draw_set_text(f_p2, fa_center, fa_center, COLORS._main_icon_light);
|
||||||
|
draw_text(_cx, (_y1 + _cy1) / 2, _padB);
|
||||||
|
}
|
||||||
|
|
||||||
draw_anchor(room_resizing_hov[0], _cx0, _cy0, 10);
|
draw_anchor(room_resizing_hov[0], _cx0, _cy0, 10);
|
||||||
draw_anchor(room_resizing_hov[1], _cx1, _cy0, 10);
|
draw_anchor(room_resizing_hov[1], _cx1, _cy0, 10);
|
||||||
draw_anchor(room_resizing_hov[2], _cx0, _cy1, 10);
|
draw_anchor(room_resizing_hov[2], _cx0, _cy1, 10);
|
||||||
|
@ -549,13 +592,12 @@ function Node_GMRoom(_x, _y, _group = noone) : Node(_x, _y, _group) constructor
|
||||||
|
|
||||||
surface_set_target(_prev);
|
surface_set_target(_prev);
|
||||||
DRAW_CLEAR
|
DRAW_CLEAR
|
||||||
|
|
||||||
for( var i = array_length(layers) - 1; i >= 0; i-- ) {
|
for( var i = array_length(layers) - 1; i >= 0; i-- ) {
|
||||||
var _l = layers[i].layer;
|
var _l = layers[i].layer;
|
||||||
var _p = _l.preview;
|
if(!is_surface(_l.preview)) _l.refreshPreview();
|
||||||
draw_surface_safe(_p);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
draw_surface_safe(_l.preview);
|
||||||
|
}
|
||||||
surface_reset_target();
|
surface_reset_target();
|
||||||
|
|
||||||
outputs[0].setValue(_prev);
|
outputs[0].setValue(_prev);
|
||||||
|
|
|
@ -477,13 +477,14 @@ function Node_Tile_Drawer(_x, _y, _group = noone) : Node_Processor(_x, _y, _grou
|
||||||
|
|
||||||
////- Actions
|
////- Actions
|
||||||
|
|
||||||
static resizeBBOX = function(bbox) {
|
function resizeBBOX(bbox) {
|
||||||
var _nw = bbox[2] - bbox[0];
|
var _nw = bbox[2] - bbox[0];
|
||||||
var _nh = bbox[3] - bbox[1];
|
var _nh = bbox[3] - bbox[1];
|
||||||
var _dx = -bbox[0];
|
var _dx = -bbox[0];
|
||||||
var _dy = -bbox[1];
|
var _dy = -bbox[1];
|
||||||
|
|
||||||
inputs[1].setValue([_nw, _nh]);
|
gmTileLayer.tiles.SerialiseWidth = _nw;
|
||||||
|
gmTileLayer.tiles.SerialiseHeight = _nh;
|
||||||
|
|
||||||
var _newSurf = surface_create(_nw, _nh, surface_rgba16float);
|
var _newSurf = surface_create(_nw, _nh, surface_rgba16float);
|
||||||
surface_set_target(_newSurf);
|
surface_set_target(_newSurf);
|
||||||
|
|
|
@ -41,6 +41,7 @@ function scrollPane(_w, _h, ondraw) : widget() constructor {
|
||||||
scroll_color_bar = COLORS.scrollbar_idle;
|
scroll_color_bar = COLORS.scrollbar_idle;
|
||||||
scroll_color_bar_hover = COLORS.scrollbar_hover;
|
scroll_color_bar_hover = COLORS.scrollbar_hover;
|
||||||
scroll_color_bar_active = COLORS.scrollbar_active;
|
scroll_color_bar_active = COLORS.scrollbar_active;
|
||||||
|
scroll_color_bar_alpha = 1;
|
||||||
|
|
||||||
static resize = function(_w, _h) {
|
static resize = function(_w, _h) {
|
||||||
w = _w;
|
w = _w;
|
||||||
|
@ -170,6 +171,7 @@ function scrollPane(_w, _h, ondraw) : widget() constructor {
|
||||||
var by1 = clamp(bar_y + bar_h, scr_y, scr_y + scr_h);
|
var by1 = clamp(bar_y + bar_h, scr_y, scr_y + scr_h);
|
||||||
var hh = by1 - by0;
|
var hh = by1 - by0;
|
||||||
|
|
||||||
|
if(scroll_color_bg != undefined)
|
||||||
draw_sprite_stretched_ext(THEME.ui_scrollbar, 0, scr_x, scr_y, scr_w, scr_h, scroll_color_bg, 1);
|
draw_sprite_stretched_ext(THEME.ui_scrollbar, 0, scr_x, scr_y, scr_w, scr_h, scroll_color_bg, 1);
|
||||||
|
|
||||||
var cc = scroll_color_bar;
|
var cc = scroll_color_bar;
|
||||||
|
@ -184,7 +186,7 @@ function scrollPane(_w, _h, ondraw) : widget() constructor {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(is_scrolling) cc = scroll_color_bar_active;
|
if(is_scrolling) cc = scroll_color_bar_active;
|
||||||
draw_sprite_stretched_ext(THEME.ui_scrollbar, 0, bx0, by0, ww, hh, cc, 1);
|
draw_sprite_stretched_ext(THEME.ui_scrollbar, 0, bx0, by0, ww, hh, cc, scroll_color_bar_alpha);
|
||||||
}
|
}
|
||||||
|
|
||||||
static free = function() {
|
static free = function() {
|
||||||
|
|
|
@ -25,8 +25,8 @@
|
||||||
"nineSlice":null,
|
"nineSlice":null,
|
||||||
"origin":4,
|
"origin":4,
|
||||||
"parent":{
|
"parent":{
|
||||||
"name":"gamemaker",
|
"name":"spr",
|
||||||
"path":"folders/game engines/gamemaker.yy",
|
"path":"folders/game engines/gamemaker/spr.yy",
|
||||||
},
|
},
|
||||||
"preMultiplyAlpha":false,
|
"preMultiplyAlpha":false,
|
||||||
"resourceType":"GMSprite",
|
"resourceType":"GMSprite",
|
||||||
|
|
|
@ -31,8 +31,8 @@
|
||||||
"nineSlice":null,
|
"nineSlice":null,
|
||||||
"origin":4,
|
"origin":4,
|
||||||
"parent":{
|
"parent":{
|
||||||
"name":"misc",
|
"name":"spr",
|
||||||
"path":"folders/sprites/misc.yy",
|
"path":"folders/game engines/gamemaker/spr.yy",
|
||||||
},
|
},
|
||||||
"preMultiplyAlpha":false,
|
"preMultiplyAlpha":false,
|
||||||
"resourceType":"GMSprite",
|
"resourceType":"GMSprite",
|
||||||
|
|
|
@ -25,8 +25,8 @@
|
||||||
"nineSlice":null,
|
"nineSlice":null,
|
||||||
"origin":4,
|
"origin":4,
|
||||||
"parent":{
|
"parent":{
|
||||||
"name":"misc",
|
"name":"spr",
|
||||||
"path":"folders/sprites/misc.yy",
|
"path":"folders/game engines/gamemaker/spr.yy",
|
||||||
},
|
},
|
||||||
"preMultiplyAlpha":false,
|
"preMultiplyAlpha":false,
|
||||||
"resourceType":"GMSprite",
|
"resourceType":"GMSprite",
|
||||||
|
|
Loading…
Reference in a new issue