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
77a42412
Commit
77a42412
authored
5 years ago
by
svornost
Browse files
Options
Downloads
Patches
Plain Diff
Add JS Random Event event name to storyCaption to assist in debugging.
parent
61f39734
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/events/001-base/baseEvent.js
+8
-0
8 additions, 0 deletions
src/events/001-base/baseEvent.js
src/events/randomEvent.js
+2
-2
2 additions, 2 deletions
src/events/randomEvent.js
src/gui/storyCaption.tw
+3
-0
3 additions, 0 deletions
src/gui/storyCaption.tw
with
13 additions
and
2 deletions
src/events/001-base/baseEvent.js
+
8
−
0
View file @
77a42412
...
...
@@ -56,6 +56,14 @@ App.Events.BaseEvent = class BaseEvent {
return
JSON
.
reviveWrapper
(
`new App.Events.
${
this
.
constructor
.
name
}
(
${
JSON
.
stringify
(
this
.
actors
)}
,
${
JSON
.
stringify
(
this
.
params
)}
)`
);
}
/** get the event's (human-readable) name. must not include ":".
* default implementation should generally suffice (though we might want to de-camelcase here or something).
* @returns {string}
*/
get
eventName
()
{
return
this
.
constructor
.
name
;
}
/** build the actual list of actors that will be involved in this event.
* default implementation should suffice for child classes with a fixed number of actors; may be overridden for events with variable actor count.
* @param {App.Entity.SlaveState} firstActor - if non-null, the first actor should be this slave (fail if she is not qualified)
...
...
This diff is collapsed.
Click to expand it.
src/events/randomEvent.js
+
2
−
2
View file @
77a42412
...
...
@@ -39,13 +39,13 @@ App.Events.getNonindividualEvents = function() {
/** get a stringified list of possible individual events as fake passage names - TODO: kill me */
App
.
Events
.
getIndividualEventsPassageList
=
function
(
slave
)
{
const
events
=
App
.
Events
.
getIndividualEvents
(
slave
);
return
events
.
map
(
e
=>
`JSRE
${
e
.
constructor
.
n
ame
}
:
${
JSON
.
stringify
(
e
.
toJSON
())}
`
);
return
events
.
map
(
e
=>
`JSRE
${
e
.
eventN
ame
}
:
${
JSON
.
stringify
(
e
.
toJSON
())}
`
);
};
/** get a stringified list of possible individual events as fake passage names - TODO: kill me */
App
.
Events
.
getNonindividualEventsPassageList
=
function
()
{
const
events
=
App
.
Events
.
getNonindividualEvents
();
return
events
.
map
(
e
=>
`JSRE
${
e
.
constructor
.
n
ame
}
:
${
JSON
.
stringify
(
e
.
toJSON
())}
`
);
return
events
.
map
(
e
=>
`JSRE
${
e
.
eventN
ame
}
:
${
JSON
.
stringify
(
e
.
toJSON
())}
`
);
};
/** execute a fake event passage from the embedded JSON - TODO: kill me */
...
...
This diff is collapsed.
Click to expand it.
src/gui/storyCaption.tw
+
3
−
0
View file @
77a42412
...
...
@@ -62,6 +62,9 @@
<<if $ui != "start" && _Pass != "Encyclopedia">>
<<if $cheatMode || $debugMode>>
<div>_Pass</div>
<<if _Pass == "JS Random Event">>
<div><<= $event.eventName>></div>
<</if>>
<</if>>
<div>
<span id="week">''Week $week''</span>
...
...
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