File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -73,9 +73,11 @@ function populateServantDropdown(servantDataArray) {
7373 // Add each Servant to the dropdown
7474 servantDataArray . forEach ( servant => {
7575 const option = document . createElement ( "option" ) ;
76- option . value = servant . id ; // Use Servant ID
77- option . textContent = servant . name ; // Set name to text content
78- option . dataset . name = servant . name ; // Store name in dataset
76+ // Extract a shortname; if you have a better key, replace servant.name here
77+ const shortName = servant . name . split ( " " ) [ 0 ] ; // crude fallback: take first word like "Artoria"
78+ option . value = shortName ; // store shortname for simulator matching
79+ option . textContent = servant . name ; // full display name for user
80+ option . dataset . id = servant . id ; // store numeric ID if needed later
7981 dropdown . appendChild ( option ) ; // <-- fix here
8082 } ) ;
8183 } ) ;
@@ -176,8 +178,9 @@ function saveParticipantsAndStartSimulation() {
176178 const selectedOption = servantDropdown . options [ selectedIndex ] ;
177179
178180 if ( selectedOption ) {
179- servantId = selectedOption . value || "Unknown" ;
180- servantName = selectedOption . textContent || "Unknown" ;
181+ servantId = selectedOption . dataset . id || "Unknown" ; // numeric ID if needed
182+ servantName = selectedOption . value || "Unknown" ; // shortname the simulator expects
183+
181184
182185 console . log ( `Team ${ index + 1 } - Selected Servant: id=${ servantId } , name=${ servantName } ` ) ;
183186 } else {
You can’t perform that action at this time.
0 commit comments