Skip to content
This repository has been archived by the owner on Nov 20, 2024. It is now read-only.

Commit

Permalink
Update to 2024.7-beta.1: Add local commands module, update Minecraft …
Browse files Browse the repository at this point in the history
…module and fix german translation
  • Loading branch information
danieldieeins committed Jun 24, 2024
1 parent 3283015 commit 1c17dd0
Show file tree
Hide file tree
Showing 29 changed files with 331 additions and 261 deletions.
4 changes: 2 additions & 2 deletions application-main/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
<parent>
<groupId>com.zyneonstudios</groupId>
<artifactId>nexus-application</artifactId>
<version>2024.6</version>
<version>2024.7</version>
</parent>

<artifactId>application-main</artifactId>
<version>2024.6-beta.4</version>
<version>2024.7-beta.1</version>

<properties>
<maven.compiler.source>17</maven.compiler.source>
Expand Down
2 changes: 2 additions & 0 deletions application-main/src/main/java/com/zyneonstudios/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ public class Main {
*/

public static void main(String[] args) {
// Creating new splash icon
splash = new ZyneonSplash();
// Showing splash icon
splash.setVisible(true);
// Creating application config
new ApplicationConfig(args);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,13 @@ public FrameConnector(ApplicationFrame frame) {

// Method to resolve requests received by the FrameConnector
public void resolveRequest(String request) {
// Logging the resolution process
NexusApplication.getLogger().debug("[CONNECTOR] resolving "+request+"...");
//If test or debug is enabled, print out every request
if(ApplicationConfig.test) {
NexusApplication.getLogger().error("[CONNECTOR] (Request-Reader) resolving "+request+"...");
} else {
NexusApplication.getLogger().debug("[CONNECTOR] (Request-Reader) resolving "+request+"...");
}

// Checking the type of request
if(request.startsWith("sync.")) {
// If the request starts with "sync.", call the sync method
Expand All @@ -46,7 +51,7 @@ public void resolveRequest(String request) {
}

private void init(String request) {
frame.executeJavaScript("syncDesktop(); setColors('"+ApplicationConfig.theme+"');");
frame.executeJavaScript("syncDesktop();");
if(request.equals("discover")) {
frame.executeJavaScript("activateMenu('menu',true); document.getElementById('search-bar').disabled = false; document.getElementById('search-bar').placeholder = searchTerm;");
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void stateHasChanged(CefApp.CefAppState state) {
}
});
setIconImage(ImageIO.read(Objects.requireNonNull(getClass().getResource("/logo.png"))).getScaledInstance(32, 32, Image.SCALE_SMOOTH));
builder.getCefSettings().cache_path = jcefPath+"/cache"; // Set cache path for CEF
builder.getCefSettings().cache_path = (jcefPath+"/cache").replace("\\\\","\\").replace("//","/"); // Set cache path for CEF
builder.getCefSettings().log_severity = CefSettings.LogSeverity.LOGSEVERITY_DISABLE; // Disable logging
builder.getCefSettings().persist_session_cookies = true; // Persist session cookies
builder.setInstallDir(installDir); // Set installation directory for jCEF
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import com.zyneonstudios.application.frame.web.ApplicationFrame;
import com.zyneonstudios.application.frame.web.CustomApplicationFrame;
import com.zyneonstudios.application.modules.ModuleLoader;
import com.zyneonstudios.application.modules.test.TestModule;
import com.zyneonstudios.application.modules.localcommands.LocalCommandsModule;
import live.nerotv.shademebaby.logger.Logger;
import live.nerotv.shademebaby.utils.FileUtil;

Expand Down Expand Up @@ -47,9 +47,7 @@ public NexusApplication() {
frame.pack();
}
frame.setLocationRelativeTo(null);
if(ApplicationConfig.test) {
moduleLoader.loadModule(new TestModule(this));
}
moduleLoader.loadModule(new LocalCommandsModule(this));

File modules = new File(getApplicationPath()+"modules/");
if(modules.exists()) {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
package com.zyneonstudios.application.modules.localcommands;

import com.zyneonstudios.application.frame.web.ApplicationFrame;
import com.zyneonstudios.application.main.ApplicationConfig;
import com.zyneonstudios.application.modules.ModuleConnector;

public class LocalCommandsConnector extends ModuleConnector {

private final LocalCommandsModule module;
private final ApplicationFrame frame;

public LocalCommandsConnector(LocalCommandsModule module) {
super(module);
this.module = module;
this.frame = (ApplicationFrame)module.getApplication().getFrame();
}

@Override
public void resolveFrameRequest(String request) {
if(request.equals("init.library")) {
frame.executeJavaScript("addModuleToList(\""+module.getName()+"\",\""+module.getId()+"\",\""+"\")");
} else if(request.equals("sync.library.module.nexus-local-commands")) {
frame.executeJavaScript("document.getElementById(\"select-game-module\").value = \""+module.getId()+"\"; addAction(\"Add command\",\"bx bx-plus\",\"connector('lc.library.action.add.command');\",'lc-action-add-command'); addAction(\"Refresh commands\",\"bx bx-refresh\",\"connector('lc.library.action.refresh.commands');\",'lc-action-refresh-commands'); addGroup(\"Commands\",\"lc-group-commands\");");
} else if(request.equals("lc.library.action.add.command")) {
frame.executeJavaScript("enableOverlay(\""+ApplicationConfig.urlBase+ApplicationConfig.language+"/lc-create-command.html\");");
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
package com.zyneonstudios.application.modules.localcommands;

import com.zyneonstudios.application.main.NexusApplication;
import com.zyneonstudios.application.modules.ApplicationModule;
import com.zyneonstudios.application.modules.ModuleConnector;

public class LocalCommandsModule extends ApplicationModule {

private final LocalCommandsConnector connector;

public LocalCommandsModule(NexusApplication application) {
super(application, "nexus-local-commands", "Local Commands", "2024.6", "nerotvlive");
connector = new LocalCommandsConnector(this);
}

@Override
public ModuleConnector getConnector() {
return connector;
}

@Override
public void onLoad() {
super.onLoad();
}

@Override
public void onEnable() {
super.onEnable();
}

@Override
public void onDisable() {
super.onDisable();
}
}

This file was deleted.

This file was deleted.

Binary file modified application-main/src/main/resources/content.zip
Binary file not shown.
Binary file modified application-main/src/main/resources/modules.zip
Binary file not shown.
4 changes: 2 additions & 2 deletions application-ui/content/assets/application/css/app-shared.css
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ li:hover {
margin-bottom: 1rem;
}

.menu-panel {
display: none !important;
#menu-panel {
display: none;
}

.cnt {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
body {
background: var(--background);
}
Original file line number Diff line number Diff line change
Expand Up @@ -107,4 +107,40 @@ function handleColorSchemeChange(e) {
}
}

colorSchemeQuery.addListener(handleColorSchemeChange);
colorSchemeQuery.addListener(handleColorSchemeChange);

function setMenuPanel(img,title,description,show) {
hideMenuPanel();
const image = document.getElementById("panel-image");
image.src = "";
if(img) {
image.src = img;
}

const pTitle = document.getElementById("panel-title");
pTitle.innerHTML = "";
if(title) {
pTitle.innerHTML = title;
}

const pDescription = document.getElementById("panel-description");
pDescription.innerHTML = "";
if(description) {
pDescription.innerHTML = description;
}

if(show) {
if(show===true) {
showMenuPanel();
}
}
}

function showMenuPanel() {
document.getElementById("menu-panel").style.display = "inherit";

}

function hideMenuPanel() {
document.getElementById("menu-panel").style.display = "none";
}
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ function connector(request) {
console.log("[CONNECTOR] " + request);
}

function setColors(newColors) {
function setColors(newColors,fromApp) {
colors=newColors;
localStorage.setItem('theme.colors', newColors);
if(newColors==="automatic") {
Expand Down
8 changes: 4 additions & 4 deletions application-ui/content/de/custom.html
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,11 @@
<p></p>
</li>
</ul>
<div class="menu-panel">
<img alt="Users ingame skin" class="hover-wiggle pointer" onclick="toggleMainMenu();" src="https://cravatar.eu/helmhead/MHF_Question/128.png">
<div class="menu-panel" id="menu-panel">
<img alt="menu panel image" id="panel-image" class="hover-wiggle pointer" onclick="toggleMainMenu();" src="">
<p>
<span class="bold"></span>
<br>
<span class="bold" id="panel-title"></span>
<br><span id="panel-description"></span>
</p>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions application-ui/content/de/discover.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<script src="../assets/cronos/javascript/app-menu.js"></script>
<script src="../assets/application/javascript/app-shared.js"></script>
<script src="../assets/application/javascript/app-discover.js"></script>
<script>searchTerm = "Klicke zum Suchen"; console.log("[CONNECTOR] init.discover"); init();</script>
<script>console.log("[CONNECTOR] init.discover"); init();</script>
</head>
<body>
<div class="flex full">
Expand Down Expand Up @@ -51,11 +51,11 @@
<p></p>
</li>
</ul>
<div class="menu-panel">
<img alt="Users ingame skin" class="hover-wiggle pointer" onclick="toggleMainMenu();" src="https://cravatar.eu/helmhead/MHF_Question/128.png">
<div class="menu-panel" id="menu-panel">
<img alt="menu panel image" id="panel-image" class="hover-wiggle pointer" onclick="toggleMainMenu();" src="">
<p>
<span class="bold"></span>
<br>
<span class="bold" id="panel-title"></span>
<br><span id="panel-description"></span>
</p>
</div>
</div>
Expand Down
21 changes: 21 additions & 0 deletions application-ui/content/de/lc-create-command.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="de">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Lokales Kommando erstellen</title>
<link rel="stylesheet" href="../assets/cronos/css/app-base.css">
<link rel="stylesheet" id="css-colors" href="../assets/cronos/css/app-colors-dark.css">
<link rel="stylesheet" id="css-card" href="../assets/cronos/css/app-cards.css">
<link rel="stylesheet" id="css-shared" href="../assets/application/css/app-shared.css">
<link rel="stylesheet" id="css-page" href="../assets/application/css/lc-create-command.css">
<link href='https://unpkg.com/[email protected]/css/boxicons.min.css' rel='stylesheet'>
<script src="../assets/cronos/javascript/app-base.js"></script>
<script src="../assets/application/javascript/app-shared.js"></script>
<script src="../assets/application/javascript/lc-create-command.js"></script>
<style>body {overflow: hidden !important;}</style>
</head>
<body>

</body>
</html>
Loading

0 comments on commit 1c17dd0

Please sign in to comment.