mirror of
https://github.com/Insality/druid
synced 2025-11-26 10:50:54 +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:
|
||||
|
||||
- [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)
|
||||
- [Druid styles](wiki/styles.md)
|
||||
- [Advanced Setup](wiki/advanced-setup.md)
|
||||
|
||||
@@ -48,8 +48,18 @@ end
|
||||
--- Generic setup that should be done once per application
|
||||
---@param self druid.example
|
||||
local function setup_druid(self)
|
||||
lang.init()
|
||||
lang.set_lang("en") -- Force default start language to EN, switch through the UI to check
|
||||
lang.init({
|
||||
{ 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)
|
||||
|
||||
window.set_listener(function(_, event)
|
||||
|
||||
@@ -1,24 +1,9 @@
|
||||
local lang = require("lang.lang")
|
||||
local druid = require("druid.druid")
|
||||
|
||||
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)
|
||||
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:new(window_confirmation)
|
||||
end
|
||||
|
||||
@@ -4,21 +4,7 @@ local druid = require("druid.druid")
|
||||
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)
|
||||
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:new(window_info)
|
||||
end
|
||||
|
||||
@@ -1,24 +1,8 @@
|
||||
local lang = require("lang.lang")
|
||||
local druid = require("druid.druid")
|
||||
|
||||
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)
|
||||
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:new(window_language)
|
||||
end
|
||||
|
||||
11
game.project
11
game.project
@@ -20,9 +20,9 @@ developer = Maksim Tuprikov
|
||||
custom_resources = /example/locales
|
||||
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#2 = https://github.com/Insality/defold-tweener/archive/refs/tags/3.zip
|
||||
dependencies#3 = https://github.com/Insality/panthera/archive/refs/tags/runtime.4.zip
|
||||
dependencies#4 = https://github.com/Insality/defold-lang/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.5.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#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
|
||||
@@ -103,11 +103,6 @@ max_instances = 128
|
||||
[saver]
|
||||
autosave_timer = 2
|
||||
|
||||
[lang]
|
||||
path = /example/locales
|
||||
langs = en,ru,es,de,fr,ja,pt,it,kr,zh
|
||||
default = es
|
||||
|
||||
[event]
|
||||
use_xpcall = 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user