mirror of
https://github.com/Insality/druid.git
synced 2025-11-26 10:50:52 +01:00
Update with latest libs
This commit is contained in:
@@ -191,6 +191,7 @@ You can find the full **Druid** functions at [Quick API Reference](api/quick_api
|
|||||||
To better understand **Druid**, read the following documentation:
|
To better understand **Druid**, read the following documentation:
|
||||||
|
|
||||||
- [How To GUI in Defold](https://forum.defold.com/t/how-to-gui-in-defold/73256)
|
- [How To GUI in Defold](https://forum.defold.com/t/how-to-gui-in-defold/73256)
|
||||||
|
- [Druid Workshop](https://youtu.be/qF19qpjZe9c)
|
||||||
- [Widgets](wiki/widgets.md)
|
- [Widgets](wiki/widgets.md)
|
||||||
- [Druid styles](wiki/styles.md)
|
- [Druid styles](wiki/styles.md)
|
||||||
- [Advanced Setup](wiki/advanced-setup.md)
|
- [Advanced Setup](wiki/advanced-setup.md)
|
||||||
|
|||||||
@@ -48,8 +48,18 @@ end
|
|||||||
--- Generic setup that should be done once per application
|
--- Generic setup that should be done once per application
|
||||||
---@param self druid.example
|
---@param self druid.example
|
||||||
local function setup_druid(self)
|
local function setup_druid(self)
|
||||||
lang.init()
|
lang.init({
|
||||||
lang.set_lang("en") -- Force default start language to EN, switch through the UI to check
|
{ id = "en", path = "/example/locales/en.json" },
|
||||||
|
{ id = "ru", path = "/example/locales/ru.json" },
|
||||||
|
{ id = "es", path = "/example/locales/es.json" },
|
||||||
|
{ id = "de", path = "/example/locales/de.json" },
|
||||||
|
{ id = "fr", path = "/example/locales/fr.json" },
|
||||||
|
{ id = "ja", path = "/example/locales/ja.json" },
|
||||||
|
{ id = "pt", path = "/example/locales/pt.json" },
|
||||||
|
{ id = "it", path = "/example/locales/it.json" },
|
||||||
|
{ id = "kr", path = "/example/locales/kr.json" },
|
||||||
|
{ id = "zh", path = "/example/locales/zh.json" },
|
||||||
|
}, "en")
|
||||||
druid.set_text_function(lang.txp)
|
druid.set_text_function(lang.txp)
|
||||||
|
|
||||||
window.set_listener(function(_, event)
|
window.set_listener(function(_, event)
|
||||||
|
|||||||
@@ -1,24 +1,9 @@
|
|||||||
local lang = require("lang.lang")
|
|
||||||
local druid = require("druid.druid")
|
local druid = require("druid.druid")
|
||||||
|
|
||||||
local window_confirmation = require("example.examples.windows.window_confirmation.window_confirmation")
|
local window_confirmation = require("example.examples.windows.window_confirmation.window_confirmation")
|
||||||
|
|
||||||
|
|
||||||
local function debug_stub(self)
|
|
||||||
if msg.url().socket ~= hash("window_confirmation") then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
lang.init()
|
|
||||||
druid.set_text_function(lang.txp)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
function init(self)
|
function init(self)
|
||||||
debug_stub(self)
|
|
||||||
|
|
||||||
-- Using component instead put all inside gui_script to
|
|
||||||
-- allow use it as example and as separate collection
|
|
||||||
self.druid = druid.new(self)
|
self.druid = druid.new(self)
|
||||||
self.druid:new(window_confirmation)
|
self.druid:new(window_confirmation)
|
||||||
end
|
end
|
||||||
@@ -41,4 +26,4 @@ end
|
|||||||
|
|
||||||
function on_input(self, action_id, action)
|
function on_input(self, action_id, action)
|
||||||
return self.druid:on_input(action_id, action)
|
return self.druid:on_input(action_id, action)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -4,21 +4,7 @@ local druid = require("druid.druid")
|
|||||||
local window_info = require("example.examples.windows.window_info.window_info")
|
local window_info = require("example.examples.windows.window_info.window_info")
|
||||||
|
|
||||||
|
|
||||||
local function debug_stub(self)
|
|
||||||
if msg.url().socket ~= hash("window_info") then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
lang.init()
|
|
||||||
druid.set_text_function(lang.txp)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
function init(self)
|
function init(self)
|
||||||
debug_stub(self)
|
|
||||||
|
|
||||||
-- Using component instead put all inside gui_script to
|
|
||||||
-- allow use it as example and as separate collection
|
|
||||||
self.druid = druid.new(self)
|
self.druid = druid.new(self)
|
||||||
self.druid:new(window_info)
|
self.druid:new(window_info)
|
||||||
end
|
end
|
||||||
@@ -41,4 +27,4 @@ end
|
|||||||
|
|
||||||
function on_input(self, action_id, action)
|
function on_input(self, action_id, action)
|
||||||
return self.druid:on_input(action_id, action)
|
return self.druid:on_input(action_id, action)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,24 +1,8 @@
|
|||||||
local lang = require("lang.lang")
|
|
||||||
local druid = require("druid.druid")
|
local druid = require("druid.druid")
|
||||||
|
|
||||||
local window_language = require("example.examples.windows.window_language.window_language")
|
local window_language = require("example.examples.windows.window_language.window_language")
|
||||||
|
|
||||||
|
|
||||||
local function debug_stub(self)
|
|
||||||
if msg.url().socket ~= hash("window_language") then
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
lang.init()
|
|
||||||
druid.set_text_function(lang.txp)
|
|
||||||
end
|
|
||||||
|
|
||||||
|
|
||||||
function init(self)
|
function init(self)
|
||||||
debug_stub(self)
|
|
||||||
|
|
||||||
-- Using component instead put all inside gui_script to
|
|
||||||
-- allow use it as example and as separate collection
|
|
||||||
self.druid = druid.new(self)
|
self.druid = druid.new(self)
|
||||||
self.druid:new(window_language)
|
self.druid:new(window_language)
|
||||||
end
|
end
|
||||||
@@ -41,4 +25,4 @@ end
|
|||||||
|
|
||||||
function on_input(self, action_id, action)
|
function on_input(self, action_id, action)
|
||||||
return self.druid:on_input(action_id, action)
|
return self.druid:on_input(action_id, action)
|
||||||
end
|
end
|
||||||
|
|||||||
13
game.project
13
game.project
@@ -20,9 +20,9 @@ developer = Maksim Tuprikov
|
|||||||
custom_resources = /example/locales
|
custom_resources = /example/locales
|
||||||
dependencies#0 = https://github.com/britzl/deftest/archive/refs/tags/2.8.0.zip
|
dependencies#0 = https://github.com/britzl/deftest/archive/refs/tags/2.8.0.zip
|
||||||
dependencies#1 = https://github.com/Insality/defold-saver/archive/refs/tags/5.zip
|
dependencies#1 = https://github.com/Insality/defold-saver/archive/refs/tags/5.zip
|
||||||
dependencies#2 = https://github.com/Insality/defold-tweener/archive/refs/tags/3.zip
|
dependencies#2 = https://github.com/Insality/defold-tweener/archive/refs/tags/6.zip
|
||||||
dependencies#3 = https://github.com/Insality/panthera/archive/refs/tags/runtime.4.zip
|
dependencies#3 = https://github.com/Insality/panthera/archive/refs/tags/runtime.5.zip
|
||||||
dependencies#4 = https://github.com/Insality/defold-lang/archive/refs/tags/3.zip
|
dependencies#4 = https://github.com/Insality/defold-lang/archive/refs/tags/4.zip
|
||||||
dependencies#5 = https://github.com/Insality/defold-event/archive/refs/tags/13.zip
|
dependencies#5 = https://github.com/Insality/defold-event/archive/refs/tags/13.zip
|
||||||
dependencies#6 = https://github.com/subsoap/defos/archive/refs/tags/v2.8.0.zip
|
dependencies#6 = https://github.com/subsoap/defos/archive/refs/tags/v2.8.0.zip
|
||||||
dependencies#7 = https://github.com/Insality/asset-store/archive/refs/tags/1.zip
|
dependencies#7 = https://github.com/Insality/asset-store/archive/refs/tags/1.zip
|
||||||
@@ -59,7 +59,7 @@ cssfile = /builtins/manifests/web/dark_theme.css
|
|||||||
show_console_banner = 0
|
show_console_banner = 0
|
||||||
|
|
||||||
[native_extension]
|
[native_extension]
|
||||||
app_manifest =
|
app_manifest =
|
||||||
|
|
||||||
[graphics]
|
[graphics]
|
||||||
texture_profiles = /builtins/graphics/default.texture_profiles
|
texture_profiles = /builtins/graphics/default.texture_profiles
|
||||||
@@ -103,11 +103,6 @@ max_instances = 128
|
|||||||
[saver]
|
[saver]
|
||||||
autosave_timer = 2
|
autosave_timer = 2
|
||||||
|
|
||||||
[lang]
|
|
||||||
path = /example/locales
|
|
||||||
langs = en,ru,es,de,fr,ja,pt,it,kr,zh
|
|
||||||
default = es
|
|
||||||
|
|
||||||
[event]
|
[event]
|
||||||
use_xpcall = 1
|
use_xpcall = 1
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user