Skip to content

Commit

Permalink
update project
Browse files Browse the repository at this point in the history
  • Loading branch information
xpenatan committed Jun 17, 2024
1 parent 17e3423 commit 1255c17
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,9 @@
import imgui.ImGui;
import imgui.ImGuiCond;
import imgui.ImVec2;
import imgui.extension.textedit.Coordinates;
import imgui.extension.textedit.LanguageDefinition;
import imgui.extension.textedit.LanguageDefinitionId;
import imgui.extension.textedit.TextEditor;
import imgui.idl.helper.IDLString;
import imgui.idl.helper.IDLInt;
import lua.LuaErrorStatus;
import lua.Lua;
import lua.LuaState;
Expand All @@ -30,13 +29,11 @@ public void show() {
super.show();
editor = new TextEditor();

LanguageDefinition languageDefinition = LanguageDefinition.Lua();
int languageDefinition = LanguageDefinitionId.Lua;
editor.SetLanguageDefinition(languageDefinition);

String code = Gdx.files.internal("data/script.lua").readString();
IDLString text = new IDLString();
text.append(code);
editor.SetText(text);
editor.SetText(code);
lua = new Lua();

LuaState luaState = lua.getLuaState();
Expand Down Expand Up @@ -86,11 +83,11 @@ public void update() {
}

void renderEditText() {
Coordinates coordinates = editor.GetCursorPosition();
editor.GetCursorPosition(IDLInt.TMP_1, IDLInt.TMP_2);

ImGui.SetNextWindowSize(ImVec2.TMP_1.set(600, 500), ImGuiCond.ImGuiCond_Once);
ImGui.Begin("Editor");
String text = "\t" + (coordinates.mLine() + 1) + "/" + (coordinates.mColumn() + 1) + " " + editor.GetTotalLines() + " lines | " + (editor.IsOverwrite() ? "Ovr" : "Ins") + " | " + (editor.CanUndo() ? "*" : " ") + " | " + editor.GetLanguageDefinition().mName().c_str();
String text = "\t" + (IDLInt.TMP_1.getValue() + 1) + "/" + (IDLInt.TMP_2.getValue() + 1) + " " + editor.GetLineCount() + " lines | " + (editor.IsOverwriteEnabled() ? "Ovr" : "Ins") + " | " + (editor.CanUndo() ? "*" : " ") + " | " + editor.GetLanguageDefinitionName().c_str();
if(ImGui.Button("Build")) {
String scriptText = editor.GetText().c_str();
buildScript(scriptText);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,7 @@ public abstract class ImGuiRenderer extends ScreenAdapter {

@Override
public void show() {
if(Gdx.app.getType() == Application.ApplicationType.WebGL) {
// Not possible to have ini filename with webgl
ImGui.CreateContext(false);
}
else {
ImGui.CreateContext(true);
}
ImGui.CreateContext();

ImGuiIO io = ImGui.GetIO();
io.ConfigFlags(ImGuiConfigFlags.ImGuiConfigFlags_DockingEnable);
Expand Down Expand Up @@ -62,6 +56,7 @@ public void resume() {

@Override
public void hide() {
impl.dispose();
ImGui.disposeStatic();
ImGui.DestroyContext();
}
Expand Down
2 changes: 1 addition & 1 deletion gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
distributionUrl=https\://services.gradle.org/distributions/gradle-8.4-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
Expand Down
2 changes: 1 addition & 1 deletion lua/lua-base/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
dependencies {
implementation("com.github.xpenatan.jParser:base:${LibExt.jParserVersion}")
implementation("com.github.xpenatan.jParser:jParser-base:${LibExt.jParserVersion}")
implementation("com.github.xpenatan.jParser:loader-core:${LibExt.jParserVersion}")
}
10 changes: 5 additions & 5 deletions lua/lua-build/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@ val mainClassName = "Main"

dependencies {
implementation(project(":lua:lua-base"))
implementation("com.github.xpenatan.jParser:core:${LibExt.jParserVersion}")
implementation("com.github.xpenatan.jParser:builder:${LibExt.jParserVersion}")
implementation("com.github.xpenatan.jParser:teavm:${LibExt.jParserVersion}")
implementation("com.github.xpenatan.jParser:cpp:${LibExt.jParserVersion}")
implementation("com.github.xpenatan.jParser:idl:${LibExt.jParserVersion}")
implementation("com.github.xpenatan.jParser:jParser-core:${LibExt.jParserVersion}")
implementation("com.github.xpenatan.jParser:jParser-build:${LibExt.jParserVersion}")
implementation("com.github.xpenatan.jParser:jParser-teavm:${LibExt.jParserVersion}")
implementation("com.github.xpenatan.jParser:jParser-cpp:${LibExt.jParserVersion}")
implementation("com.github.xpenatan.jParser:jParser-idl:${LibExt.jParserVersion}")
}

tasks.register<JavaExec>("build_project") {
Expand Down

0 comments on commit 1255c17

Please sign in to comment.