Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
fc-pregmod
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
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
macaronideath
fc-pregmod
Commits
5fbecdb8
Commit
5fbecdb8
authored
6 years ago
by
Stuffed
Browse files
Options
Downloads
Patches
Plain Diff
Add ability to add a comment to the options macro
parent
43a8c98b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/events/intro/introSummary.tw
+11
-5
11 additions, 5 deletions
src/events/intro/introSummary.tw
src/js/optionsMacro.js
+24
-15
24 additions, 15 deletions
src/js/optionsMacro.js
with
35 additions
and
20 deletions
src/events/intro/introSummary.tw
+
11
−
5
View file @
5fbecdb8
...
...
@@ -184,8 +184,9 @@ __''General slave settings''__
Slaves will ''always generate with female names'',
<<option true "Allow male names">>
Slaves ''can generate with male names''.
<<comment>>
This only affects slave generation and not your ability to name your slaves.
<</options>>
//This only affects slave generation and not your ability to name your slaves.//
<br>
<<options $surnameOrder>>
...
...
@@ -202,8 +203,11 @@ __''General slave settings''__
<<option 0 "Disable extended families">>
Slaves ''cannot'' have extended families, just a single relative. //Vanilla Mode.//
<<option 1 "Enable extended families">>
Slaves ''can'' have extended families instead of just a single relative. //May cause lag.//
<</options>> //Extended family mode must be on for the incubation facility to be enabled.//
Slaves ''can'' have extended families instead of just a single relative.
//May cause lag.//
<<comment>>
Extended family mode must be on for the incubation facility to be enabled.
<</options>>
<<if $familyTesting == 1>>
<br>
...
...
@@ -265,9 +269,11 @@ __''Slave age settings''__
<<option 1 "Enable aging">>
Slaves will ''age naturally.''
<<option 2 "Semi aging">>
Slaves ''will'' celebrate birthdays, but ''not age.''
Slaves ''will'' celebrate birthdays, but ''not age.''
<<comment>>
This option cannot be changed during the game
<</options>>
//This option cannot be changed during the game//
<br>
<<if $minimumSlaveAge < 3>>
...
...
This diff is collapsed.
Click to expand it.
src/js/optionsMacro.js
+
24
−
15
View file @
5fbecdb8
...
...
@@ -7,7 +7,7 @@
*/
Macro
.
add
(
'
options
'
,
{
skipArgs
:
false
,
tags
:
[
'
option
'
],
tags
:
[
'
option
'
,
'
comment
'
],
handler
:
function
()
{
try
{
var
currentOption
=
this
.
payload
[
0
].
args
[
0
];
...
...
@@ -18,20 +18,21 @@ Macro.add('options', {
}
var
variable
=
this
.
payload
[
0
].
args
.
full
.
split
(
'
'
,
1
)[
0
].
substring
(
"
State.variables.
"
.
length
);
var
passageName
=
this
.
payload
[
0
].
args
[
1
]
||
passage
();
var
found
=
false
;
var
hasDescription
=
false
;
var
comment
=
null
;
var
description
=
null
;
/* First print out the string for the current value */
for
(
var
i
=
1
,
len
=
this
.
payload
.
length
;
i
<
len
;
++
i
)
{
if
(
this
.
payload
[
i
].
name
===
'
option
'
)
{
if
(
this
.
payload
[
i
].
args
[
0
]
===
currentOption
)
{
if
(
found
)
{
throw
new
Error
(
"
Two 'option' found with the same value
"
)
throw
new
Error
(
"
Two 'option' found with the same value
"
)
;
}
hasDescription
=
!!
this
.
payload
[
i
].
contents
;
jQuery
(
this
.
output
).
wiki
(
'
<span class="optionMacroDescription">
'
+
this
.
payload
[
i
].
contents
+
"
</span>
"
);
description
=
this
.
payload
[
i
].
contents
;
found
=
true
;
}
}
else
if
(
this
.
payload
[
i
].
name
===
'
comment
'
)
{
comment
=
this
.
payload
[
i
].
contents
;
}
else
{
throw
new
Error
(
"
Only valid tag is 'option' inside 'options'
"
)
}
...
...
@@ -40,21 +41,29 @@ Macro.add('options', {
throw
new
Error
(
"
No option found for value
"
+
this
.
payload
[
0
].
args
[
0
]);
}
var
showSelectedOption
=
this
.
payload
.
length
!=
3
||
!
hasD
escription
;
var
showSelectedOption
=
this
.
payload
.
length
!=
3
||
!
d
escription
;
/* Now print out the list of options */
var
output
=
""
;
for
(
var
i
=
1
,
len
=
this
.
payload
.
length
;
i
<
len
;
++
i
)
{
var
args
=
this
.
payload
[
i
].
args
;
var
extraComment
=
args
[
3
]
?
(
'
'
+
args
[
3
])
:
''
;
if
(
args
[
0
]
!==
currentOption
)
{
var
onClickChange
=
args
[
2
]
?
(
'
,
'
+
args
[
2
])
:
''
;
output
+=
'
<span class="optionMacroOption">[[
'
+
args
[
1
]
+
"
|
"
+
passage
()
+
"
][$
"
+
variable
+
"
=
"
+
JSON
.
stringify
(
args
[
0
])
+
onClickChange
+
"
]]
"
+
extraComment
+
"
</span>
"
;
}
else
if
(
showSelectedOption
)
{
output
+=
'
<span class="optionMacroSelected optionMacroOption">
'
+
args
[
1
]
+
extraComment
+
'
</span>
'
;
if
(
this
.
payload
[
i
].
name
===
'
option
'
)
{
var
args
=
this
.
payload
[
i
].
args
;
var
extraComment
=
args
[
3
]
?
(
'
'
+
args
[
3
])
:
''
;
var
className
=
"
optionMacroOption
"
+
(
args
[
1
].
startsWith
(
"
Enable
"
)
?
"
optionMacroEnable
"
:
args
[
1
].
startsWith
(
"
Disable
"
)
?
"
optionMacroDisable
"
:
""
);
if
(
args
[
0
]
!==
currentOption
)
{
var
onClickChange
=
args
[
2
]
?
(
'
,
'
+
args
[
2
])
:
''
;
output
+=
'
<span class="
'
+
className
+
'
">[[
'
+
args
[
1
]
+
"
|
"
+
passageName
+
"
][$
"
+
variable
+
"
=
"
+
JSON
.
stringify
(
args
[
0
])
+
onClickChange
+
"
]]
"
+
extraComment
+
"
</span>
"
;
}
else
if
(
showSelectedOption
)
{
output
+=
'
<span class="optionMacroSelected
'
+
className
+
'
">
'
+
args
[
1
]
+
extraComment
+
'
</span>
'
;
}
}
}
jQuery
(
this
.
output
).
wiki
(
'
<span class="optionMacroOptionsList">
'
+
output
+
"
</span>
"
);
jQuery
(
this
.
output
).
wiki
(
'
<span class="optionMacro">
'
+
'
<span class="optionMacroDescription">
'
+
description
+
"
</span>
"
+
'
<span class="optionMacroOptionsList">
'
+
output
+
"
</span>
"
+
(
comment
?
'
<span class="optionMacroComment">//
'
+
comment
+
"
//</span>
"
:
''
)
+
'
</span>
'
);
}
catch
(
ex
)
{
return
this
.
error
(
'
bad options expression:
'
+
ex
.
message
);
...
...
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