Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
2ef4a367
Commit
2ef4a367
authored
16 years ago
by
mcmlxxix
Browse files
Options
Downloads
Patches
Plain Diff
menu now only displays items that are enabled
parent
6ed6646e
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
xtrn/dicewarz/menu.js
+15
-10
15 additions, 10 deletions
xtrn/dicewarz/menu.js
with
15 additions
and
10 deletions
xtrn/dicewarz/menu.js
+
15
−
10
View file @
2ef4a367
function
Menu
(
title
,
x
,
y
,
color
,
hkey_color
)
{
//MENU CLASSES
this
.
title
=
title
;
this
.
disabled
=
[];
this
.
disabled_color
=
"
\
1k
\
1h
"
;
//
this.disabled=[];
//
this.disabled_color="\1k\1h";
this
.
items
=
[];
var
orig_x
=
x
;
var
orig_y
=
y
;
...
...
@@ -22,7 +22,7 @@ function Menu(title,x,y,color,hkey_color)
var
cleared
=
0
;
for
(
i
in
this
.
items
)
{
if
(
!
this
.
dis
abled
[
i
]
)
if
(
this
.
items
[
i
].
en
abled
)
{
console
.
gotoxy
(
orig_x
,
yyyy
);
yyyy
++
;
console
.
putmsg
(
this
.
items
[
i
].
text
);
...
...
@@ -38,15 +38,19 @@ function Menu(title,x,y,color,hkey_color)
}
WipeCursor
(
"
right
"
);
}
this
.
disable
=
function
(
item
)
this
.
disable
=
function
(
item
s
)
{
this
.
disabled
[
item
]
=
true
;
this
.
items
[
item
].
Init
(
this
.
disabled_color
,
this
.
disabled_color
)
for
(
item
in
items
)
{
this
.
items
[
items
[
item
]].
enabled
=
false
;
}
}
this
.
enable
=
function
(
item
)
this
.
enable
=
function
(
item
s
)
{
this
.
disabled
[
item
]
=
false
;
this
.
items
[
item
].
Init
(
color
,
hkey_color
);
for
(
item
in
items
)
{
this
.
items
[
items
[
item
]].
enabled
=
true
;
}
}
this
.
add
=
function
(
items
)
{
...
...
@@ -72,7 +76,7 @@ function Menu(title,x,y,color,hkey_color)
console
.
gotoxy
(
orig_x
,
orig_y
);
for
(
i
in
this
.
items
)
{
console
.
putmsg
(
this
.
items
[
i
].
text
+
"
"
);
if
(
this
.
items
[
i
].
enabled
)
console
.
putmsg
(
this
.
items
[
i
].
text
+
"
"
);
}
WipeCursor
(
"
left
"
);
}
...
...
@@ -82,6 +86,7 @@ function MenuItem(item,hotkey,color,hkey_color)
this
.
displayColor
=
color
;
this
.
keyColor
=
hkey_color
;
this
.
item
=
item
;
this
.
enabled
=
true
;
this
.
hotkey
=
hotkey
;
this
.
Init
=
function
(
color
,
hkey_color
)
...
...
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