yasirkula / UnityIngameDebugConsole

A uGUI based console to see debug messages and execute commands during gameplay in Unity
MIT License
2.11k stars 221 forks source link

Command added with DebugLogConsole.AddCommandInstance doesn't show up under "help" command. #18

Closed UnquotidianVi closed 4 years ago

UnquotidianVi commented 4 years ago

I added a command using DebugLogConsole.AddCommandInstance() shown below. Command works fine when typed but it doesn't appear under the help command.

image

I might have missed some steps to include the command under help, in which case the documentation should probably be improved.

yasirkula commented 4 years ago

Does this happen in a build or in the editor? If it is the former, are you using IL2CPP or Mono? Does changing the AddCommand function as follows make any difference: DebugLogConsole.AddCommand<string>( "/tp", "changes to specified level", ChangeLevel );

UnquotidianVi commented 4 years ago

It happens in the build, changing the command didn't help. image

UnquotidianVi commented 4 years ago

It actually seems to popup into the editor log. The message just doesn't display all the commands. image

yasirkula commented 4 years ago

Oh, I see 😄 In-game console shows only the first two lines of the logs to save space. But you can click on logs to expand them and see the whole log.

UnquotidianVi commented 4 years ago

Oh, okay. Maybe the help command should call multiple messages to display the commands in that case? It is a bit confusing otherwise. 😄

yasirkula commented 4 years ago

Alternatively, you can expand the last log automatically when a console command is entered. To do so:

public DebugLogItem GetLastLogItem()
{
    return logItemsAtIndices[currentBottomIndex];
}
if( ( logFilter & DebugLogFilter.Info ) == DebugLogFilter.Info )
{
    LateUpdate();
    LayoutRebuilder.ForceRebuildLayoutImmediate( logItemsScrollRect.content );
    recycledListView.UpdateItemsInTheList( true );
    recycledListView.GetLastLogItem().OnPointerClick( nullPointerEventData );
}