mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-24 14:06:23 +01:00
fixing stuff
This commit is contained in:
parent
76ac461738
commit
baac4f430c
24 changed files with 198 additions and 148 deletions
|
@ -15,7 +15,6 @@
|
|||
{"name":"addons","order":142,"path":"folders/addons.yy",},
|
||||
{"name":"animation_curve","order":143,"path":"folders/animation_curve.yy",},
|
||||
{"name":"dialog","order":144,"path":"folders/dialog.yy",},
|
||||
{"name":"Extensions","order":157,"path":"folders/Extensions.yy",},
|
||||
{"name":"font","order":145,"path":"folders/font.yy",},
|
||||
{"name":"functions","order":146,"path":"folders/functions.yy",},
|
||||
{"name":"camera","order":7,"path":"folders/functions/3d/camera.yy",},
|
||||
|
@ -1380,6 +1379,7 @@
|
|||
{"name":"widget","order":5,"path":"scripts/widget/widget.yy",},
|
||||
{"name":"window_functions","order":2,"path":"scripts/window_functions/window_functions.yy",},
|
||||
{"name":"winwin_extras","order":6,"path":"scripts/winwin_extras/winwin_extras.yy",},
|
||||
{"name":"winwin_utils","order":7,"path":"scripts/winwin_utils/winwin_utils.yy",},
|
||||
{"name":"sh_2d_light","order":10,"path":"shaders/sh_2d_light/sh_2d_light.yy",},
|
||||
{"name":"sh_3d_depth","order":6,"path":"shaders/sh_3d_depth/sh_3d_depth.yy",},
|
||||
{"name":"sh_3d_extrude_corner","order":7,"path":"shaders/sh_3d_extrude_corner/sh_3d_extrude_corner.yy",},
|
||||
|
|
|
@ -50,7 +50,6 @@
|
|||
{"$GMFolder":"","%Name":"inspector","folderPath":"folders/dialog/inspector.yy","name":"inspector","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||
{"$GMFolder":"","%Name":"menu","folderPath":"folders/dialog/menu.yy","name":"menu","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||
{"$GMFolder":"","%Name":"widget","folderPath":"folders/dialog/widget.yy","name":"widget","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||
{"$GMFolder":"","%Name":"Extensions","folderPath":"folders/Extensions.yy","name":"Extensions","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||
{"$GMFolder":"","%Name":"font","folderPath":"folders/font.yy","name":"font","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||
{"$GMFolder":"","%Name":"functions","folderPath":"folders/functions.yy","name":"functions","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||
{"$GMFolder":"","%Name":"3d","folderPath":"folders/functions/3d.yy","name":"3d","resourceType":"GMFolder","resourceVersion":"2.0",},
|
||||
|
@ -2029,6 +2028,7 @@
|
|||
{"id":{"name":"window_functions","path":"scripts/window_functions/window_functions.yy",},},
|
||||
{"id":{"name":"windowManager","path":"scripts/windowManager/windowManager.yy",},},
|
||||
{"id":{"name":"winwin_extras","path":"scripts/winwin_extras/winwin_extras.yy",},},
|
||||
{"id":{"name":"winwin_utils","path":"scripts/winwin_utils/winwin_utils.yy",},},
|
||||
{"id":{"name":"sh_2d_light","path":"shaders/sh_2d_light/sh_2d_light.yy",},},
|
||||
{"id":{"name":"sh_3d_depth","path":"shaders/sh_3d_depth/sh_3d_depth.yy",},},
|
||||
{"id":{"name":"sh_3d_extrude_corner","path":"shaders/sh_3d_extrude_corner/sh_3d_extrude_corner.yy",},},
|
||||
|
|
|
@ -14,10 +14,7 @@ event_inherited();
|
|||
#region text
|
||||
onModify = -1;
|
||||
tb_name = new textBox(TEXTBOX_INPUT.text, function(txt) {
|
||||
while(string_char_at(txt, 1) == " ") {
|
||||
txt = string_copy(txt, 2, string_length(txt) - 1);
|
||||
}
|
||||
|
||||
txt = filename_name_validate(txt);
|
||||
onModify(path + txt);
|
||||
instance_destroy();
|
||||
});
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
#endregion
|
||||
|
||||
#region draw TB
|
||||
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_text);
|
||||
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_icon);
|
||||
draw_text(dialog_x + ui(8), dialog_y + dialog_h / 2, __txt("Name"));
|
||||
|
||||
tb_name.setFocusHover(sFOCUS, sHOVER);
|
||||
|
|
|
@ -3,12 +3,12 @@ event_inherited();
|
|||
|
||||
#region data
|
||||
dialog_w = ui(360);
|
||||
dialog_h = ui(64);
|
||||
dialog_h = ui(48);
|
||||
|
||||
dialog_w_expand = ui(480);
|
||||
dialog_h_expand = ui(570);
|
||||
|
||||
draggable = false;
|
||||
draggable = true;
|
||||
|
||||
destroy_on_click_out = false;
|
||||
|
||||
|
@ -24,16 +24,14 @@ event_inherited();
|
|||
ugc = 0;
|
||||
ugc_loading = false;
|
||||
|
||||
tb_name = new textBox(TEXTBOX_INPUT.text, function(str) { meta.name = str; });
|
||||
KEYBOARD_STRING = "";
|
||||
|
||||
t_desc = new textArea(TEXTBOX_INPUT.text, function(str) { meta.description = str; });
|
||||
t_auth = new textArea(TEXTBOX_INPUT.text, function(str) { meta.author = str; });
|
||||
t_cont = new textArea(TEXTBOX_INPUT.text, function(str) { meta.contact = str; });
|
||||
t_alias = new textArea(TEXTBOX_INPUT.text, function(str) { meta.alias = str; });
|
||||
t_tags = new textArrayBox(function() { return meta.tags; }, META_TAGS);
|
||||
|
||||
t_update = new textArea(TEXTBOX_INPUT.text, function(str) { update_note = str; });
|
||||
tb_name = new textBox( TEXTBOX_INPUT.text, function(str) /*=>*/ { meta.name = filename_name_validate(str); });
|
||||
t_desc = new textArea(TEXTBOX_INPUT.text, function(str) /*=>*/ { meta.description = str; });
|
||||
t_auth = new textArea(TEXTBOX_INPUT.text, function(str) /*=>*/ { meta.author = str; });
|
||||
t_cont = new textArea(TEXTBOX_INPUT.text, function(str) /*=>*/ { meta.contact = str; });
|
||||
t_alias = new textArea(TEXTBOX_INPUT.text, function(str) /*=>*/ { meta.alias = str; });
|
||||
t_update = new textArea(TEXTBOX_INPUT.text, function(str) /*=>*/ { update_note = str; });
|
||||
t_tags = new textArrayBox(function() /*=>*/ {return meta.tags}, META_TAGS);
|
||||
|
||||
t_desc.auto_update = true;
|
||||
t_auth.auto_update = true;
|
||||
|
|
|
@ -1,13 +1,16 @@
|
|||
/// @description init
|
||||
#region base UI
|
||||
DIALOG_DRAW_BG
|
||||
if(sFOCUS)
|
||||
DIALOG_DRAW_FOCUS
|
||||
// DIALOG_DRAW_BG
|
||||
// if(sFOCUS)
|
||||
// DIALOG_DRAW_FOCUS
|
||||
draw_sprite_stretched(THEME.textbox, 3, dialog_x, dialog_y, dialog_w, dialog_h);
|
||||
if(sFOCUS) draw_sprite_stretched_ext(THEME.textbox, 2, dialog_x, dialog_y, dialog_w, dialog_h, COLORS._main_accent);
|
||||
else draw_sprite_stretched(THEME.textbox, 1, dialog_x, dialog_y, dialog_w, dialog_h);
|
||||
#endregion
|
||||
|
||||
#region draw TB
|
||||
draw_set_text(f_p0, fa_left, fa_center, COLORS._main_icon);
|
||||
draw_text_add(dialog_x + ui(16), dialog_y + ui(32), __txt("Name"));
|
||||
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_icon);
|
||||
draw_text_add(dialog_x + ui(8), dialog_y + ui(24), __txt("Name"));
|
||||
|
||||
t_desc.interactable = !STEAM_UGC_ITEM_UPLOADING;
|
||||
t_auth.interactable = !STEAM_UGC_ITEM_UPLOADING;
|
||||
|
@ -18,15 +21,20 @@
|
|||
|
||||
tb_name.setFocusHover(sFOCUS, sHOVER);
|
||||
tb_name.register();
|
||||
tb_name.draw(dialog_x + ui(72), dialog_y + ui(16), dialog_w - ui(164), ui(32), meta.name, mouse_ui);
|
||||
tb_name.draw(dialog_x + ui(64), dialog_y + ui(8), dialog_w - ui(172), ui(32), meta.name, mouse_ui);
|
||||
|
||||
var bx = dialog_x + dialog_w - ui(84);
|
||||
var by = dialog_y + ui(16);
|
||||
var bw = ui(32);
|
||||
var bh = ui(32);
|
||||
var bw = ui(28);
|
||||
var bh = ui(28);
|
||||
|
||||
var bx = dialog_x + dialog_w - ui(8) - bw;
|
||||
var by = dialog_y + ui(24) - bh / 2;
|
||||
|
||||
if(buttonInstant(THEME.button_hide, bx, by, bw, bh, mouse_ui, sFOCUS, sHOVER, __txt("Close"), THEME.cross_16, 0, COLORS._main_value_negative) == 2)
|
||||
instance_destroy();
|
||||
bx -= bw + ui(4);
|
||||
|
||||
var txt = __txtx("new_collection_create", "Create collection");
|
||||
var icon = THEME.accept;
|
||||
var icon = THEME.accept_16;
|
||||
var clr = COLORS._main_value_positive;
|
||||
if(updating != noone)
|
||||
txt = __txtx("new_collection_update", "Update collection");
|
||||
|
@ -86,103 +94,107 @@
|
|||
if(ugc == 1) {
|
||||
steam_ugc_create_collection(updating);
|
||||
ugc_loading = true;
|
||||
|
||||
} else if(ugc == 2) {
|
||||
saveCollection(node, data_path, updating.path, false, updating.meta);
|
||||
steam_ugc_update_collection(updating, false, update_note);
|
||||
ugc_loading = true;
|
||||
|
||||
} else
|
||||
instance_destroy();
|
||||
}
|
||||
}
|
||||
|
||||
bx += bw + ui(4);
|
||||
bx -= bw + ui(4);
|
||||
var txt = __txtx("new_collection_meta_edit", "Edit metadata");
|
||||
if(buttonInstant(THEME.button_hide, bx, by, bw, bh, mouse_ui, sFOCUS, sHOVER, txt, THEME.hamburger) == 2)
|
||||
if(buttonInstant(THEME.button_hide, bx, by, bw, bh, mouse_ui, sFOCUS, sHOVER, txt, THEME.arrow, meta_expand? 3 : 0) == 2)
|
||||
doExpand();
|
||||
#endregion
|
||||
|
||||
#region display
|
||||
dialog_h = ui(64);
|
||||
dialog_h = ui(48);
|
||||
|
||||
if(meta_expand) {
|
||||
var yy = dialog_y + ui(56);
|
||||
var dx = dialog_x + ui(8);
|
||||
var dw = dialog_w - ui(16);
|
||||
var yy = dialog_y + ui(48);
|
||||
|
||||
if(ugc == 2) {
|
||||
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_icon);
|
||||
draw_text(dialog_x + ui(16), yy, __txt("Update note"));
|
||||
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_icon);
|
||||
draw_text(dx, yy + ui(12), __txt("Update note"));
|
||||
yy += line_get_height() + ui(4);
|
||||
dialog_h += line_get_height() + ui(4);
|
||||
|
||||
var wd_h = ui(160);
|
||||
t_update.setFocusHover(sFOCUS, sHOVER);
|
||||
t_update.register();
|
||||
t_update.draw(dialog_x + ui(16), yy, dialog_w - ui(32), wd_h, update_note, mouse_ui);
|
||||
t_update.draw(dx, yy, dw, wd_h, update_note, mouse_ui);
|
||||
yy += wd_h + ui(8);
|
||||
dialog_h += wd_h + ui(8);
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_icon);
|
||||
draw_text(dialog_x + ui(16), yy, __txt("Description"));
|
||||
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_icon);
|
||||
draw_text(dx, yy + ui(12), __txt("Description"));
|
||||
yy += line_get_height() + ui(4);
|
||||
dialog_h += line_get_height() + ui(4);
|
||||
|
||||
var wd_h = ugc == 2? ui(100) : ui(200);
|
||||
t_desc.setFocusHover(sFOCUS, sHOVER);
|
||||
t_desc.register();
|
||||
t_desc.draw(dialog_x + ui(16), yy, dialog_w - ui(32), wd_h, meta.description, mouse_ui);
|
||||
t_desc.draw(dx, yy, dw, wd_h, meta.description, mouse_ui);
|
||||
yy += wd_h + ui(8);
|
||||
dialog_h += wd_h + ui(8);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_icon);
|
||||
draw_text(dialog_x + ui(16), yy, __txt("Author"));
|
||||
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_icon);
|
||||
draw_text(dx, yy + ui(12), __txt("Author"));
|
||||
yy += line_get_height() + ui(4);
|
||||
dialog_h += line_get_height() + ui(4);
|
||||
|
||||
var wd_h = TEXTBOX_HEIGHT;
|
||||
t_auth.setFocusHover(sFOCUS, sHOVER);
|
||||
t_auth.register();
|
||||
t_auth.draw(dialog_x + ui(16), yy, dialog_w - ui(32), wd_h, meta.author, mouse_ui);
|
||||
t_auth.draw(dx, yy, dw, wd_h, meta.author, mouse_ui);
|
||||
yy += wd_h + ui(8);
|
||||
dialog_h += wd_h + ui(8);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_icon);
|
||||
draw_text(dialog_x + ui(16), yy, __txt("Contact info"));
|
||||
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_icon);
|
||||
draw_text(dx, yy + ui(12), __txt("Contact info"));
|
||||
yy += line_get_height() + ui(4);
|
||||
dialog_h += line_get_height() + ui(4);
|
||||
|
||||
var wd_h = TEXTBOX_HEIGHT;
|
||||
t_cont.setFocusHover(sFOCUS, sHOVER);
|
||||
t_cont.register();
|
||||
t_cont.draw(dialog_x + ui(16), yy, dialog_w - ui(32), wd_h, meta.contact, mouse_ui);
|
||||
t_cont.draw(dx, yy, dw, wd_h, meta.contact, mouse_ui);
|
||||
yy += wd_h + ui(8);
|
||||
dialog_h += wd_h + ui(8);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_icon);
|
||||
draw_text(dialog_x + ui(16), yy, __txt("Alias"));
|
||||
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_icon);
|
||||
draw_text(dx, yy + ui(12), __txt("Alias"));
|
||||
yy += line_get_height() + ui(4);
|
||||
dialog_h += line_get_height() + ui(4);
|
||||
|
||||
var wd_h = TEXTBOX_HEIGHT;
|
||||
t_alias.setFocusHover(sFOCUS, sHOVER);
|
||||
t_alias.register();
|
||||
t_alias.draw(dialog_x + ui(16), yy, dialog_w - ui(32), wd_h, meta.alias, mouse_ui);
|
||||
t_alias.draw(dx, yy, dw, wd_h, meta.alias, mouse_ui);
|
||||
yy += wd_h + ui(8);
|
||||
dialog_h += wd_h + ui(8);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
draw_set_text(f_p0, fa_left, fa_top, COLORS._main_icon);
|
||||
draw_text(dialog_x + ui(16), yy, __txt("Tags"));
|
||||
draw_set_text(f_p1, fa_left, fa_center, COLORS._main_icon);
|
||||
draw_text(dx, yy + ui(12), __txt("Tags"));
|
||||
yy += line_get_height() + ui(4);
|
||||
dialog_h += line_get_height() + ui(4);
|
||||
|
||||
var wd_h = TEXTBOX_HEIGHT;
|
||||
t_tags.setFocusHover(sFOCUS, sHOVER);
|
||||
t_tags.register();
|
||||
var hh = t_tags.draw(dialog_x + ui(16), yy, dialog_w - ui(32), wd_h, mouse_ui);
|
||||
var hh = t_tags.draw(dx, yy, dw, wd_h, mouse_ui);
|
||||
yy += hh + ui(8);
|
||||
dialog_h += hh + ui(8);
|
||||
}
|
||||
|
|
|
@ -77,7 +77,7 @@ event_inherited();
|
|||
var _dw = sc_content.surface_w;
|
||||
var _h = 0;
|
||||
var _ly = _y;
|
||||
var hovering = "";
|
||||
var hov = noone;
|
||||
|
||||
for(var i = 0; i < array_length(data); i++) {
|
||||
var _val = data[i];
|
||||
|
@ -86,8 +86,7 @@ event_inherited();
|
|||
var _tol = is_instanceof(_val, scrollItem) && _val.tooltip != "";
|
||||
|
||||
var clickable = !string_starts_with(txt, "-");
|
||||
if(!clickable)
|
||||
txt = string_delete(txt, 1, 1);
|
||||
if(!clickable) txt = string_delete(txt, 1, 1);
|
||||
|
||||
if(data[i] == -1) {
|
||||
draw_set_color(CDEF.main_mdblack);
|
||||
|
@ -102,7 +101,7 @@ event_inherited();
|
|||
if(sc_content.hover && point_in_rectangle(_m[0], _m[1], 0, _ly, _dw, _ly + hght - 1)) {
|
||||
sc_content.hover_content = true;
|
||||
selecting = i;
|
||||
hovering = data[i];
|
||||
hov = i;
|
||||
|
||||
if(_tol) TOOLTIP = _val.tooltip;
|
||||
}
|
||||
|
@ -117,6 +116,7 @@ event_inherited();
|
|||
}
|
||||
}
|
||||
|
||||
if(is_string(txt)) {
|
||||
draw_set_text(font, align, fa_center, clickable? COLORS._main_text : COLORS._main_text_sub);
|
||||
if(align == fa_center) {
|
||||
var _xc = _spr? hght + (_dw - hght) / 2 : _dw / 2;
|
||||
|
@ -125,6 +125,10 @@ event_inherited();
|
|||
} else if(align == fa_left)
|
||||
draw_text_cut(text_pad + _spr * hght, _ly + hght / 2, txt, _dw);
|
||||
|
||||
} else if(sprite_exists(txt)) {
|
||||
draw_sprite_ext(txt, i, _dw / 2, _ly + hght / 2);
|
||||
}
|
||||
|
||||
if(_spr) draw_sprite_ext(_val.spr, _val.spr_ind, ui(8) + hght / 2, _ly + hght / 2, 1, 1, 0, _val.spr_blend, 1);
|
||||
|
||||
_ly += hght;
|
||||
|
@ -133,10 +137,10 @@ event_inherited();
|
|||
|
||||
if(update_hover) {
|
||||
UNDO_HOLDING = true;
|
||||
if(hovering != "")
|
||||
scrollbox.onModify(array_find(scrollbox.data, hovering));
|
||||
else if(initVal > -1)
|
||||
scrollbox.onModify(initVal);
|
||||
|
||||
if(hov != noone) scrollbox.onModify(hov);
|
||||
else if(initVal > -1) scrollbox.onModify(initVal);
|
||||
|
||||
UNDO_HOLDING = false;
|
||||
}
|
||||
|
||||
|
|
|
@ -365,8 +365,6 @@ event_inherited();
|
|||
return hh + ui(20);
|
||||
});
|
||||
|
||||
sp_sample.always_scroll = true;
|
||||
|
||||
#endregion
|
||||
|
||||
#region contest
|
||||
|
|
|
@ -2,9 +2,9 @@
|
|||
if(winMan_isMinimized()) exit;
|
||||
|
||||
#region tooltip
|
||||
|
||||
if(!_MOUSE_BLOCK) {
|
||||
if(TOOLTIP_WINDOW != noone) {
|
||||
winwin_set_topmost(TOOLTIP_WINDOW, true);
|
||||
winwin_draw_begin(TOOLTIP_WINDOW);
|
||||
winwin_draw_clear(0, 0);
|
||||
}
|
||||
|
|
|
@ -5,10 +5,8 @@ kb_hold = false;
|
|||
|
||||
KEYBOARD_PRESSED = kb_hkey;
|
||||
|
||||
if(keyboard_check(vk_backspace))
|
||||
KEYBOARD_STRING = string_copy(KEYBOARD_STRING, 1, string_length(KEYBOARD_STRING) - 1);
|
||||
else
|
||||
KEYBOARD_STRING += keyboard_lastchar;
|
||||
if(keyboard_check(vk_backspace)) KEYBOARD_STRING = string_copy(KEYBOARD_STRING, 1, string_length(KEYBOARD_STRING) - 1);
|
||||
else KEYBOARD_STRING += keyboard_lastchar;
|
||||
|
||||
if(KEYBOARD_PRESSED == -1) {
|
||||
for( var i = 0, n = array_length(global.KEYS_VK); i < n; i++ ) {
|
||||
|
|
|
@ -16,10 +16,8 @@ if(!trigger) exit;
|
|||
|
||||
KEYBOARD_PRESSED = kb_hkey;
|
||||
|
||||
if(keyboard_check(vk_backspace))
|
||||
KEYBOARD_STRING = string_copy(KEYBOARD_STRING, 1, string_length(KEYBOARD_STRING) - 1);
|
||||
else
|
||||
KEYBOARD_STRING += keyboard_lastchar;
|
||||
if(keyboard_check(vk_backspace)) KEYBOARD_STRING = string_copy(KEYBOARD_STRING, 1, string_length(KEYBOARD_STRING) - 1);
|
||||
else KEYBOARD_STRING += keyboard_lastchar;
|
||||
|
||||
if(WIDGET_CURRENT && is_instanceof(WIDGET_CURRENT, textInput))
|
||||
WIDGET_CURRENT.onKey(KEYBOARD_PRESSED);
|
|
@ -1,6 +1,9 @@
|
|||
/// @description init
|
||||
if(PREFERENCES.multi_window) winwin_update();
|
||||
|
||||
// print($"{TOOLTIP_WINDOW}, {winwin_get_focus()}");
|
||||
// print(keyboard_check(vk_space));
|
||||
|
||||
global.__debug_runner++;
|
||||
global.cache_call = 0;
|
||||
global.cache_hit = 0;
|
||||
|
|
|
@ -45,7 +45,7 @@ function Panel_Linear_Setting() : PanelContent() constructor {
|
|||
static drawSettings = function(panel) {
|
||||
var yy = ui(24);
|
||||
var th = ui(36);
|
||||
var ww = wdgw;
|
||||
var ww = max(wdgw, w * 0.5);
|
||||
var wh = TEXTBOX_HEIGHT;
|
||||
|
||||
var _hov = false;
|
||||
|
|
|
@ -17,11 +17,7 @@ function buttonGroup(_data, _onClick) : widget() constructor {
|
|||
|
||||
sb_small = new scrollBox(data, _onClick);
|
||||
|
||||
static setFont = function(font) {
|
||||
self.font = font;
|
||||
return self;
|
||||
}
|
||||
|
||||
static setFont = function(ff) { font = ff; return self; }
|
||||
static setTooltips = function(tt) { tooltips = tt; return self; }
|
||||
static setCollape = function(cc) { collapsable = cc; return self; }
|
||||
|
||||
|
@ -141,7 +137,7 @@ function buttonGroup(_data, _onClick) : widget() constructor {
|
|||
}
|
||||
} else {
|
||||
sb_small.setFocusHover(active, hover);
|
||||
sb_small.draw(_x, _y, _w, _h, array_safe_get(data, _selecting, "-"), _m, _rx, _ry);
|
||||
sb_small.draw(_x, _y, _w, _h, _selecting, _m, _rx, _ry);
|
||||
}
|
||||
|
||||
if(WIDGET_CURRENT == self)
|
||||
|
|
|
@ -446,7 +446,7 @@ function Panel_Collection() : PanelContent() constructor {
|
|||
|
||||
folderPane.resize(group_w - ui(8), content_h);
|
||||
|
||||
if(page == 2) contentPane.resize(w - ui(16), content_h);
|
||||
if(page == 2) contentPane.resize(w - ui(22), content_h);
|
||||
else contentPane.resize(content_w - ui(6), content_h);
|
||||
}
|
||||
|
||||
|
|
|
@ -440,7 +440,7 @@ function Panel_Inspector() : PanelContent() constructor {
|
|||
var _wdx = viewMode == INSP_VIEW_MODE.spacious? ui(16) : ui(140);
|
||||
var _wdw = w - ui(48) - _wdx;
|
||||
var _whh = line_get_height(_font);
|
||||
var _edt = PROJECT.meta.author_steam_id && PROJECT.meta.author_steam_id == STEAM_USER_ID;
|
||||
var _edt = PROJECT.meta.steam == FILE_STEAM_TYPE.local || PROJECT.meta.author_steam_id == STEAM_USER_ID;
|
||||
|
||||
for( var j = 0; j < array_length(meta.displays); j++ ) {
|
||||
var display = meta.displays[j];
|
||||
|
|
|
@ -390,6 +390,12 @@
|
|||
if(PREFERENCES.multi_window) {
|
||||
var _cfg = winwin_config_ext("", winwin_kind_borderless, true, false, winwin_main);
|
||||
_cfg.clickthrough = true;
|
||||
_cfg.noactivate = true;
|
||||
// _cfg.thread = true;
|
||||
|
||||
if(TOOLTIP_WINDOW != noone && winwin_exists(TOOLTIP_WINDOW))
|
||||
winwin_destroy(TOOLTIP_WINDOW);
|
||||
|
||||
TOOLTIP_WINDOW = winwin_create(0, 0, display_get_width(), display_get_height(), _cfg);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,6 +72,7 @@ function scrollBox(_data, _onModify, update_hover = true) : widget() constructor
|
|||
if(is_numeric(_val)) _selVal = array_safe_get_fast(data, _val);
|
||||
|
||||
var _text = is_instanceof(_selVal, scrollItem)? _selVal.name : _selVal;
|
||||
if(is_string(_text))
|
||||
_text = string_trim_start(_text, ["-", ">", " "]);
|
||||
curr_text = _text;
|
||||
|
||||
|
@ -119,13 +120,20 @@ function scrollBox(_data, _onModify, update_hover = true) : widget() constructor
|
|||
var _yc = _y + _h / 2;
|
||||
|
||||
if(_spr) _x0 += ui(32);
|
||||
var _xc = (_x0 + _x1) / 2;
|
||||
|
||||
draw_set_text(font, align, fa_center, COLORS._main_text);
|
||||
if(_h >= line_get_height()) {
|
||||
|
||||
if(is_string(_text)) {
|
||||
draw_set_alpha(0.5 + 0.5 * interactable);
|
||||
if(align == fa_center) draw_text_add((_x0 + _x1) / 2, _yc, _text, _sps);
|
||||
if(align == fa_center) draw_text_add(_xc, _yc, _text, _sps);
|
||||
else if(align == fa_left) draw_text_add(_x0 + padding, _yc, _text, _sps);
|
||||
draw_set_alpha(1);
|
||||
|
||||
} else if(sprite_exists(_selVal)) {
|
||||
draw_sprite_ext(_selVal, _val, _xc, _yc);
|
||||
}
|
||||
}
|
||||
|
||||
if(_spr) draw_sprite_ext(_selVal.spr, _selVal.spr_ind, _x + ui(16) * _sps, _yc, _sps, _sps, 0, _selVal.spr_blend, 1);
|
||||
|
|
|
@ -36,7 +36,7 @@ function scrollPane(_w, _h, ondraw) : widget() constructor {
|
|||
static resize = function(_w, _h) {
|
||||
w = _w;
|
||||
h = _h;
|
||||
surface_w = _w - (always_scroll || is_scroll) * ui(12);
|
||||
surface_w = _w - ui(12);
|
||||
surface_h = _h;
|
||||
}
|
||||
|
||||
|
|
|
@ -35,6 +35,20 @@ function string_char_last(str, shift = 0) {
|
|||
return string_char_at(str, string_length(str) - shift);
|
||||
}
|
||||
|
||||
function filename_name_validate(name) {
|
||||
static reserved = [ "/", "\\", ".", "<", ">", ":", "\"", "|", "?", "*" ];
|
||||
static no = [ "CON", "PRN", "AUX", "NUL", "COM0", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT0", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9" ];
|
||||
|
||||
for (var i = 0, n = array_length(reserved); i < n; i++)
|
||||
name = string_replace_all(name, reserved[i], "");
|
||||
|
||||
for (var i = 0, n = array_length(no); i < n; i++)
|
||||
if(string_lower(name) == string_lower(no[i]))
|
||||
return "";
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
function filename_name_only(name) {
|
||||
name = filename_name(name);
|
||||
return string_replace(name, filename_ext(name), "")
|
||||
|
|
|
@ -247,6 +247,7 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
|
|||
edited = true;
|
||||
cursor_select = -1;
|
||||
move_cursor(-1);
|
||||
|
||||
} else if(KEYBOARD_PRESSED == vk_delete || (keyboard_check_pressed(ord("X")) && key_mod_press(CTRL) && cursor_select != -1)) {
|
||||
if(cursor_select == -1) {
|
||||
var str_before = string_copy(_input_text, 1, cursor);
|
||||
|
@ -266,6 +267,7 @@ function textBox(_input, _onModify) : textInput(_input, _onModify) constructor {
|
|||
|
||||
edited = true;
|
||||
cursor_select = -1;
|
||||
|
||||
} else if(KEYBOARD_STRING != "") {
|
||||
var ch = KEYBOARD_STRING;
|
||||
|
||||
|
|
|
@ -1,6 +1,3 @@
|
|||
global.__winwin_map = ds_map_create();
|
||||
global.winwin_all = [];
|
||||
|
||||
function winwin(_ptr) constructor {
|
||||
__ptr__ = _ptr;
|
||||
}
|
||||
|
@ -17,50 +14,3 @@ function winwin_config_ext(caption = "", kind = winwin_kind_normal, topmost = fa
|
|||
|
||||
return cnf;
|
||||
}
|
||||
|
||||
function winwin_config() constructor {
|
||||
static caption = "Window";
|
||||
static kind = winwin_kind_normal;
|
||||
static resize = false;
|
||||
static show = true;
|
||||
static topmost = false;
|
||||
static taskbar_button = true; // can only disable for borderless!
|
||||
static clickthrough = false;
|
||||
static noactivate = false;
|
||||
static per_pixel_alpha = false;
|
||||
static thread = false;
|
||||
static vsync = 0;
|
||||
static close_button = 1;
|
||||
static owner = undefined;
|
||||
}
|
||||
|
||||
#macro __ww_valid (ww != noone && winwin_exists(ww))
|
||||
|
||||
function winwin_create_ext(_x, _y, _w, _h, _conf) {
|
||||
var window = winwin_create(_x, _y, _w, _h, _conf);
|
||||
array_push(global.winwin_all, window);
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
function winwin_destroy_ext(ww) {
|
||||
if(__ww_valid) winwin_destroy(_ww);
|
||||
array_remove(global.winwin_all, window);
|
||||
}
|
||||
|
||||
function winwin_get_x_safe(ww) { return __ww_valid? winwin_get_x(ww) : window_get_x(); }
|
||||
function winwin_get_y_safe(ww) { return __ww_valid? winwin_get_y(ww) : window_get_y(); }
|
||||
|
||||
function winwin_get_width_safe(ww) { return __ww_valid? winwin_get_width(ww) : window_get_width(); }
|
||||
function winwin_get_height_safe(ww) { return __ww_valid? winwin_get_height(ww) : window_get_height(); }
|
||||
|
||||
function winwin_set_position_safe(ww, _x, _y) { if(__ww_valid) winwin_set_position(ww, _x, _y); }
|
||||
function winwin_set_size_safe(ww, _w, _h) { if(__ww_valid) winwin_set_size(ww, _w, _h); }
|
||||
|
||||
function winwin_mouse_get_x_safe(ww) { return __ww_valid? winwin_mouse_get_x(ww) : device_mouse_x_to_gui(0); }
|
||||
function winwin_mouse_get_y_safe(ww) { return __ww_valid? winwin_mouse_get_y(ww) : device_mouse_y_to_gui(0); }
|
||||
|
||||
function winwin_mouse_is_over_safe(ww) { return __ww_valid? winwin_mouse_is_over(ww) : false; }
|
||||
function winwin_mouse_check_button_safe(ww, bb) { return __ww_valid? winwin_mouse_check_button(ww, bb) : mouse_check_button(bb); }
|
||||
function winwin_mouse_check_button_pressed_safe(ww, bb) { return __ww_valid? winwin_mouse_check_button_pressed(ww, bb) : mouse_check_button_pressed(bb); }
|
||||
function winwin_mouse_check_button_released_safe(ww, bb) { return __ww_valid? winwin_mouse_check_button_released(ww, bb) : mouse_check_button_released(bb); }
|
53
scripts/winwin_utils/winwin_utils.gml
Normal file
53
scripts/winwin_utils/winwin_utils.gml
Normal file
|
@ -0,0 +1,53 @@
|
|||
global.__winwin_map = ds_map_create();
|
||||
global.winwin_all = [];
|
||||
|
||||
function winwin_config() constructor {
|
||||
static caption = "Window";
|
||||
static kind = winwin_kind_normal;
|
||||
static resize = false;
|
||||
static show = true;
|
||||
static topmost = false;
|
||||
static taskbar_button = true; // can only disable for borderless!
|
||||
static clickthrough = false;
|
||||
static noactivate = false;
|
||||
static per_pixel_alpha = false;
|
||||
static thread = false;
|
||||
static vsync = 0;
|
||||
static close_button = 1;
|
||||
static owner = undefined;
|
||||
}
|
||||
|
||||
#macro __ww_valid (ww != noone && winwin_exists(ww))
|
||||
|
||||
function winwin_create_ext(_x, _y, _w, _h, _conf) {
|
||||
var window = winwin_create(_x, _y, _w, _h, _conf);
|
||||
array_push(global.winwin_all, window);
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
function winwin_destroy_ext(ww) {
|
||||
if(__ww_valid) winwin_destroy(_ww);
|
||||
array_remove(global.winwin_all, window);
|
||||
}
|
||||
|
||||
function winwin_set_position_safe(ww, _x, _y) { if(__ww_valid) winwin_set_position(ww, _x, _y); }
|
||||
function winwin_set_size_safe(ww, _w, _h) { if(__ww_valid) winwin_set_size(ww, _w, _h); }
|
||||
|
||||
function winwin_get_x_safe(ww) { return __ww_valid? winwin_get_x(ww) : window_get_x(); }
|
||||
function winwin_get_y_safe(ww) { return __ww_valid? winwin_get_y(ww) : window_get_y(); }
|
||||
|
||||
function winwin_get_width_safe(ww) { return __ww_valid? winwin_get_width(ww) : window_get_width(); }
|
||||
function winwin_get_height_safe(ww) { return __ww_valid? winwin_get_height(ww) : window_get_height(); }
|
||||
|
||||
function winwin_mouse_get_x_safe(ww) { return __ww_valid? winwin_mouse_get_x(ww) : device_mouse_x_to_gui(0); }
|
||||
function winwin_mouse_get_y_safe(ww) { return __ww_valid? winwin_mouse_get_y(ww) : device_mouse_y_to_gui(0); }
|
||||
|
||||
function winwin_mouse_is_over_safe(ww) { return __ww_valid? winwin_mouse_is_over(ww) : false; }
|
||||
function winwin_mouse_check_button_safe(ww, bb) { return __ww_valid? winwin_mouse_check_button(ww, bb) : mouse_check_button(bb); }
|
||||
function winwin_mouse_check_button_pressed_safe(ww, bb) { return __ww_valid? winwin_mouse_check_button_pressed(ww, bb) : mouse_check_button_pressed(bb); }
|
||||
function winwin_mouse_check_button_released_safe(ww, bb) { return __ww_valid? winwin_mouse_check_button_released(ww, bb) : mouse_check_button_released(bb); }
|
||||
|
||||
function winwin_keyboard_check_safe(ww, key) { return __ww_valid? winwin_keyboard_check(ww, key) : keyboard_check(key); }
|
||||
function winwin_keyboard_check_pressed_safe(ww, key) { return __ww_valid? winwin_keyboard_check_pressed(ww, key) : keyboard_check_pressed(key); }
|
||||
function winwin_keyboard_check_released_safe(ww, key) { return __ww_valid? winwin_keyboard_check_released(ww, key) : keyboard_check_released(key); }
|
13
scripts/winwin_utils/winwin_utils.yy
Normal file
13
scripts/winwin_utils/winwin_utils.yy
Normal file
|
@ -0,0 +1,13 @@
|
|||
{
|
||||
"$GMScript":"v1",
|
||||
"%Name":"winwin_utils",
|
||||
"isCompatibility":false,
|
||||
"isDnD":false,
|
||||
"name":"winwin_utils",
|
||||
"parent":{
|
||||
"name":"WinMan",
|
||||
"path":"folders/_extensions/WinMan.yy",
|
||||
},
|
||||
"resourceType":"GMScript",
|
||||
"resourceVersion":"2.0",
|
||||
}
|
Loading…
Reference in a new issue