Skip to content

Commit

Permalink
Limit scope of WebGL player #391
Browse files Browse the repository at this point in the history
  • Loading branch information
vanjac committed Jul 21, 2024
1 parent 6081663 commit 71176d3
Show file tree
Hide file tree
Showing 7 changed files with 155 additions and 2 deletions.
2 changes: 2 additions & 0 deletions Assets/Game/PauseGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,10 @@ private void PauseGame() {
() => {}), // menu will close
new OverflowMenuGUI.MenuItem(StringSet.RestartGame, IconSet.restart,
() => { gameLoad.Close(Scenes.GAME); }),
#if !UNITY_WEBGL
new OverflowMenuGUI.MenuItem(StringSet.OpenEditor, IconSet.editor,
() => { gameLoad.Close(Scenes.EDITOR); }),
#endif
new OverflowMenuGUI.MenuItem(StringSet.CloseGame, IconSet.x,
() => { gameLoad.Close(Scenes.MENU); }),
};
Expand Down
5 changes: 4 additions & 1 deletion Assets/Menu/MenuGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,19 +94,22 @@ public override void WindowGUI() {
#endif
}

#if UNITY_WEBGL
private void PlayerMenuGUI() {
GUILayout.FlexibleSpace();
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();

if (GUILayout.Button("Select File", StyleSet.buttonLarge)) {
if (GUILayout.Button(GUIUtils.MenuContent("Select File...", IconSet.openFile),
StyleSet.buttonLarge)) {
OpenFilePicker();
}

GUILayout.FlexibleSpace();
GUILayout.EndHorizontal();
GUILayout.FlexibleSpace();
}
#endif

public static void OpenWorld(string path, string scene) {
SelectedWorld.SelectSavedWorld(path);
Expand Down
2 changes: 2 additions & 0 deletions Assets/Menu/MenuOverflowGUI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ public override void OnEnable() {
}

public override void WindowGUI() {
#if !UNITY_WEBGL || UNITY_EDITOR
GUILayout.BeginHorizontal();
GUILayout.FlexibleSpace();
if (ActionBarGUI.ActionBarButton(IconSet.overflow)) {
Expand Down Expand Up @@ -75,5 +76,6 @@ public override void WindowGUI() {
};
}
GUILayout.EndHorizontal();
#endif // !UNITY_WEBGL
}
}
2 changes: 1 addition & 1 deletion Assets/VoxelEditor/GUI/GUIIconSet.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class GUIIconSet : ScriptableObject {
public Texture reddit, youTube, undo, import, fill, draw, singleObject, objectType, behavior, newTexture;
public Texture worldImport, newItem, website, donate, pan, orbit, sensor, random, baseLayer, overlayLayer;
public Texture plusOne, minusOne, color, camera, language, outgoing, incoming, model;
public Texture alignBottom, alignCenter, alignTop, origin, greaterEqual, lessEqual;
public Texture alignBottom, alignCenter, alignTop, origin, greaterEqual, lessEqual, openFile;
public Texture indoorLarge, floatingLarge, newWorldLarge, helpLarge, compassLarge;

public Texture[] tagIcons;
Expand Down
Binary file added Assets/VoxelEditor/GUI/icons/folder-open.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
145 changes: 145 additions & 0 deletions Assets/VoxelEditor/GUI/icons/folder-open.png.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Assets/VoxelEditor/GUI/icons/icons.asset
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ MonoBehaviour:
origin: {fileID: 2800000, guid: abdf191ebcb245c40b9024588d0f0337, type: 3}
greaterEqual: {fileID: 2800000, guid: 16dbc9c115a204d4b81a29cac3cc7a16, type: 3}
lessEqual: {fileID: 2800000, guid: fb61d898f031b074db1e56aaec39887f, type: 3}
openFile: {fileID: 2800000, guid: 76dd61762dcedfc4caf0a40b6b1da111, type: 3}
indoorLarge: {fileID: 2800000, guid: 8429c955cd8746144b2d97cae562dce3, type: 3}
floatingLarge: {fileID: 2800000, guid: 97faa5cce5f220b4caf45ea271a96c03, type: 3}
newWorldLarge: {fileID: 2800000, guid: a6b7305e08a770c42aa700fbd66af21a, type: 3}
Expand Down

0 comments on commit 71176d3

Please sign in to comment.