feat: handle non-letter characters in actor names with separator rows
Display spaces, hyphens and other non-letter characters as static cells instead of input fields, and add separator rows in the grid for non-alphabetic characters in the main actor's name. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -71,7 +71,25 @@ class GameGridGenerator
|
||||
$rightSize = 0;
|
||||
$grid = [];
|
||||
|
||||
foreach ($game->getRows() as $row) {
|
||||
$mainActorChars = str_split($game->getMainActor()->getName());
|
||||
$rows = $game->getRows()->toArray();
|
||||
$rowIndex = 0;
|
||||
|
||||
foreach ($mainActorChars as $char) {
|
||||
if (!preg_match('/[a-zA-Z]/', $char)) {
|
||||
$grid[] = [
|
||||
'separator' => $char,
|
||||
];
|
||||
continue;
|
||||
}
|
||||
|
||||
$row = $rows[$rowIndex] ?? null;
|
||||
++$rowIndex;
|
||||
|
||||
if ($row === null) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$actor = $row->getActor();
|
||||
$pos = $row->getPosition();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user