overload-development-community / OverloadLevelEditor

Overload Level Editor
MIT License
8 stars 6 forks source link

Tunnel builder window default width is approximately double what's needed #8

Open CHILLYBUS opened 3 years ago

CHILLYBUS commented 3 years ago

Title

SiriusTR commented 3 years ago

I thought this would be easy to fix. It isn't.

The cause is that the tunnel builder is a dockable window, which means DockPanelSuite is responsible for deciding what the size is. It uses a default floating panel size for the window, and ignores the space its content actually requires. (I haven't found where it gets the default size from yet.) The entity list also behaves the same way, but because of the nature of its content, it's not so obvious.

There are a few routes I can see to fix this (ignoring total hacks, anyway):

  1. Make the tunnel builder non-dockable. By far the easiest way to do it, but also kind of a cop-out.
  2. Upgrade the DockPanelSuite version. The version that OLE is using is ancient (7 years old) and it's possible that newer versions provide better ways to configure floating panel behavior. This wouldn't be free, though, since there are breaking changes in the way skins are handled in new versions, and it'd also be necessary to distribute an updated .dll with the editor.
  3. Implement some kind of override for floating panel positioning that takes the content size into account. Some prospects can be found here: https://stackoverflow.com/questions/3502759/weifenluo-dock-panel-suite-float-windows-using-their-design-size We'd need to take the size of the window non-client area into account, though; some of the solutions on that article do not appear to handle it correctly.

Also see https://github.com/dockpanelsuite/dockpanelsuite/issues/56 - I'm not sure using preferences is a good answer in this case, since the problem isn't really persisting the window size but getting the initial size right. But it does provide some insight into what's going on here.

Pile-It-On commented 3 years ago

The properties state 163, 764.

Actual is 345, 779.

Is this the discrepancy you're talking about?

Pile-It-On commented 3 years ago

I think you can just change Max size property to 163, 764.

It's currently set to 400, 930.

SiriusTR commented 3 years ago

Kinda sorta. If you do that, you can still manually shrink the window, but not make it any larger than that. A bit weird. Might be able to make it non-resizable and "fix" that... after a fashion. It's still a little hacky, but I don't know whether anyone would actually care much.

Pile-It-On commented 3 years ago

Actually just use 0,0 as Max size that'll default to the size property as God Mode (LOL)

Pile-It-On commented 3 years ago

I must not be understanding the criteria of this thread as placing the the desired size of a floating window in its properties.size field can not be considered in any way 'hacky'

Pile-It-On commented 3 years ago

Not to beat a dead horse... Well maybe to do just that.

The default prefs for the editor do not even contain a TunnelBuilder entry NOTE:

0|I;insert_advance|T| B;tex_list_loc.x|20| I;tex_list_sz.y|778| I;tex_list_sz.x|464| I;recent0| D:\OverloadLevelEditor_Build-37\Levels\shoot2.overload| S;entity_pivot|4| I;recent3|| S;uv_editor_sz.x|971| I;recent2|| S;texture_set_list_sz.y|561| I;texture_set_list_sz.x|411| I;view_mode_persp|4| I;num_texture_collections|0| I;texture_set_list_loc.x|40| I;grid_snap|2| F;uv_editor_loc.y|80| I;decal_list_sz.x|527| I;decal_list_sz.y|928| I;recent1|| S;view_persp_fov|60| I;decal_list_loc.y|60| I;view_mode_ortho|0| I;tex_list_loc.y|20| I;coplanar_tol|20| I;layout|77u/

///////

S;drag_mode|1| I;auto_center|F| B;uv_editor_vis|F| B;show_segment_numbers|0| I;texture_set_list_vis|F| B;m_cached_username|| S;tex_list_vis|F| B;bg_color|0| I;decal_list_loc.x|60| I;insert_decal|0| I;rotate_angle|15| I;mm_edit_type|1| I;clip_decal|1| I;grid_display|1| I;view_layout|4| I;uv_editor_sz.y|840| I;uv_editor_loc.x|80| I;m_cached_clientname|| S;decal_list_vis|F| B;texture_set_list_loc.y|40| I;side_select|0|I;lighting_type|1| I;grid_spacing|4| I;mm_op_mode|2|I