Solve #227 Update current URL to match with current example

This commit is contained in:
Insality 2023-05-02 21:30:11 +03:00
parent c815b6b240
commit 807168d850
3 changed files with 203 additions and 87 deletions

View File

@ -22,6 +22,24 @@ local function save_cache(self)
end end
-- Change current browser URL to share the examples
---@param self userdata
---@param scene_name string
local function set_scene_url(self, scene_name)
if not html5 then
return
end
local command
if scene_name then
command = string.format('window.history.replaceState(null, null, "?example=%s")', scene_name)
else
command = 'window.history.replaceState(null, null, "index.html")'
end
html5.run(command)
end
local function back_to_lobby(self) local function back_to_lobby(self)
if gui.set_enabled(self.button_menu.node) then if gui.set_enabled(self.button_menu.node) then
return return
@ -37,6 +55,7 @@ local function back_to_lobby(self)
self.cache.last_scene = nil self.cache.last_scene = nil
save_cache(self) save_cache(self)
set_scene_url(self, nil)
end end
@ -54,6 +73,7 @@ local function show_scene(self, scene_name, text_header)
self.cache.last_scene = scene_name self.cache.last_scene = scene_name
save_cache(self) save_cache(self)
set_scene_url(self, scene_name)
end end

View File

@ -67,6 +67,8 @@ nodes {
template_node_child: false template_node_child: false
size_mode: SIZE_MODE_MANUAL size_mode: SIZE_MODE_MANUAL
custom_type: 0 custom_type: 0
enabled: true
visible: true
} }
nodes { nodes {
position { position {
@ -123,6 +125,8 @@ nodes {
template_node_child: false template_node_child: false
size_mode: SIZE_MODE_AUTO size_mode: SIZE_MODE_AUTO
custom_type: 0 custom_type: 0
enabled: true
visible: true
} }
nodes { nodes {
position { position {
@ -144,8 +148,8 @@ nodes {
w: 1.0 w: 1.0
} }
size { size {
x: 140.0 x: 200.0
y: 172.0 y: 100.0
z: 0.0 z: 0.0
w: 1.0 w: 1.0
} }
@ -179,6 +183,74 @@ nodes {
template_node_child: false template_node_child: false
size_mode: SIZE_MODE_AUTO size_mode: SIZE_MODE_AUTO
custom_type: 0 custom_type: 0
enabled: true
visible: true
}
nodes {
position {
x: -185.0
y: 0.0
z: 0.0
w: 1.0
}
rotation {
x: 0.0
y: 0.0
z: 0.0
w: 1.0
}
scale {
x: 0.75
y: 0.75
z: 1.0
w: 1.0
}
size {
x: 300.0
y: 100.0
z: 0.0
w: 1.0
}
color {
x: 1.0
y: 1.0
z: 1.0
w: 1.0
}
type: TYPE_TEXT
blend_mode: BLEND_MODE_ALPHA
text: "Original image:"
font: "game"
id: "text_hint_"
xanchor: XANCHOR_NONE
yanchor: YANCHOR_NONE
pivot: PIVOT_CENTER
outline {
x: 0.0
y: 0.0
z: 0.0
w: 1.0
}
shadow {
x: 1.0
y: 1.0
z: 1.0
w: 1.0
}
adjust_mode: ADJUST_MODE_FIT
line_break: false
parent: "image"
layer: ""
inherit_alpha: true
alpha: 1.0
outline_alpha: 0.75
shadow_alpha: 0.0
template_node_child: false
text_leading: 1.0
text_tracking: 0.0
custom_type: 0
enabled: true
visible: true
} }
nodes { nodes {
position { position {
@ -235,6 +307,8 @@ nodes {
template_node_child: false template_node_child: false
size_mode: SIZE_MODE_MANUAL size_mode: SIZE_MODE_MANUAL
custom_type: 0 custom_type: 0
enabled: true
visible: true
} }
nodes { nodes {
position { position {
@ -256,8 +330,8 @@ nodes {
w: 1.0 w: 1.0
} }
size { size {
x: 140.0 x: 200.0
y: 172.0 y: 100.0
z: 0.0 z: 0.0
w: 1.0 w: 1.0
} }
@ -291,6 +365,8 @@ nodes {
template_node_child: false template_node_child: false
size_mode: SIZE_MODE_AUTO size_mode: SIZE_MODE_AUTO
custom_type: 0 custom_type: 0
enabled: true
visible: true
} }
nodes { nodes {
position { position {
@ -355,6 +431,8 @@ nodes {
text_leading: 1.0 text_leading: 1.0
text_tracking: 0.0 text_tracking: 0.0
custom_type: 0 custom_type: 0
enabled: true
visible: true
} }
nodes { nodes {
position { position {
@ -411,6 +489,8 @@ nodes {
template_node_child: false template_node_child: false
size_mode: SIZE_MODE_MANUAL size_mode: SIZE_MODE_MANUAL
custom_type: 0 custom_type: 0
enabled: true
visible: true
} }
nodes { nodes {
position { position {
@ -432,8 +512,8 @@ nodes {
w: 1.0 w: 1.0
} }
size { size {
x: 140.0 x: 200.0
y: 172.0 y: 100.0
z: 0.0 z: 0.0
w: 1.0 w: 1.0
} }
@ -467,6 +547,8 @@ nodes {
template_node_child: false template_node_child: false
size_mode: SIZE_MODE_AUTO size_mode: SIZE_MODE_AUTO
custom_type: 0 custom_type: 0
enabled: true
visible: true
} }
nodes { nodes {
position { position {
@ -531,6 +613,8 @@ nodes {
text_leading: 1.0 text_leading: 1.0
text_tracking: 0.0 text_tracking: 0.0
custom_type: 0 custom_type: 0
enabled: true
visible: true
} }
nodes { nodes {
position { position {
@ -587,6 +671,8 @@ nodes {
template_node_child: false template_node_child: false
size_mode: SIZE_MODE_MANUAL size_mode: SIZE_MODE_MANUAL
custom_type: 0 custom_type: 0
enabled: true
visible: true
} }
nodes { nodes {
position { position {
@ -608,8 +694,8 @@ nodes {
w: 1.0 w: 1.0
} }
size { size {
x: 140.0 x: 200.0
y: 172.0 y: 100.0
z: 0.0 z: 0.0
w: 1.0 w: 1.0
} }
@ -643,6 +729,8 @@ nodes {
template_node_child: false template_node_child: false
size_mode: SIZE_MODE_AUTO size_mode: SIZE_MODE_AUTO
custom_type: 0 custom_type: 0
enabled: true
visible: true
} }
nodes { nodes {
position { position {
@ -707,6 +795,8 @@ nodes {
text_leading: 1.0 text_leading: 1.0
text_tracking: 0.0 text_tracking: 0.0
custom_type: 0 custom_type: 0
enabled: true
visible: true
} }
nodes { nodes {
position { position {
@ -763,6 +853,8 @@ nodes {
template_node_child: false template_node_child: false
size_mode: SIZE_MODE_MANUAL size_mode: SIZE_MODE_MANUAL
custom_type: 0 custom_type: 0
enabled: true
visible: true
} }
nodes { nodes {
position { position {
@ -784,8 +876,8 @@ nodes {
w: 1.0 w: 1.0
} }
size { size {
x: 140.0 x: 200.0
y: 172.0 y: 100.0
z: 0.0 z: 0.0
w: 1.0 w: 1.0
} }
@ -819,6 +911,8 @@ nodes {
template_node_child: false template_node_child: false
size_mode: SIZE_MODE_AUTO size_mode: SIZE_MODE_AUTO
custom_type: 0 custom_type: 0
enabled: true
visible: true
} }
nodes { nodes {
position { position {
@ -883,6 +977,8 @@ nodes {
text_leading: 1.0 text_leading: 1.0
text_tracking: 0.0 text_tracking: 0.0
custom_type: 0 custom_type: 0
enabled: true
visible: true
} }
nodes { nodes {
position { position {
@ -939,6 +1035,8 @@ nodes {
template_node_child: false template_node_child: false
size_mode: SIZE_MODE_MANUAL size_mode: SIZE_MODE_MANUAL
custom_type: 0 custom_type: 0
enabled: true
visible: true
} }
nodes { nodes {
position { position {
@ -960,8 +1058,8 @@ nodes {
w: 1.0 w: 1.0
} }
size { size {
x: 140.0 x: 200.0
y: 172.0 y: 100.0
z: 0.0 z: 0.0
w: 1.0 w: 1.0
} }
@ -995,6 +1093,8 @@ nodes {
template_node_child: false template_node_child: false
size_mode: SIZE_MODE_AUTO size_mode: SIZE_MODE_AUTO
custom_type: 0 custom_type: 0
enabled: true
visible: true
} }
nodes { nodes {
position { position {
@ -1059,6 +1159,8 @@ nodes {
text_leading: 1.0 text_leading: 1.0
text_tracking: 0.0 text_tracking: 0.0
custom_type: 0 custom_type: 0
enabled: true
visible: true
} }
nodes { nodes {
position { position {
@ -1115,6 +1217,8 @@ nodes {
template_node_child: false template_node_child: false
size_mode: SIZE_MODE_MANUAL size_mode: SIZE_MODE_MANUAL
custom_type: 0 custom_type: 0
enabled: true
visible: true
} }
nodes { nodes {
position { position {
@ -1136,8 +1240,8 @@ nodes {
w: 1.0 w: 1.0
} }
size { size {
x: 140.0 x: 200.0
y: 172.0 y: 100.0
z: 0.0 z: 0.0
w: 1.0 w: 1.0
} }
@ -1171,6 +1275,8 @@ nodes {
template_node_child: false template_node_child: false
size_mode: SIZE_MODE_AUTO size_mode: SIZE_MODE_AUTO
custom_type: 0 custom_type: 0
enabled: true
visible: true
} }
nodes { nodes {
position { position {
@ -1235,6 +1341,8 @@ nodes {
text_leading: 1.0 text_leading: 1.0
text_tracking: 0.0 text_tracking: 0.0
custom_type: 0 custom_type: 0
enabled: true
visible: true
} }
layers { layers {
name: "image" name: "image"

View File

@ -1,83 +1,71 @@
# App manifest generated Sat Mar 21 2020 23:36:54 GMT+0300 (Moscow Standard Time)
# Settings: Physics2D,Physics3D,Record,Profiler
platforms: platforms:
x86_64-osx:
context:
excludeLibs: ["physics","LinearMath","BulletDynamics","BulletCollision","Box2D","record","vpx"]
libs: ["physics_null","record_null"]
linkFlags: []
x86_64-linux:
context:
excludeLibs: ["physics","LinearMath","BulletDynamics","BulletCollision","Box2D","record","vpx","profilerext"]
excludeSymbols: ["ProfilerExt"]
libs: ["physics_null","record_null","profilerext_null"]
linkFlags: []
js-web:
context:
excludeLibs: ["physics","LinearMath","BulletDynamics","BulletCollision","Box2D","record","vpx","profilerext"]
excludeJsLibs: []
excludeSymbols: ["ProfilerExt"]
libs: ["physics_null","record_null","profilerext_null"]
linkFlags: []
wasm-web:
context:
excludeLibs: ["physics","LinearMath","BulletDynamics","BulletCollision","Box2D","record","vpx","profilerext"]
excludeJsLibs: []
excludeSymbols: ["ProfilerExt"]
libs: ["physics_null","record_null","profilerext_null"]
linkFlags: []
x86-win32:
context:
excludeLibs: ["libphysics","libLinearMath","libBulletDynamics","libBulletCollision","libBox2D","librecord","vpx","libprofilerext"]
excludeSymbols: ["ProfilerExt"]
libs: ["libphysics_null.lib","librecord_null.lib","libprofilerext_null.lib"]
linkFlags: []
x86_64-win32:
context:
excludeLibs: ["libphysics","libLinearMath","libBulletDynamics","libBulletCollision","libBox2D","librecord","vpx","libprofilerext"]
excludeSymbols: ["ProfilerExt"]
libs: ["libphysics_null.lib","librecord_null.lib","libprofilerext_null.lib"]
linkFlags: []
armv7-android:
context:
excludeLibs: ["physics","LinearMath","BulletDynamics","BulletCollision","Box2D","record","vpx","profilerext"]
excludeJars: []
excludeSymbols: ["ProfilerExt"]
libs: ["physics_null","record_null","profilerext_null"]
linkFlags: []
arm64-android:
context:
excludeLibs: ["physics","LinearMath","BulletDynamics","BulletCollision","Box2D","record","vpx","profilerext"]
excludeJars: []
excludeSymbols: ["ProfilerExt"]
libs: ["physics_null","record_null","profilerext_null"]
linkFlags: []
armv7-ios: armv7-ios:
context: context:
excludeLibs: ["physics","LinearMath","BulletDynamics","BulletCollision","Box2D","record","vpx","profilerext"] excludeLibs: [physics, LinearMath, BulletDynamics, BulletCollision, Box2D, record, vpx, profilerext, liveupdate]
excludeSymbols: ["ProfilerExt"] excludeSymbols: [ProfilerExt]
libs: ["physics_null","record_null","profilerext_null"] libs: [physics_null, record_null, profilerext_null, liveupdate_null]
linkFlags: [] linkFlags: []
arm64-ios: arm64-ios:
context: context:
excludeLibs: ["physics","LinearMath","BulletDynamics","BulletCollision","Box2D","record","vpx","profilerext"] excludeLibs: [physics, LinearMath, BulletDynamics, BulletCollision, Box2D, record, vpx, profilerext, liveupdate]
excludeSymbols: ["ProfilerExt"] excludeSymbols: [ProfilerExt]
libs: ["physics_null","record_null","profilerext_null"] libs: [physics_null, record_null, profilerext_null, liveupdate_null]
linkFlags: [] linkFlags: []
x86_64-ios: x86_64-ios:
context: context:
excludeLibs: ["physics","LinearMath","BulletDynamics","BulletCollision","Box2D","record","vpx","profilerext"] excludeLibs: [physics, LinearMath, BulletDynamics, BulletCollision, Box2D, record, vpx, profilerext, liveupdate]
excludeSymbols: ["ProfilerExt"] excludeSymbols: [ProfilerExt]
libs: ["physics_null","record_null","profilerext_null"] libs: [physics_null, record_null, profilerext_null, liveupdate_null]
linkFlags: []
armv7-android:
context:
excludeLibs: [physics, LinearMath, BulletDynamics, BulletCollision, Box2D, record, vpx, profilerext, liveupdate]
excludeJars: []
excludeSymbols: [ProfilerExt]
libs: [physics_null, record_null, profilerext_null, liveupdate_null]
linkFlags: []
arm64-android:
context:
excludeLibs: [physics, LinearMath, BulletDynamics, BulletCollision, Box2D, record, vpx, profilerext, liveupdate]
excludeJars: []
excludeSymbols: [ProfilerExt]
libs: [physics_null, record_null, profilerext_null, liveupdate_null]
linkFlags: []
x86_64-osx:
context:
excludeLibs: [physics, LinearMath, BulletDynamics, BulletCollision, Box2D, record, vpx, profilerext, liveupdate]
excludeSymbols: [ProfilerExt]
libs: [physics_null, record_null, profilerext_null, liveupdate_null]
linkFlags: []
x86_64-linux:
context:
excludeLibs: [physics, LinearMath, BulletDynamics, BulletCollision, Box2D, record, vpx, profilerext, liveupdate]
excludeSymbols: [ProfilerExt]
libs: [physics_null, record_null, profilerext_null, liveupdate_null]
linkFlags: []
x86-win32:
context:
excludeLibs: [libphysics, libLinearMath, libBulletDynamics, libBulletCollision, libBox2D, librecord, vpx, libprofilerext, libliveupdate]
excludeSymbols: [ProfilerExt]
libs: [libphysics_null.lib, librecord_null.lib, libprofilerext_null.lib, libliveupdate_null.lib]
linkFlags: []
x86_64-win32:
context:
excludeLibs: [libphysics, libLinearMath, libBulletDynamics, libBulletCollision, libBox2D, librecord, vpx, libprofilerext, libliveupdate]
excludeSymbols: [ProfilerExt]
libs: [libphysics_null.lib, librecord_null.lib, libprofilerext_null.lib, libliveupdate_null.lib]
linkFlags: []
js-web:
context:
excludeLibs: [physics, LinearMath, BulletDynamics, BulletCollision, Box2D, record, vpx, profilerext, liveupdate]
excludeJsLibs: []
excludeSymbols: [ProfilerExt]
libs: [physics_null, record_null, profilerext_null, liveupdate_null]
linkFlags: []
wasm-web:
context:
excludeLibs: [physics, LinearMath, BulletDynamics, BulletCollision, Box2D, record, vpx, profilerext, liveupdate]
excludeJsLibs: []
excludeSymbols: [ProfilerExt]
libs: [physics_null, record_null, profilerext_null, liveupdate_null]
linkFlags: [] linkFlags: []