mirror of
https://github.com/Insality/druid
synced 2025-09-27 18:12:21 +02:00
Update examples
This commit is contained in:
@@ -1,23 +1,20 @@
|
||||
local component = require("druid.component")
|
||||
local panthera = require("panthera.panthera")
|
||||
|
||||
local window_animation_panthera = require("example.examples.windows.window_animation_panthera")
|
||||
|
||||
---@class examples.window_confirmation: druid.component
|
||||
---@field druid druid.instance
|
||||
---@class examples.window_confirmation: druid.widget
|
||||
---@field text_header druid.lang_text
|
||||
---@field text_button_accept druid.lang_text
|
||||
---@field text_button_decline druid.lang_text
|
||||
---@field text_description druid.lang_text
|
||||
---@field button_close druid.button
|
||||
local M = component.create("window_confirmation")
|
||||
---@field button_accept druid.button
|
||||
---@field button_decline druid.button
|
||||
---@field animation panthera.instance
|
||||
local M = {}
|
||||
|
||||
|
||||
---@param template string
|
||||
---@param nodes table<hash, node>
|
||||
function M:init(template, nodes)
|
||||
self.druid = self:get_druid(template, nodes)
|
||||
|
||||
function M:init()
|
||||
self.text_header = self.druid:new_lang_text("text_header", "ui_confirmation") --[[@as druid.lang_text]]
|
||||
self.text_button_accept = self.druid:new_lang_text("button_accept/text", "ui_accept") --[[@as druid.lang_text]]
|
||||
self.text_button_decline = self.druid:new_lang_text("button_decline/text", "ui_decline") --[[@as druid.lang_text]]
|
||||
@@ -27,7 +24,7 @@ function M:init(template, nodes)
|
||||
self.button_accept = self.druid:new_button("button_accept/root")
|
||||
self.button_decline = self.druid:new_button("button_decline/root")
|
||||
|
||||
self.animation = panthera.create_gui(window_animation_panthera, self:get_template(), nodes)
|
||||
self.animation = panthera.create_gui(window_animation_panthera, self:get_template(), self:get_nodes())
|
||||
panthera.play(self.animation, "open")
|
||||
end
|
||||
|
||||
|
@@ -1,22 +1,18 @@
|
||||
local component = require("druid.component")
|
||||
local panthera = require("panthera.panthera")
|
||||
|
||||
local window_animation_panthera = require("example.examples.windows.window_animation_panthera")
|
||||
|
||||
---@class examples.window_info: druid.component
|
||||
---@class examples.window_info: druid.widget
|
||||
---@field text_header druid.lang_text
|
||||
---@field text_button_accept druid.lang_text
|
||||
---@field text_description druid.lang_text
|
||||
---@field button_close druid.button
|
||||
---@field druid druid.instance
|
||||
local M = component.create("window_info")
|
||||
---@field button_accept druid.button
|
||||
---@field animation panthera.instance
|
||||
local M = {}
|
||||
|
||||
|
||||
---@param template string
|
||||
---@param nodes table<hash, node>
|
||||
function M:init(template, nodes)
|
||||
self.druid = self:get_druid(template, nodes)
|
||||
|
||||
function M:init()
|
||||
self.text_header = self.druid:new_lang_text("text_header", "ui_information") --[[@as druid.lang_text]]
|
||||
self.text_button_accept = self.druid:new_lang_text("button_accept/text", "ui_accept") --[[@as druid.lang_text]]
|
||||
self.text_description = self.druid:new_lang_text("text") --[[@as druid.lang_text]]
|
||||
@@ -24,7 +20,7 @@ function M:init(template, nodes)
|
||||
self.button_close = self.druid:new_button("button_close", self.on_button_close)
|
||||
self.button_accept = self.druid:new_button("button_accept/root")
|
||||
|
||||
self.animation = panthera.create_gui(window_animation_panthera, self:get_template(), nodes)
|
||||
self.animation = panthera.create_gui(window_animation_panthera, self:get_template(), self:get_nodes())
|
||||
panthera.play(self.animation, "open")
|
||||
end
|
||||
|
||||
|
@@ -1,30 +1,27 @@
|
||||
local lang = require("lang.lang")
|
||||
local druid = require("druid.druid")
|
||||
local event = require("event.event")
|
||||
local component = require("druid.component")
|
||||
local panthera = require("panthera.panthera")
|
||||
|
||||
local window_animation_panthera = require("example.examples.windows.window_animation_panthera")
|
||||
|
||||
---@class examples.window_language: druid.component
|
||||
---@class examples.window_language: druid.widget
|
||||
---@field text_header druid.text
|
||||
---@field button_close druid.button
|
||||
---@field druid druid.instance
|
||||
---@field lang_buttons table<string, druid.button>
|
||||
---@field grid druid.grid
|
||||
---@field on_language_change event
|
||||
local M = component.create("window_language")
|
||||
---@field animation panthera.instance
|
||||
local M = {}
|
||||
|
||||
|
||||
---Color: #F0FBFF
|
||||
local DEFAULT_LANGUAGE_COLOR = vmath.vector4(240/255, 251/255, 255/255, 1.0)
|
||||
---Color: #E6DF9F
|
||||
local SELECTED_LANGUAGE_COLOR = vmath.vector4(230/255, 223/255, 159/255, 1.0)
|
||||
|
||||
---@param template string
|
||||
---@param nodes table<hash, node>
|
||||
function M:init(template, nodes)
|
||||
self.druid = self:get_druid(template, nodes)
|
||||
|
||||
function M:init()
|
||||
self.lang_buttons = {}
|
||||
self.created_nodes = {}
|
||||
self.prefab = self:get_node("button_prefab")
|
||||
|
Reference in New Issue
Block a user