From 81de74d7230ff794e6ab2de06d2a5d68ea3fc0ef Mon Sep 17 00:00:00 2001 From: Annwan Date: Thu, 15 Aug 2024 04:16:32 +0200 Subject: [PATCH] [YQTemplate] added class image detection --- yqform.etlua | 32 ++++++++++++++++++++++++++------ yqtemplate.lua | 31 +++++++++++++++++-------------- 2 files changed, 43 insertions(+), 20 deletions(-) diff --git a/yqform.etlua b/yqform.etlua index 4dd0cb0..5c0dda2 100644 --- a/yqform.etlua +++ b/yqform.etlua @@ -15,7 +15,27 @@
Avatar
Is Leader
-
<%= args.is_leader and args.is_leader.v %>
+
+ <% if args.is_leader and args.is_leader.v == "on" then %> + + <% else %> + + <% end %>c +
+ +

Classes and Levels

+
+
Class 1
+
+ + Lvl <%= args.class1_lvl %> +
+
Class 2
+
+ + Lvl <%= args.class2_lvl %> +
+
Class leaning
<%= args.class_leaning %>
<% end %>
@@ -29,20 +49,20 @@

Classes and Levels


-
+
diff --git a/yqtemplate.lua b/yqtemplate.lua index 9ec5136..b792750 100644 --- a/yqtemplate.lua +++ b/yqtemplate.lua @@ -4,6 +4,20 @@ local utils = require "utils" local yqtemplateform = utils.readfile("yqform.etlua") local form = etlua.compile(yqtemplateform) +--- @type [table] +local classes = { + { n = "Beast", f = "c01.beast.png" }, + { n = "Swordsman", f = "c02.swordsman.png" }, + { n = "Spirit Bird", f = "c03.spirit-bird.png" }, + { n = "Twin Blades", f = "c04.twin-blades.png" }, + { n = "Healer", f = "c05.healer.png" }, + { n = "Summoner", f = "c06.summoner.png" }, + { n = "Tamer", f = "c07.tamer.png" }, + { n = "Pugilist", f = "c08.pugilist.png" }, + { n = "Mounted Fighter", f = "c09.mounted-fighter.png" }, + { n = "Fruit Animal", f = "c10.fruit-animal.png" }, + { n = "Spellcaster", f = "c11.spellcaster.png" } +} return { desc = "Creates Yokoka’s quest-style personal status page", @@ -33,21 +47,10 @@ return { end fcgi.print( form { - encoder = require"base64".encode, + encoder = require "base64".encode, + readfile = utils.readfile, args = args, - classes = { - "Beast", - "Swordsman", - "Spirit Bird", - "Twin Blades", - "Healer", - "Summoner", - "Tamer", - "Pugilist", - "Mounted Fighter", - "Fruit Animal", - "Spellcaster" - }, + classes = classes elements = { "Fire", "Water", "Earth", "Air", "Wood", "Electricity", "Metals", "Dreams",