diff --git a/Plugin.php b/Plugin.php index d3d8b2b..2ad6fc0 100644 --- a/Plugin.php +++ b/Plugin.php @@ -4,7 +4,7 @@ * * @package Pio * @author Dreamer-Paul - * @version 1.1 + * @version 1.2 * @link https://paugram.com */ @@ -29,17 +29,30 @@ class Pio_Plugin implements Typecho_Plugin_Interface{ echo "

Pio 看版娘插件 (".$version.")

"; echo "

By: Dreamer-Paul

"; echo "

项目介绍 - 更新日志

"; + 更新日志

"; $update = file_get_contents("https://api.paugram.com/update/?name=".$name."¤t=".$version."&site=".$_SERVER['HTTP_HOST']); $update = json_decode($update, true); - if($update['text']){echo "

".$update['text']."

"; }; - if($update['message']){echo "

".$update['message']."

"; }; + if(isset($update['text'])){echo "

".$update['text']."

"; }; + if(isset($update['message'])){echo "

".$update['message']."

"; }; echo ""; } - paul_update("Pio", "1.1"); + paul_update("Pio", "1.2"); + + // 读取模型文件夹 + $models = array(); + $load = glob("../usr/plugins/Pio/models/*"); + + foreach($load as $key => &$value){ + $aaa = substr($value, 26); + $models[$aaa] = ucfirst($aaa); + }; + + // 自定义模型选择 + $choose_models = new Typecho_Widget_Helper_Form_Element_Select('choose_models', $models, 'pio', _t('选择模型'), _t('选择插件 Models 目录下的模型,每个模型为一个文件夹,并确定配置文件名为 model.json')); + $form->addInput($choose_models); // 自定义宽高 $custom_width = new Typecho_Widget_Helper_Form_Element_Text('custom_width', NULL, NULL, _t('自定义宽度'), _t('在这里填入自定义宽度,部分模型需要修改')); @@ -49,7 +62,7 @@ class Pio_Plugin implements Typecho_Plugin_Interface{ $form->addInput($custom_height); // 自定义模型 - $custom_model = new Typecho_Widget_Helper_Form_Element_Text('custom_model', NULL, NULL, _t('自定义配置文件地址'), _t('在这里填入一个模型 JSON 配置文件地址,可供更换模型,不填则使用默认配置文件')); + $custom_model = new Typecho_Widget_Helper_Form_Element_Text('custom_model', NULL, NULL, _t('自定义配置文件地址'), _t('在这里填入一个模型 JSON 配置文件地址,可供使用外链模型,不填则使用插件目录下的模型')); $form->addInput($custom_model); } @@ -82,8 +95,11 @@ class Pio_Plugin implements Typecho_Plugin_Interface{ if(Typecho_Widget::widget('Widget_Options')->Plugin('Pio')->custom_model){ echo "". "\n"; } + else if(Typecho_Widget::widget('Widget_Options')->Plugin('Pio')->choose_models){ + echo "". "\n"; + } else{ - echo "". "\n"; + echo "". "\n"; } } } \ No newline at end of file diff --git a/model.json b/models/pio/model.json similarity index 100% rename from model.json rename to models/pio/model.json diff --git a/model.moc b/models/pio/model.moc similarity index 100% rename from model.moc rename to models/pio/model.moc diff --git a/motions/Breath Dere1.mtn b/models/pio/motions/Breath Dere1.mtn similarity index 100% rename from motions/Breath Dere1.mtn rename to models/pio/motions/Breath Dere1.mtn diff --git a/motions/Breath Dere2.mtn b/models/pio/motions/Breath Dere2.mtn similarity index 100% rename from motions/Breath Dere2.mtn rename to models/pio/motions/Breath Dere2.mtn diff --git a/motions/Breath Dere3.mtn b/models/pio/motions/Breath Dere3.mtn similarity index 100% rename from motions/Breath Dere3.mtn rename to models/pio/motions/Breath Dere3.mtn diff --git a/motions/Breath1.mtn b/models/pio/motions/Breath1.mtn similarity index 100% rename from motions/Breath1.mtn rename to models/pio/motions/Breath1.mtn diff --git a/motions/Breath2.mtn b/models/pio/motions/Breath2.mtn similarity index 100% rename from motions/Breath2.mtn rename to models/pio/motions/Breath2.mtn diff --git a/motions/Breath3.mtn b/models/pio/motions/Breath3.mtn similarity index 100% rename from motions/Breath3.mtn rename to models/pio/motions/Breath3.mtn diff --git a/motions/Breath4.mtn b/models/pio/motions/Breath4.mtn similarity index 100% rename from motions/Breath4.mtn rename to models/pio/motions/Breath4.mtn diff --git a/motions/Breath5.mtn b/models/pio/motions/Breath5.mtn similarity index 100% rename from motions/Breath5.mtn rename to models/pio/motions/Breath5.mtn diff --git a/motions/Breath6.mtn b/models/pio/motions/Breath6.mtn similarity index 100% rename from motions/Breath6.mtn rename to models/pio/motions/Breath6.mtn diff --git a/motions/Breath7.mtn b/models/pio/motions/Breath7.mtn similarity index 100% rename from motions/Breath7.mtn rename to models/pio/motions/Breath7.mtn diff --git a/motions/Breath8.mtn b/models/pio/motions/Breath8.mtn similarity index 100% rename from motions/Breath8.mtn rename to models/pio/motions/Breath8.mtn diff --git a/motions/Fail.mtn b/models/pio/motions/Fail.mtn similarity index 100% rename from motions/Fail.mtn rename to models/pio/motions/Fail.mtn diff --git a/motions/Sleeping.mtn b/models/pio/motions/Sleeping.mtn similarity index 100% rename from motions/Sleeping.mtn rename to models/pio/motions/Sleeping.mtn diff --git a/motions/Success.mtn b/models/pio/motions/Success.mtn similarity index 100% rename from motions/Success.mtn rename to models/pio/motions/Success.mtn diff --git a/motions/Sukebei1.mtn b/models/pio/motions/Sukebei1.mtn similarity index 100% rename from motions/Sukebei1.mtn rename to models/pio/motions/Sukebei1.mtn diff --git a/motions/Sukebei2.mtn b/models/pio/motions/Sukebei2.mtn similarity index 100% rename from motions/Sukebei2.mtn rename to models/pio/motions/Sukebei2.mtn diff --git a/motions/Sukebei3.mtn b/models/pio/motions/Sukebei3.mtn similarity index 100% rename from motions/Sukebei3.mtn rename to models/pio/motions/Sukebei3.mtn diff --git a/motions/Touch Dere1.mtn b/models/pio/motions/Touch Dere1.mtn similarity index 100% rename from motions/Touch Dere1.mtn rename to models/pio/motions/Touch Dere1.mtn diff --git a/motions/Touch Dere2.mtn b/models/pio/motions/Touch Dere2.mtn similarity index 100% rename from motions/Touch Dere2.mtn rename to models/pio/motions/Touch Dere2.mtn diff --git a/motions/Touch Dere3.mtn b/models/pio/motions/Touch Dere3.mtn similarity index 100% rename from motions/Touch Dere3.mtn rename to models/pio/motions/Touch Dere3.mtn diff --git a/motions/Touch Dere4.mtn b/models/pio/motions/Touch Dere4.mtn similarity index 100% rename from motions/Touch Dere4.mtn rename to models/pio/motions/Touch Dere4.mtn diff --git a/motions/Touch Dere5.mtn b/models/pio/motions/Touch Dere5.mtn similarity index 100% rename from motions/Touch Dere5.mtn rename to models/pio/motions/Touch Dere5.mtn diff --git a/motions/Touch Dere6.mtn b/models/pio/motions/Touch Dere6.mtn similarity index 100% rename from motions/Touch Dere6.mtn rename to models/pio/motions/Touch Dere6.mtn diff --git a/motions/Touch1.mtn b/models/pio/motions/Touch1.mtn similarity index 100% rename from motions/Touch1.mtn rename to models/pio/motions/Touch1.mtn diff --git a/motions/Touch2.mtn b/models/pio/motions/Touch2.mtn similarity index 100% rename from motions/Touch2.mtn rename to models/pio/motions/Touch2.mtn diff --git a/motions/Touch3.mtn b/models/pio/motions/Touch3.mtn similarity index 100% rename from motions/Touch3.mtn rename to models/pio/motions/Touch3.mtn diff --git a/motions/Touch4.mtn b/models/pio/motions/Touch4.mtn similarity index 100% rename from motions/Touch4.mtn rename to models/pio/motions/Touch4.mtn diff --git a/motions/Touch5.mtn b/models/pio/motions/Touch5.mtn similarity index 100% rename from motions/Touch5.mtn rename to models/pio/motions/Touch5.mtn diff --git a/motions/Touch6.mtn b/models/pio/motions/Touch6.mtn similarity index 100% rename from motions/Touch6.mtn rename to models/pio/motions/Touch6.mtn diff --git a/motions/WakeUp.mtn b/models/pio/motions/WakeUp.mtn similarity index 100% rename from motions/WakeUp.mtn rename to models/pio/motions/WakeUp.mtn diff --git a/textures/default-costume.png b/models/pio/textures/default-costume.png similarity index 100% rename from textures/default-costume.png rename to models/pio/textures/default-costume.png diff --git a/textures/pajamas-costume.png b/models/pio/textures/pajamas-costume.png similarity index 100% rename from textures/pajamas-costume.png rename to models/pio/textures/pajamas-costume.png diff --git a/textures/school-costume.png b/models/pio/textures/school-costume.png similarity index 100% rename from textures/school-costume.png rename to models/pio/textures/school-costume.png