Moved to lasted bassbone

This commit is contained in:
Willem Cazander 2024-04-22 20:32:30 +02:00
parent 002f6bcbc4
commit 11989ed12e
26 changed files with 340 additions and 348 deletions

View file

@ -36,6 +36,7 @@ import imgui.ImColor;
import imgui.ImDrawList;
import imgui.ImGui;
import imgui.ImVec2;
import imgui.type.ImBoolean;
import imgui.type.ImInt;
import love.distributedrebirth.gdxapp4d.vrgem4.service.VrGem4Unicode4DService;
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.AbstractDeskApp;
@ -43,49 +44,61 @@ import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppContourSec
import love.distributedrebirth.gdxapp4d.vrgem4.service.deskapp.DeskAppRenderer;
import love.distributedrebirth.unicode4d.draw.DrawCharacter;
import love.distributedrebirth.unicode4d.draw.ImCharacter;
import ᒢᐩᐩ.ᒃᣔᔆᔆᒃᐤᐤᣕ.Bãß;
import ᒢᐩᐩ.ᒃᣔᔆᔆᒃᐤᐤᣕ.DefaultBãßBȍőnʸᴰ;
import ᒢᐩᐩ.ᒃᣔᔆᔆᒃᐤᐤᣕ.ᒃᐤᣔᐪ.BãßBȍőnBőatꞱᴿᴳᴮ;
import ᒢᐩᐩ.ᒃᣔᔆᔆᒃᐤᐤᣕ.ᒄᓫᣔᐪᑋ.BãßBȍőnCoffinGhostCharm;
import ᒢᐩᐩ.ᒃᣔᔆᔆᒃᐤᐤᣕ.ᒄᓫᣔᐪᑋ.ᔆᣖᑊᒄᓫᣗ.BãßBȍőnSpiderEgg注;
import ᒢᐩᐩ.ᒃᣔᔆᔆᒃᐤᐤᣕ.ᒄᓫᣔᐪᑋ.ᔆᣖᑊᒄᓫᣗ.BãßBȍőnSpiderWire注;
import ᒢᐩᐩ.ᒃᣔᔆᔆᒃᐤᐤᣕ.ᒼᒻᣔᙆᙆ.ᣖᑊᣗᣔᐪᓫ.BãßBȍőnꝐŕḯṿª;
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᐪᓫᕽᐪ.StringGhostKey;
import ᒢᐩᐩ.ᒃᣔᔆᔆᒃᐤᐤᣕ.ᒼᒻᣔᙆᙆ.ᣖᑊᣗᣔᐪᓫ.BãßBȍőnꝐḯŕḕʸᴰ;
import ᒢᐩᐩ.ᒃᣔᔆᔆᒃᐤᐤᣕ.ᔿᓑᔿᔿᔋᐝᣚ.BãßᛗᚢᛗᛗᛉBoneBabe𓄯;
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᒢℭỗᶇṧⱦᶏꬼȶʂ;
import ᒢᐩᐩ.ᒡᒢᑊᒻᒻᓫᔿ.ᐪᓫᕽᐪ.ᓑᣕᣳᒼᐤᒄᓫ.UnicodePlane;
import ᒢᐩᐩ.ᔆʸᔆᐪᓫᔿ.ᒃᣔᒃᓫᒻ.ᑊᐣᓑᖮᐪᔆ.DuytsDocAuthor注;
@DuytsDocAuthor注(name = "للَّٰهِilLצسُو", copyright = "©Δ∞ 仙上主天")
public class NotepadDeskApp extends AbstractDeskApp implements DeskAppRenderer, DefaultBãßBȍőnʸᴰ<NotepadDeskApp> {
public class NotepadDeskApp extends AbstractDeskApp implements DeskAppRenderer, BãßᛗᚢᛗᛗᛉBoneBabe𓄯<NotepadDeskApp> {
//private final VrGem4Unicode4DService unicode4DService;
private final int gridWidth = 120;
private final int gridHeight = 40;
private final String gridChars;
private final int[][] gridBuffer;
private final int[] gridRank;
private final Random random;
private int runCounter;
private final ImInt runSpeed = new ImInt(Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_TEN);
private final static char DEFAULT_CHAR = 'ﷲ';
private final ImInt runSpeed = new ImInt(ᒢℭỗᶇṧⱦᶏꬼȶʂ.INTᣟᐧᣟTEN);
private final ImBoolean runChina = new ImBoolean(false);
private final static char DEFAULT_CHAR = '亞';
private final static UnicodePlane[] GRID_PLANES = {
UnicodePlane.BRAHMI,
UnicodePlane.UGARITIC,
UnicodePlane.BAMUM_SUPPLEMENT,
UnicodePlane.TAI_XUAN_JING_SYMBOLS
};
private final static UnicodePlane[] GRID_PLANES_CHINA = {
UnicodePlane.CJK_UNIFIED_IDEOGRAPHS,
UnicodePlane.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_A,
UnicodePlane.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_B,
UnicodePlane.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_C,
UnicodePlane.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_D,
UnicodePlane.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_E,
UnicodePlane.CJK_UNIFIED_IDEOGRAPHS_EXTENSION_F
};
private final static int Y_LINE_COLOR = ImColor.intToColor(200, 10, 10);
private String gridChars;
private int[] yLine;
private float[] yScale;
public static final class Ꝑŕḯṿª implements BãßBȍőnꝐŕḯṿª {
private static final StringGhostKey GHOST_BUNDLE = StringGhostKey.asciiᴳʰᵒˢᵗ();
enum ꝐŕḯṿªḕꝐḯŕḕʸᴰ implements BãßBȍőnꝐḯŕḕʸᴰ {
𑀳𑁂𑀮𑀺,𑀉𑁄,𑀤𑁄,𑀭𑁂,𑀡,𑀪𑀸,𑀕;
private static final BãßBȍőnCoffinGhostCharm GHOST_BUNDLE = BãßBȍőnCoffinGhostCharm.hocusᴾᵒᶜᵘˢ();
@BãßBȍőnSpiderWire注
@BãßBȍőnSpiderWire注(paint = BãßBȍőnBőatꞱᴿᴳᴮ.ẞassPaint.ꞱTBoneWire.class)
private NotepadDeskApp boon;
@BãßBȍőnSpiderEgg注()
@BãßBȍőnSpiderEgg注
public VrGem4Unicode4DService locateVrGem4Unicode4DService() {
Class<?> eggType = VrGem4Unicode4DService.class;
BundleContext context = boon.toBBC().onheilig(Ꝑŕḯṿª.class).GHOST_OBJ(GHOST_BUNDLE, BundleContext.class);
BundleContext context = boon.thisᵀᴮᵒⁿᵉᴳʳᵃᵛᵉ().onheɨlḮg(ꝐŕḯṿªḕꝐḯŕḕʸᴰ.class).gềễstDɨng(GHOST_BUNDLE, BundleContext.class);
ServiceReference<?> serviceRef = context.getServiceReference(eggType);
Object service = context.getService(serviceRef);
@ -99,27 +112,20 @@ public class NotepadDeskApp extends AbstractDeskApp implements DeskAppRenderer,
public NotepadDeskApp(BundleContext context, VrGem4Unicode4DService unicode4DService3) {
toBBC().onheiligeSpreuk(Ꝑŕḯṿª.class).PUT_GHOST(Ꝑŕḯṿª.GHOST_BUNDLE, context); // tmp test
Bãß.石棺ʸᴰ.أَكْبَرײꣻײالله.𓂀ױןייזדזיודזיןןזזזןױ𓉢(this);
thisᵀᴮᵒⁿᵉᴳʳᵃᵛᵉ().onheɨlḮgSpreǜk(ꝐŕḯṿªḕꝐḯŕḕʸᴰ.class).bewaarGềễst(ꝐŕḯṿªꝐḯŕḕʸᴰ.GHOST_BUNDLE, context); // tmp test
亞ᶦᶦᶦ.thisʸᴰᐧᐧᶜᵒⁿˢᵗʳᵘᶜᵗᵒʳ(thisᵀᴮᵒⁿᵉ());
//this.unicode4DService = unicode4DService;
this.gridBuffer = new int[gridHeight][gridWidth];
this.gridRank = new int[gridWidth];
this.random = new Random();
for (int y=Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ZERO; y<gridWidth; y++) {
gridRank[y] = Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ZERO;
for (int x=Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ZERO; x<gridHeight; x++) {
gridBuffer[x][y] = Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.CHAR_SPACE;
for (int y=ᒢℭỗᶇṧⱦᶏꬼȶʂ.INTᣟᐧᣟZERO; y<gridWidth; y++) {
gridRank[y] = ᒢℭỗᶇṧⱦᶏꬼȶʂ.INTᣟᐧᣟZERO;
for (int x=ᒢℭỗᶇṧⱦᶏꬼȶʂ.INTᣟᐧᣟZERO; x<gridHeight; x++) {
gridBuffer[x][y] = ᒢℭỗᶇṧⱦᶏꬼȶʂ.CHARᣟᐧᣟSPACE;
}
}
StringBuilder buf = new StringBuilder();
buf.append("仙上主天");
for (UnicodePlane plane:GRID_PLANES) {
for (int i=plane.getStart();i<plane.getStop();i++) {
buf.appendCodePoint(i);
}
}
gridChars = buf.toString();
gridChars = createGridChars();
yLine = new int[4];
yScale = new float[4];
}
@ -131,17 +137,22 @@ public class NotepadDeskApp extends AbstractDeskApp implements DeskAppRenderer,
@Override
public void render() {
ImGui.sliderInt(Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.STR_SPACE, runSpeed.getData(), 0, 60); // empty ID not allowed in ImGui, but whitespace is an ID :)
ImGui.sliderInt(ᒢℭỗᶇṧⱦᶏꬼȶʂ.STRᣟᐧᣟSPACE, runSpeed.getData(), 0, 60); // empty ID not allowed in ImGui, but whitespace is an ID :)
ImGui.sameLine();
ImCharacter.render("speedId", "RunSpeed", DEFAULT_CHAR, v -> unicode4DService.getCharacterForUnicode(v));
if (ImGui.checkbox("Chinees", runChina)) {
gridChars = createGridChars();
}
ImGui.sameLine();
ImCharacter.render("speedId", "Speed", DEFAULT_CHAR, v -> unicode4DService.getCharacterForUnicode(v));
ImGui.invisibleButton("matrix", ImGui.getWindowWidth(), ImGui.getWindowHeight()-(2*ImGui.getFontSize()));
ImVec2 p0 = ImGui.getItemRectMin();
ImVec2 p1 = ImGui.getItemRectMax();
ImDrawList drawList = ImGui.getWindowDrawList();
drawList.pushClipRect(p0.x, p0.y, p1.x, p1.y);
for(int y=Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ZERO; y<gridHeight; y++) {
for(int x=Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ZERO; x<gridWidth; x++) {
for(int y=ᒢℭỗᶇṧⱦᶏꬼȶʂ.INTᣟᐧᣟZERO; y<gridHeight; y++) {
for(int x=ᒢℭỗᶇṧⱦᶏꬼȶʂ.INTᣟᐧᣟZERO; x<gridWidth; x++) {
int unicodeChar = gridBuffer[y][x];
DrawCharacter drawChar = unicode4DService.getCharacterForUnicode(unicodeChar);
if (drawChar == null) {
@ -169,39 +180,53 @@ public class NotepadDeskApp extends AbstractDeskApp implements DeskAppRenderer,
updateGrid();
}
private String createGridChars() {
StringBuilder buf = new StringBuilder();
UnicodePlane[] planes = GRID_PLANES;
if (runChina.get()) {
planes = GRID_PLANES_CHINA;
}
for (UnicodePlane plane:planes) {
for (int i=plane.getStart();i<plane.getStop();i++) {
buf.appendCodePoint(i);
}
}
return buf.toString();
}
private void updateGrid() {
runCounter++;
if (runCounter < runSpeed.get()) {
return;
}
runCounter = Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ZERO;
runCounter = ᒢℭỗᶇṧⱦᶏꬼȶʂ.INTᣟᐧᣟZERO;
for (int i=0;i<4;i++) {
if (yLine[i] == 0) {
yLine[i] = random.nextInt(gridHeight);
yScale[i] = 1f;
yScale[i] = ᒢℭỗᶇṧⱦᶏꬼȶʂ.FLOATᣟᐧᣟONE;
}
}
for (int x=gridHeight-1; x>Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ZERO; x--) {
for (int y=Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ZERO; y<gridWidth; y++) {
for (int x=gridHeight-1; x>ᒢℭỗᶇṧⱦᶏꬼȶʂ.INTᣟᐧᣟZERO; x--) {
for (int y=ᒢℭỗᶇṧⱦᶏꬼȶʂ.INTᣟᐧᣟZERO; y<gridWidth; y++) {
gridBuffer[x][y] = gridBuffer[x-1][y];
}
}
for (int y=0; y<gridWidth; y++) {
int charSelect = Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ZERO;
for (int i=Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ZERO;i<4;i++) {
int charSelect = ᒢℭỗᶇṧⱦᶏꬼȶʂ.INTᣟᐧᣟZERO;
for (int i=ᒢℭỗᶇṧⱦᶏꬼȶʂ.INTᣟᐧᣟZERO;i<4;i++) {
charSelect = gridChars.codePointAt(random.nextInt(gridChars.length()));
DrawCharacter drawChar = unicode4DService.getCharacterForUnicode(charSelect);
if (drawChar != null) {
break;
}
}
if (gridRank[y] > Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ZERO) {
gridBuffer[Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ZERO][y] = random.nextInt(100)<70? charSelect:Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.CHAR_SPACE;
if (gridRank[y] > ᒢℭỗᶇṧⱦᶏꬼȶʂ.INTᣟᐧᣟZERO) {
gridBuffer[ᒢℭỗᶇṧⱦᶏꬼȶʂ.INTᣟᐧᣟZERO][y] = random.nextInt(100)<70? charSelect:ᒢℭỗᶇṧⱦᶏꬼȶʂ.CHARᣟᐧᣟSPACE;
} else {
gridBuffer[Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ZERO][y] = random.nextInt(100)<Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ONE? charSelect:Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.CHAR_SPACE;
gridBuffer[ᒢℭỗᶇṧⱦᶏꬼȶʂ.INTᣟᐧᣟZERO][y] = random.nextInt(100)<ᒢℭỗᶇṧⱦᶏꬼȶʂ.INTᣟᐧᣟONE? charSelect:ᒢℭỗᶇṧⱦᶏꬼȶʂ.CHARᣟᐧᣟSPACE;
}
if (gridBuffer[0][y]==Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.CHAR_SPACE) {
gridRank[y] = Bãß.ℭỗᶇṧⱦᶏꬼȶʂ.INT_ZERO;
if (gridBuffer[0][y]==ᒢℭỗᶇṧⱦᶏꬼȶʂ.CHARᣟᐧᣟSPACE) {
gridRank[y] = ᒢℭỗᶇṧⱦᶏꬼȶʂ.INTᣟᐧᣟZERO;
} else {
gridRank[y]++;
}