mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-24 04:41:10 +00:00
45c3cbaae3
Fixed, "Open Map Options" and "Change Map" windows: fixed incorrect size of the items in the maps list when using high-DPI scaling. Updated ZDoom_DECORATE.cfg and ZDoom_MAPINFO.cfg.
51 lines
1.6 KiB
C#
51 lines
1.6 KiB
C#
using System;
|
|
using System.Windows.Forms;
|
|
using CodeImp.DoomBuilder.Config;
|
|
|
|
namespace CodeImp.DoomBuilder.Controls.Scripting
|
|
{
|
|
internal class ScriptIconsManager
|
|
{
|
|
private int scripttypeiconsoffset;
|
|
private int scriptgroupiconsoffset;
|
|
private int scriptgroupopeniconsoffset;
|
|
private ImageList icons;
|
|
|
|
internal int ScriptTypeIconsOffset { get { return scripttypeiconsoffset; } }
|
|
internal int ScriptGroupIconsOffset { get { return scriptgroupiconsoffset; } }
|
|
internal int ScriptGroupOpenIconsOffset { get { return scriptgroupopeniconsoffset; } }
|
|
public ImageList Icons { get { return icons; } }
|
|
|
|
public ScriptIconsManager(ImageList icons)
|
|
{
|
|
this.icons = icons;
|
|
|
|
int numicons = Enum.GetNames(typeof(ScriptType)).Length;
|
|
scriptgroupopeniconsoffset = icons.Images.Count - numicons;
|
|
scriptgroupiconsoffset = scriptgroupopeniconsoffset - numicons;
|
|
scripttypeiconsoffset = scriptgroupiconsoffset - numicons;
|
|
}
|
|
|
|
public int GetResourceIcon(int datalocationtype)
|
|
{
|
|
return datalocationtype;
|
|
}
|
|
|
|
public int GetScriptIcon(ScriptType type)
|
|
{
|
|
int scripttype = (int)type + scripttypeiconsoffset;
|
|
if(scripttype >= scriptgroupiconsoffset) scripttype = scripttypeiconsoffset;
|
|
return scripttype;
|
|
}
|
|
|
|
public int GetScriptFolderIcon(ScriptType type, bool opened)
|
|
{
|
|
int scripttype = (int)type;
|
|
if(scripttype >= scriptgroupiconsoffset - scripttypeiconsoffset)
|
|
scripttype = scripttypeiconsoffset;
|
|
|
|
if(opened) return scriptgroupopeniconsoffset + scripttype;
|
|
return scriptgroupiconsoffset + scripttype;
|
|
}
|
|
}
|
|
}
|