Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Add the ability to display long outputs with multiple lines #1301

Open
Milestone
@kagikn

Description

@kagikn

I hope we will be able to start using ImGui so we can focus on our features rather than how we draw console outputs after we separate the loader and console domain stuff into separate dlls, but using C++/CLI with C# files is preventing us from doing this.

Hopefully, I managed to find a way to find line split points for long strings so we can properly draw long outputs as multiple lines. We should cache results ofEND_TEXT_COMMAND_GET_NUMBER_OF_LINES_FOR_STRING though, because it executes a lot of assembly instructions and is considerably expensive. In my PC, that native took 150 us for a string with about 700 ASCII characters, whileEncoding.GetBytes took only 1 to 1.5 us onEncoding.UTF8 for the same string. You might ask when to invaridate cache of line count results, and I would say when the screen resolution gets changed.
We should do this before releasing v3.7.0, since I'd like to properly show that deprecated API warning properly.

A method for line count...

privateuintGetLineCount(stringstr,floatx,floaty){Function.Call(Hash.BEGIN_TEXT_COMMAND_GET_NUMBER_OF_LINES_FOR_STRING,"CELL_EMAIL_BCON");PushLongString(str);returnFunction.Call<uint>(Hash.END_TEXT_COMMAND_GET_NUMBER_OF_LINES_FOR_STRING,x,y);}

A method for finding the split point/index for a specific line...

boolFindLineSplitPoint(stringstr,uinttargetLineNum,floatx,floaty,outintfoundPos){if(targetLineNum==0||string.IsNullOrEmpty(str)){foundPos=-1;returnfalse;}intstrLength=str.Length;intlow=-1;inthigh=strLength;while((high-low)>1){intmid=low+(high-low)/2;if(GetLineCount(str.Substring(0,(int)mid),x,y)>=targetLineNum+1){high=mid;}else{low=mid;}}foundPos=high;return(foundPos>=0&&foundPos<strLength);}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp