Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
UltimateZoneBuilder
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alam Ed Arias
UltimateZoneBuilder
Commits
369403c7
Commit
369403c7
authored
3 years ago
by
biwa
Browse files
Options
Downloads
Patches
Plain Diff
Action browser form: fixed a visual glitch with action ids that have more than 3 digits
parent
0817ea2d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Source/Core/Windows/ActionBrowserForm.cs
+13
-2
13 additions, 2 deletions
Source/Core/Windows/ActionBrowserForm.cs
with
13 additions
and
2 deletions
Source/Core/Windows/ActionBrowserForm.cs
+
13
−
2
View file @
369403c7
...
...
@@ -38,6 +38,7 @@ namespace CodeImp.DoomBuilder.Windows
private
readonly
Label
[]
optionlbls
;
private
readonly
TreeNode
[]
allNodes
;
//mxd
private
readonly
bool
addanyaction
;
//mxd
private
int
actionidmaxdigits
;
// Properties
public
int
SelectedAction
{
get
{
return
selectedaction
;
}
}
...
...
@@ -149,7 +150,8 @@ namespace CodeImp.DoomBuilder.Windows
int
wd
=
(
int
)
e
.
Graphics
.
MeasureString
(
parts
[
parts
.
Length
-
1
],
nodeFont
).
Width
;
nodeRect
.
Width
=
wd
;
SizeF
tagSize
=
e
.
Graphics
.
MeasureString
(
"999 "
,
nodeFont
);
string
pad
=
" "
.
PadLeft
(
actionidmaxdigits
+
1
,
'9'
);
SizeF
tagSize
=
e
.
Graphics
.
MeasureString
(
pad
,
nodeFont
);
if
(
parts
.
Length
==
2
)
nodeRect
.
Width
+=
(
int
)
tagSize
.
Width
;
...
...
@@ -245,8 +247,17 @@ namespace CodeImp.DoomBuilder.Windows
TreeNode
n
=
cn
.
Nodes
.
Add
((
ai
.
Index
>
0
)
?
string
.
Format
(
"{0}\t{1}"
,
ai
.
Index
,
ai
.
Title
)
:
ai
.
Title
);
n
.
Tag
=
ai
;
// Get number of digits in the int. Thanks to https://stackoverflow.com/a/4483960
// We need this for the correct spacing between the action id and the description
if
(
ai
.
Index
>
0
)
{
int
numdigits
=
(
int
)
Math
.
Floor
(
Math
.
Log10
(
ai
.
Index
)
+
1
);
if
(
actionidmaxdigits
<
numdigits
)
actionidmaxdigits
=
numdigits
;
}
// This is the given action?
if
(
ai
.
Index
==
action
)
if
(
ai
.
Index
==
action
)
{
// Select this and expand the category
cn
.
Expand
();
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment