<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>边缘矩阵</title>
  <icon>https://www.gravatar.com/avatar/9919bac0f165e3276c76fbad11487cb4</icon>
  
  <link href="https://android99.com/atom.xml" rel="self"/>
  
  <link href="https://android99.com/"/>
  <updated>2025-08-27T13:00:00.000Z</updated>
  <id>https://android99.com/</id>
  
  <author>
    <name>Android</name>
    <email>i@android99.com</email>
  </author>
  
  <generator uri="https://hexo.io/">Hexo</generator>
  
  <entry>
    <title>在 Linux 上运行 Windows 版的游戏服务端</title>
    <link href="https://android99.com/p/host-windows-game-server-on-linux/"/>
    <id>https://android99.com/p/host-windows-game-server-on-linux/</id>
    <published>2025-08-27T13:00:00.000Z</published>
    <updated>2025-08-27T13:00:00.000Z</updated>
    
    <content type="html"><![CDATA[<h2 id="介绍"><a href="#介绍" class="headerlink" title="介绍"></a>介绍</h2><p>有时我们想要开个某游戏的服务器，却发现只有 Windows 版的服务端，但自己系统是 Linux。<br>比如说 <a href="https://store.steampowered.com/app/1203620/">雾锁王国</a>、<a href="https://store.steampowered.com/app/2399830/">方舟：生存飞升</a> 这些游戏，目前尚未支持 Linux 版服务端。</p><p>这种情况，可以尝试用 <a href="https://github.com/GloriousEggroll/proton-ge-custom">GE-Proton</a> 来解决这个问题喵。<br><a href="https://github.com/GloriousEggroll/proton-ge-custom">GE-Proton</a> 基于 <a href="https://github.com/ValveSoftware/Proton">Proton</a> 和 <a href="https://www.winehq.org/">Wine</a> 开发，针对游戏做了很多优化，所以更适合用来运行游戏。</p><h2 id="教程"><a href="#教程" class="headerlink" title="教程"></a>教程</h2><p>以 <a href="https://store.steampowered.com/app/1203620/">雾锁王国</a> 举例。<br>如果有些步骤你已经做过了，则可以跳过。</p><h3 id="SteamCMD"><a href="#SteamCMD" class="headerlink" title="SteamCMD"></a>SteamCMD</h3><p>安装 <a href="https://developer.valvesoftware.com/wiki/Zh/SteamCMD">SteamCMD</a>。<br>建议先看看包管理器里有没有，没有的话可以参考以下命令手动安装。</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line">useradd -m gameds <span class="comment"># 新建用户</span></span><br><span class="line">su - gameds <span class="comment"># 切换用户</span></span><br><span class="line">wget https://steamcdn-a.akamaihd.net/client/installer/steamcmd_linux.tar.gz -P ~/downloads <span class="comment"># 下载压缩包</span></span><br><span class="line"><span class="built_in">mkdir</span> ~/Steam &amp;&amp; <span class="built_in">cd</span> ~/Steam <span class="comment"># 新建并切换目录</span></span><br><span class="line">tar -xf ~/downloads/steamcmd_linux.tar.gz <span class="comment"># 解压文件</span></span><br><span class="line">./steamcmd.sh +quit <span class="comment"># 初始化后退出</span></span><br></pre></td></tr></table></figure><h3 id="GE-Proton"><a href="#GE-Proton" class="headerlink" title="GE-Proton"></a>GE-Proton</h3><p>到 <a href="https://github.com/GloriousEggroll/proton-ge-custom">GE-Proton</a> 的 <a href="https://github.com/GloriousEggroll/proton-ge-custom/releases">发布页面</a> 下载最新版本的压缩包，放到 <code>~/downloads</code> 目录。<br>然后参考以下命令进行安装。</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cd</span> ~/Steam <span class="comment"># 切换目录</span></span><br><span class="line"><span class="built_in">mkdir</span> compatibilitytools.d <span class="comment"># 新建目录</span></span><br><span class="line">tar -xf ~/downloads/GE-Proton*.tar.gz -C compatibilitytools.d <span class="comment"># 解压文件</span></span><br></pre></td></tr></table></figure><h3 id="游戏服务端"><a href="#游戏服务端" class="headerlink" title="游戏服务端"></a>游戏服务端</h3><p>从 Steam 下载 <a href="https://store.steampowered.com/app/1203620/">雾锁王国</a> 的服务端。</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">mkdir</span> ~/scripts &amp;&amp; <span class="built_in">cd</span> ~/scripts <span class="comment"># 新建并切换目录</span></span><br><span class="line"><span class="built_in">cat</span> &gt;update-enshrouded.sh &lt;&lt;<span class="string">EOF # 新建脚本</span></span><br><span class="line"><span class="string">#!/usr/bin/env bash</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">ROOT=&quot;/home/gameds&quot;</span></span><br><span class="line"><span class="string">STEAM_DIR=&quot;$ROOT/Steam&quot;</span></span><br><span class="line"><span class="string">GAME_DIR=&quot;$ROOT/enshrouded&quot;</span></span><br><span class="line"><span class="string">APP_ID=&quot;2278520&quot;</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">cd $STEAM_DIR</span></span><br><span class="line"><span class="string">./steamcmd.sh +@sSteamCmdForcePlatformType windows +force_install_dir $GAME_DIR +login anonymous +app_update $APP_ID validate +quit</span></span><br><span class="line"><span class="string">EOF</span></span><br><span class="line"><span class="built_in">chmod</span> +x update-enshrouded.sh <span class="comment"># 增加执行权限</span></span><br><span class="line">./update-enshrouded.sh <span class="comment"># 安装并更新服务端</span></span><br><span class="line"><span class="built_in">exit</span> <span class="comment"># 退出当前用户</span></span><br></pre></td></tr></table></figure><p>以后游戏需要更新时，再次运行最后的脚本即可。<br>脚本里用了 <code>@sSteamCmdForcePlatformType windows</code> 参数，来强制下载 Windows 平台的文件。<br>这是因为，如果默认下载 Linux 平台的文件，可能会缺少内容。</p><h3 id="系统服务"><a href="#系统服务" class="headerlink" title="系统服务"></a>系统服务</h3><p>将游戏服务端设置为系统服务。<br><strong>服务配置中的部分内容需要根据情况调整，比如 <a href="https://github.com/GloriousEggroll/proton-ge-custom">GE-Proton</a> 的版本。<br>如果你还是 <code>gameds</code> 用户，记得先用 <code>exit</code> 命令，切换回 <code>root</code> 用户。</strong></p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line"><span class="built_in">cat</span> &gt;/etc/systemd/system/enshrouded.service &lt;&lt;<span class="string">EOF # 新建服务</span></span><br><span class="line"><span class="string">[Unit]</span></span><br><span class="line"><span class="string">Description=Enshrouded 雾锁王国 服务器</span></span><br><span class="line"><span class="string">Documentation=https://enshrouded.zendesk.com/hc/en-us/sections/16050842957085-Multiplayer-Server-Hosting</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">Wants=network-online.target</span></span><br><span class="line"><span class="string">After=network-online.target</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">StartLimitIntervalSec=5m</span></span><br><span class="line"><span class="string">StartLimitBurst=3</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">[Service]</span></span><br><span class="line"><span class="string">User=gameds</span></span><br><span class="line"><span class="string">Group=gameds</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">Restart=on-failure</span></span><br><span class="line"><span class="string">RestartSec=5</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">Environment=&quot;STEAM_COMPAT_CLIENT_INSTALL_PATH=/home/gameds/Steam&quot;</span></span><br><span class="line"><span class="string">Environment=&quot;STEAM_COMPAT_DATA_PATH=/home/gameds/enshrouded/steamapps/compatdata/2278520&quot;</span></span><br><span class="line"><span class="string">WorkingDirectory=/home/gameds/enshrouded</span></span><br><span class="line"><span class="string">ExecStart=/home/gameds/Steam/compatibilitytools.d/GE-Proton10-14/proton run enshrouded_server.exe</span></span><br><span class="line"><span class="string"></span></span><br><span class="line"><span class="string">[Install]</span></span><br><span class="line"><span class="string">WantedBy=multi-user.target</span></span><br><span class="line"><span class="string">EOF</span></span><br><span class="line">systemctl daemon-reload <span class="comment"># 重新加载服务配置</span></span><br></pre></td></tr></table></figure><p>这里的关键点在于，要设置 <code>STEAM_COMPAT_CLIENT_INSTALL_PATH</code> 和 <code>STEAM_COMPAT_DATA_PATH</code> 两个环境变量。</p><h3 id="管理服务端"><a href="#管理服务端" class="headerlink" title="管理服务端"></a>管理服务端</h3><p>可以参考以下命令来管理服务端。</p><figure class="highlight bash"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br></pre></td><td class="code"><pre><span class="line">systemctl start enshrouded <span class="comment"># 启动服务端</span></span><br><span class="line">systemctl stop enshrouded <span class="comment"># 停止服务端</span></span><br><span class="line">systemctl restart enshrouded <span class="comment"># 重启服务端</span></span><br><span class="line">systemctl status enshrouded <span class="comment"># 查看服务端状态</span></span><br></pre></td></tr></table></figure><p>如果运行正常，命令 <code>systemctl status enshrouded</code> 应该会有如下类似输出。</p><figure class="highlight shell"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br></pre></td><td class="code"><pre><span class="line">[root@VM-8-10-centos ~]# systemctl status enshrouded</span><br><span class="line">● enshrouded.service - Enshrouded 雾锁王国 服务器</span><br><span class="line">   Loaded: loaded (/etc/systemd/system/enshrouded.service; disabled; vendor preset: disabled)</span><br><span class="line">   Active: active (running) since Wed 2025-08-27 19:50:35 CST; 15s ago</span><br><span class="line">     Docs: https://enshrouded.zendesk.com/hc/en-us/sections/16050842957085-Multiplayer-Server-Hosting</span><br><span class="line"> Main PID: 2196970 (python3)</span><br><span class="line">    Tasks: 64 (limit: 47387)</span><br><span class="line">   Memory: 1.1G</span><br><span class="line">   CGroup: /system.slice/enshrouded.service</span><br><span class="line">           ├─2196970 python3 /home/gameds/Steam/compatibilitytools.d/GE-Proton10-14/proton run enshrouded_server.exe</span><br><span class="line">           ├─2196978 c:\windows\system32\steam.exe enshrouded_server.exe</span><br><span class="line">           ├─2196984 /home/gameds/Steam/compatibilitytools.d/GE-Proton10-14/files/bin/wineserver</span><br><span class="line">           ├─2196988 C:\windows\system32\services.exe</span><br><span class="line">           ├─2196992 C:\windows\system32\winedevice.exe</span><br><span class="line">           ├─2197002 C:\windows\system32\winedevice.exe</span><br><span class="line">           ├─2197015 C:\windows\system32\plugplay.exe</span><br><span class="line">           ├─2197021 C:\windows\system32\svchost.exe -k LocalServiceNetworkRestricted</span><br><span class="line">           └─2197032 enshrouded_server.exe</span><br><span class="line"></span><br><span class="line">8月 27 19:50:35 VM-8-10-centos systemd[1]: Started Enshrouded 雾锁王国 服务器.</span><br><span class="line">8月 27 19:50:36 VM-8-10-centos proton[2196984]: esync: up and running.</span><br><span class="line">8月 27 19:50:36 VM-8-10-centos proton[2196984]: wine: RLIMIT_NICE is &lt;= 20, unable to use setpriority safely</span><br></pre></td></tr></table></figure><h2 id="大功告成"><a href="#大功告成" class="headerlink" title="大功告成"></a>大功告成</h2><p>🎉 恭喜你，解锁了新技能！<br>再也不怕游戏服务端只有 Windows 版了喵。&#x3D;ᗜωᗜ&#x3D;<br><del>虽然不一定所有游戏都行得通…… qwq</del></p>]]></content>
    
    
      
      
    <summary type="html">&lt;h2 id=&quot;介绍&quot;&gt;&lt;a href=&quot;#介绍&quot; class=&quot;headerlink&quot; title=&quot;介绍&quot;&gt;&lt;/a&gt;介绍&lt;/h2&gt;&lt;p&gt;有时我们想要开个某游戏的服务器，却发现只有 Windows 版的服务端，但自己系统是 Linux。&lt;br&gt;比如说 &lt;a href=&quot;http</summary>
      
    
    
    
    <category term="游戏" scheme="https://android99.com/categories/%E6%B8%B8%E6%88%8F/"/>
    
    
    <category term="游戏" scheme="https://android99.com/tags/%E6%B8%B8%E6%88%8F/"/>
    
    <category term="服务器" scheme="https://android99.com/tags/%E6%9C%8D%E5%8A%A1%E5%99%A8/"/>
    
  </entry>
  
  <entry>
    <title>利用插件系统，批量替换 Butterfly 主题的 CDN。</title>
    <link href="https://android99.com/p/butterfly-replace-cdn/"/>
    <id>https://android99.com/p/butterfly-replace-cdn/</id>
    <published>2022-05-17T12:00:00.000Z</published>
    <updated>2023-08-20T20:30:00.000Z</updated>
    
    <content type="html"><![CDATA[<div class="note warning flat"><p>如果你的 <a href="https://butterfly.js.org/">Butterfly</a> 版本高于 4.3.0，则主题自带 CDN 自定义格式功能。<br>可参考 <a href="https://butterfly.js.org/posts/4aa8abbe/#CDN">主题文档的 CDN 部分</a> 进行配置，无需继续以下步骤。</p></div><p>自从 <a href="https://www.jsdelivr.com/">jsDelivr</a> 速度下降后，现在连访问也出现了问题。<br>所以分享个利用 Hexo 的 <a href="https://hexo.io/zh-cn/docs/plugins">插件</a> 系统，批量替换 <a href="https://butterfly.js.org/">Butterfly</a> 主题 CDN 的方法。</p><h2 id="步骤"><a href="#步骤" class="headerlink" title="步骤"></a>步骤</h2><h3 id="创建文件"><a href="#创建文件" class="headerlink" title="创建文件"></a>创建文件</h3><p>创建一个 JavaScript 脚本文件，放到 <code>scripts</code> 文件夹。</p><h3 id="增加代码"><a href="#增加代码" class="headerlink" title="增加代码"></a>增加代码</h3><p>请根据主题版本选择。</p><div class="tabs"><div class="nav-tabs"><button type="button" class="tab active">4.2.0+</button><button type="button" class="tab">2.0.0+</button></div><div class="tab-contents"><div class="tab-item-content active"><figure class="highlight js"><figcaption><span>modify.js</span></figcaption><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">&#x27;use strict&#x27;</span>;</span><br><span class="line"><span class="keyword">const</span> &#123; filter &#125; = hexo.<span class="property">extend</span>;</span><br><span class="line"></span><br><span class="line"><span class="comment">// 替换 CDN</span></span><br><span class="line">filter.<span class="title function_">register</span>(<span class="string">&#x27;before_generate&#x27;</span>, <span class="function">() =&gt;</span> &#123;</span><br><span class="line">    <span class="keyword">const</span> &#123; asset &#125; = hexo.<span class="property">theme</span>.<span class="property">config</span>;</span><br><span class="line">    <span class="keyword">for</span> (<span class="keyword">const</span> name <span class="keyword">in</span> asset) &#123;</span><br><span class="line">        asset[name] = asset[name]</span><br><span class="line marked">            .<span class="title function_">replace</span>(<span class="string">&#x27;//cdn.jsdelivr.net/npm/&#x27;</span>, <span class="string">&#x27;//npm.elemecdn.com/&#x27;</span>);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;, <span class="number">11</span>);</span><br></pre></td></tr></table></figure></div><div class="tab-item-content"><figure class="highlight js"><figcaption><span>modify.js</span></figcaption><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">&#x27;use strict&#x27;</span>;</span><br><span class="line"><span class="keyword">const</span> &#123; filter &#125; = hexo.<span class="property">extend</span>;</span><br><span class="line"></span><br><span class="line"><span class="comment">// 替换 CDN</span></span><br><span class="line">filter.<span class="title function_">register</span>(<span class="string">&#x27;before_generate&#x27;</span>, <span class="function">() =&gt;</span> &#123;</span><br><span class="line">    <span class="keyword">const</span> &#123; <span class="variable constant_">CDN</span> &#125; = hexo.<span class="property">theme</span>.<span class="property">config</span>;</span><br><span class="line">    <span class="keyword">for</span> (<span class="keyword">const</span> name <span class="keyword">in</span> <span class="variable constant_">CDN</span>) &#123;</span><br><span class="line">        <span class="variable constant_">CDN</span>[name] = <span class="variable constant_">CDN</span>[name]</span><br><span class="line marked">            .<span class="title function_">replace</span>(<span class="string">&#x27;//cdn.jsdelivr.net/npm/&#x27;</span>, <span class="string">&#x27;//npm.elemecdn.com/&#x27;</span>);</span><br><span class="line">    &#125;</span><br><span class="line">&#125;, <span class="number">11</span>);</span><br></pre></td></tr></table></figure></div></div><div class="tab-to-top"><button type="button" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div></div><h3 id="按需修改"><a href="#按需修改" class="headerlink" title="按需修改"></a>按需修改</h3><p>根据需要更改 <code>replace</code> 方法的参数，上文是将 <a href="https://www.jsdelivr.com/">jsDelivr</a> 替换为 饿了么。</p><h2 id="原理"><a href="#原理" class="headerlink" title="原理"></a>原理</h2><p>参考 <a href="https://butterfly.js.org/">Butterfly</a> 主题 <code>4.2.2</code> 版本 <a href="https://github.com/jerryc127/hexo-theme-butterfly/blob/4.2.2/scripts/events/config.js">config.js</a> 的代码。<br>主题会在运行时，根据配置文件动态生成链接并增加到配置中。<br>那么我们只需要再用相同的方式，微调一下就能做到批量替换了。</p><p>在 Hexo 注册 <code>before_generate</code> 过滤器，设置优先级为 11。<br>触发时，遍历配置中的 <code>asset</code> 选项并替换链接。</p><p><a href="https://hexo.io/zh-cn/api/filter">过滤器</a> 的默认优先级是 10，所以我们设置成 11。<br>确保等主题处理完配置之后再运行。</p>]]></content>
    
    
      
      
    <summary type="html">&lt;div class=&quot;note warning flat&quot;&gt;&lt;p&gt;如果你的 &lt;a href=&quot;https://butterfly.js.org/&quot;&gt;Butterfly&lt;/a&gt; 版本高于 4.3.0，则主题自带 CDN 自定义格式功能。&lt;br&gt;可参考 &lt;a href=&quot;https</summary>
      
    
    
    
    <category term="网站技术" scheme="https://android99.com/categories/%E7%BD%91%E7%AB%99%E6%8A%80%E6%9C%AF/"/>
    
    <category term="Butterfly" scheme="https://android99.com/categories/%E7%BD%91%E7%AB%99%E6%8A%80%E6%9C%AF/Butterfly/"/>
    
    
    <category term="Hexo" scheme="https://android99.com/tags/Hexo/"/>
    
    <category term="Butterfly" scheme="https://android99.com/tags/Butterfly/"/>
    
  </entry>
  
  <entry>
    <title>Maya 视口中颜色异常的解决方法</title>
    <link href="https://android99.com/p/maya-viewport-color-problem/"/>
    <id>https://android99.com/p/maya-viewport-color-problem/</id>
    <published>2021-12-27T06:00:00.000Z</published>
    <updated>2022-01-28T11:36:30.000Z</updated>
    
    <content type="html"><![CDATA[<h2 id="现象"><a href="#现象" class="headerlink" title="现象"></a>现象</h2><p>在视口中，会看到模型上的颜色有非常明显的条纹、分割，如图所示。</p><p><img src="/p/maya-viewport-color-problem/%E7%8E%B0%E8%B1%A1.jpg" alt="现象"></p><p>经测试发现，不仅视口会出现这个情况。</p><p>在使用 <code>Maya 硬件 2.0</code> 进行渲染时，也会出现这个情况。</p><h2 id="解决方法"><a href="#解决方法" class="headerlink" title="解决方法"></a>解决方法</h2><p>在视口菜单找到 <code>渲染器</code> &gt; <code>Viewport 2.0</code>，点击后面的 <code>□</code> 选项。</p><p>以及，如果你使用 <code>Maya 硬件 2.0</code> 渲染器进行渲染，则在状态行找到 <code>渲染设置</code>。</p><p>然后，在渲染器设置中找到并启用 <code>浮点渲染目标</code>。</p><p><img src="/p/maya-viewport-color-problem/%E6%B5%AE%E7%82%B9%E6%B8%B2%E6%9F%93%E7%9B%AE%E6%A0%87.jpg" alt="浮点渲染目标"></p><p>现在，模型的颜色就恢复正常了。</p><p><img src="/p/maya-viewport-color-problem/%E6%AD%A3%E5%B8%B8.jpg" alt="正常"></p><h2 id="分析"><a href="#分析" class="headerlink" title="分析"></a>分析</h2><p><code>浮点渲染目标</code> 在新版本是默认启用的。</p><p>所以通常这种情况在打开旧版本场景时才会出现。</p><h2 id="参考资料"><a href="#参考资料" class="headerlink" title="参考资料"></a>参考资料</h2><p><a href="https://knowledge.autodesk.com/zh-hans/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2018/CHS/Maya-Rendering/files/GUID-4ABC6724-9DB0-45D5-AAF2-5C2FF135247D-htm.html">重要的颜色管理设置</a></p>]]></content>
    
    
      
      
    <summary type="html">&lt;h2 id=&quot;现象&quot;&gt;&lt;a href=&quot;#现象&quot; class=&quot;headerlink&quot; title=&quot;现象&quot;&gt;&lt;/a&gt;现象&lt;/h2&gt;&lt;p&gt;在视口中，会看到模型上的颜色有非常明显的条纹、分割，如图所示。&lt;/p&gt;
&lt;p&gt;&lt;img src=&quot;/p/maya-viewport-colo</summary>
      
    
    
    
    <category term="软件" scheme="https://android99.com/categories/%E8%BD%AF%E4%BB%B6/"/>
    
    <category term="Maya" scheme="https://android99.com/categories/%E8%BD%AF%E4%BB%B6/Maya/"/>
    
    
    <category term="Maya" scheme="https://android99.com/tags/Maya/"/>
    
  </entry>
  
  <entry>
    <title>Butterfly 主题一图流背景与顶部图修改</title>
    <link href="https://android99.com/p/butterfly-top-image-modify/"/>
    <id>https://android99.com/p/butterfly-top-image-modify/</id>
    <published>2021-08-10T13:00:00.000Z</published>
    <updated>2025-01-05T04:30:00.000Z</updated>
    
    <content type="html"><![CDATA[<h2 id="介绍"><a href="#介绍" class="headerlink" title="介绍"></a>介绍</h2><p>之前在「<a href="/p/hello-hexo/" title="博客迁移至 Hexo，并更名为矩阵。">博客迁移至 Hexo，并更名为矩阵。</a>」提到过一图流背景与顶部图的修改。</p><p>本文会详细说明修改过程。</p><p><img src="/p/butterfly-top-image-modify/%E6%95%88%E6%9E%9C%E5%9B%BE.jpg" alt="效果图"></p><h2 id="主题配置"><a href="#主题配置" class="headerlink" title="主题配置"></a>主题配置</h2><p>修改 <a href="https://butterfly.js.org/">Butterfly</a> 的配置文件 <code>_config.butterfly.yml</code>。</p><p>编辑 <code>index_img</code>、<code>footer_img</code>、<code>background</code>、<code>index_top_img_height</code>、<code>mask.header</code> 选项。<br>将主页顶部图和页脚图改为透明，设置网站背景，调整主页顶部图高度，移除顶部图的半透明遮罩。<br><em>(需要将示例地址替换为自己的图片地址。)</em></p><figure class="highlight yaml"><figcaption><span>_config.butterfly.yml</span></figcaption><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># --------------------------------------</span></span><br><span class="line"><span class="comment"># Image Settings</span></span><br><span class="line"><span class="comment"># --------------------------------------</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># The banner image of index page</span></span><br><span class="line"><span class="attr">index_img:</span> <span class="string">transparent</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># The background image of footer</span></span><br><span class="line"><span class="attr">footer_img:</span> <span class="string">transparent</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># Website Background</span></span><br><span class="line"><span class="comment"># Can set it to color or image url</span></span><br><span class="line"><span class="attr">background:</span> <span class="string">https://example.com/img/background.jpg</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># --------------------------------------</span></span><br><span class="line"><span class="comment"># Index page settings</span></span><br><span class="line"><span class="comment"># --------------------------------------</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># The height of top_img, eg: 300px/300em/300rem</span></span><br><span class="line"><span class="attr">index_top_img_height:</span> <span class="string">400px</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># --------------------------------------</span></span><br><span class="line"><span class="comment"># Beautify / Effect</span></span><br><span class="line"><span class="comment"># --------------------------------------</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># Add a mask to the header and footer</span></span><br><span class="line"><span class="attr">mask:</span></span><br><span class="line">  <span class="attr">header:</span> <span class="literal">false</span></span><br></pre></td></tr></table></figure><h2 id="引入相关样式"><a href="#引入相关样式" class="headerlink" title="引入相关样式"></a>引入相关样式</h2><p>新建一个文件，位于 <code>source/css/modify.styl</code>，并增加以下内容。<br><em>(此处只是举例，也可以使用已有的样式文件。)</em></p><figure class="highlight styl"><figcaption><span>modify.styl</span></figcaption><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br><span class="line">43</span><br><span class="line">44</span><br><span class="line">45</span><br><span class="line">46</span><br><span class="line">47</span><br><span class="line">48</span><br><span class="line">49</span><br><span class="line">50</span><br><span class="line">51</span><br></pre></td><td class="code"><pre><span class="line"><span class="keyword">@import</span> <span class="string">&#x27;nib&#x27;</span></span><br><span class="line"></span><br><span class="line"><span class="comment">// 顶部图</span></span><br><span class="line"><span class="selector-id">#page-header</span></span><br><span class="line">  <span class="attribute">background</span>: transparent <span class="meta">!important</span></span><br><span class="line"></span><br><span class="line">  &amp;<span class="selector-class">.post-bg</span>, &amp;<span class="selector-class">.not-home-page</span></span><br><span class="line">    <span class="attribute">height</span>: <span class="number">280px</span> <span class="meta">!important</span></span><br><span class="line">  <span class="selector-id">#post-info</span></span><br><span class="line">    <span class="attribute">bottom</span>: <span class="number">40px</span> <span class="meta">!important</span></span><br><span class="line">    <span class="attribute">text-align</span>: center</span><br><span class="line">  <span class="selector-id">#page-site-info</span></span><br><span class="line">    <span class="attribute">top</span>: <span class="number">140px</span> <span class="meta">!important</span></span><br><span class="line"></span><br><span class="line">  <span class="keyword">@media</span> screen <span class="keyword">and</span> (<span class="attribute">max-width</span>: <span class="number">768px</span>)</span><br><span class="line">    &amp;.not-home-page</span><br><span class="line">      <span class="attribute">height</span>: <span class="number">200px</span> !important</span><br><span class="line">    #post-info</span><br><span class="line">      bottom: <span class="number">10px</span> !important</span><br><span class="line">    #page-site-info</span><br><span class="line">      top: <span class="number">100px</span> !important</span><br><span class="line"></span><br><span class="line">.top-img</span><br><span class="line">  <span class="attribute">height</span>: <span class="number">250px</span></span><br><span class="line">  margin: -<span class="number">50px</span> -<span class="number">40px</span> <span class="number">50px</span></span><br><span class="line">  border-top-left-radius: inherit</span><br><span class="line">  border-top-right-radius: inherit</span><br><span class="line">  background-position: center</span><br><span class="line">  background-size: cover</span><br><span class="line">  transition: all .<span class="number">3s</span></span><br><span class="line"></span><br><span class="line">  @media screen <span class="keyword">and</span> (<span class="attribute">max-width</span>: <span class="number">768px</span>)</span><br><span class="line">    <span class="attribute">height</span>: <span class="number">230px</span></span><br><span class="line">    margin: -<span class="number">36px</span> -<span class="number">14px</span> <span class="number">36px</span></span><br><span class="line"></span><br><span class="line">  [data-theme=&#x27;dark&#x27;] &amp;</span><br><span class="line">    filter: brightness(.<span class="number">8</span>)</span><br><span class="line"></span><br><span class="line">// 页脚</span><br><span class="line">#footer:before</span><br><span class="line">  background-color: alpha(#FFF, .<span class="number">5</span>)</span><br><span class="line"></span><br><span class="line">  [data-theme=&#x27;dark&#x27;] &amp;</span><br><span class="line">    background-color: alpha(#<span class="number">000</span>, .<span class="number">5</span>)</span><br><span class="line"></span><br><span class="line">#footer-wrap, #footer-wrap a</span><br><span class="line">  <span class="attribute">color</span>: #<span class="number">111</span></span><br><span class="line">  transition: unset</span><br><span class="line"></span><br><span class="line">  [data-theme=&#x27;dark&#x27;] &amp;</span><br><span class="line">    <span class="attribute">color</span>: var(--light-grey)</span><br></pre></td></tr></table></figure><p>修改 <a href="https://butterfly.js.org/">Butterfly</a> 的配置文件 <code>_config.butterfly.yml</code>，在 <code>inject.head</code> 选项引入样式。</p><figure class="highlight yaml"><figcaption><span>_config.butterfly.yml</span></figcaption><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># --------------------------------------</span></span><br><span class="line"><span class="comment"># Other Settings</span></span><br><span class="line"><span class="comment"># --------------------------------------</span></span><br><span class="line"></span><br><span class="line"><span class="comment"># Inject</span></span><br><span class="line"><span class="comment"># Insert the code to head (before &#x27;&lt;/head&gt;&#x27; tag) and the bottom (before &#x27;&lt;/body&gt;&#x27; tag)</span></span><br><span class="line"><span class="attr">inject:</span></span><br><span class="line">  <span class="attr">head:</span></span><br><span class="line">    <span class="bullet">-</span> <span class="string">&lt;link</span> <span class="string">rel=&quot;stylesheet&quot;</span> <span class="string">href=&quot;/css/modify.css&quot;&gt;</span></span><br></pre></td></tr></table></figure><p>因为 Hexo 会将 Stylus 渲染成 CSS 文件，所以此处为 <code>modify.css</code>。</p><h2 id="增加插件脚本"><a href="#增加插件脚本" class="headerlink" title="增加插件脚本"></a>增加插件脚本</h2><p>由于用到 <code>cheerio</code> 来解析 HTML，所以需要先安装依赖。</p><figure class="highlight cmd"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">npm install cheerio</span><br></pre></td></tr></table></figure><p>新建一个文件，位于 <code>scripts/modify.js</code>，并增加以下内容。<br><em>(此处只是举例，也可以使用已有的插件脚本文件。)</em></p><figure class="highlight js"><figcaption><span>modify.js</span></figcaption><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br></pre></td><td class="code"><pre><span class="line"><span class="meta">&#x27;use strict&#x27;</span>;</span><br><span class="line"><span class="keyword">const</span> &#123; filter &#125; = hexo.<span class="property">extend</span>;</span><br><span class="line"><span class="keyword">const</span> cheerio = <span class="built_in">require</span>(<span class="string">&#x27;cheerio&#x27;</span>);</span><br><span class="line"></span><br><span class="line"><span class="comment">/**</span></span><br><span class="line"><span class="comment"> * 在页面插入新顶部图</span></span><br><span class="line"><span class="comment"> * <span class="doctag">@param</span> &#123;<span class="type">cheerio.Root</span>&#125; $ Root</span></span><br><span class="line"><span class="comment"> */</span></span><br><span class="line"><span class="keyword">function</span> <span class="title function_">insertTopImg</span>(<span class="params">$</span>) &#123;</span><br><span class="line">    <span class="keyword">const</span> header = $(<span class="string">&#x27;#page-header&#x27;</span>);</span><br><span class="line">    <span class="keyword">if</span> (header.<span class="property">length</span> === <span class="number">0</span>) <span class="keyword">return</span>;</span><br><span class="line">    <span class="keyword">const</span> background = header.<span class="title function_">css</span>(<span class="string">&#x27;background-image&#x27;</span>);</span><br><span class="line">    <span class="keyword">if</span> (!background) <span class="keyword">return</span>;</span><br><span class="line">    $(<span class="string">&#x27;#post, #page, #archive, #tag, #category&#x27;</span>).<span class="title function_">prepend</span>(<span class="string">`&lt;div class=&quot;top-img&quot; style=&quot;background-image: <span class="subst">$&#123;background&#125;</span>;&quot;&gt;&lt;/div&gt;`</span>);</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">// 修改 HTML</span></span><br><span class="line">filter.<span class="title function_">register</span>(<span class="string">&#x27;after_render:html&#x27;</span>, <span class="function">(<span class="params">str, data</span>) =&gt;</span> &#123;</span><br><span class="line">    <span class="keyword">const</span> $ = cheerio.<span class="title function_">load</span>(str, &#123;</span><br><span class="line">        <span class="attr">decodeEntities</span>: <span class="literal">false</span></span><br><span class="line">    &#125;);</span><br><span class="line">    <span class="title function_">insertTopImg</span>($);</span><br><span class="line">    <span class="keyword">return</span> $.<span class="title function_">html</span>();</span><br><span class="line">&#125;);</span><br></pre></td></tr></table></figure><h2 id="大功告成"><a href="#大功告成" class="headerlink" title="大功告成"></a>大功告成</h2><p>👏 恭喜你完成了修改，可以使用以下命令进行预览。</p><figure class="highlight cmd"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">hexo server</span><br></pre></td></tr></table></figure><h2 id="后记"><a href="#后记" class="headerlink" title="后记"></a>后记</h2><p>其实早些时候，有篇最终效果类似的修改教程。<br>是友链的 <a href="https://www.imcharon.com/">@Nesxc</a> 大佬写的「<a href="https://www.imcharon.com/60/">butterfly文章页美化教程</a>」。<br>他是通过修改主题源文件的方式实现的。<br>而我是用 Hexo 的 <a href="https://hexo.io/zh-cn/docs/plugins">插件</a> 系统实现的。</p><p>插件版的优点是更新主题时，只要结构变化不大，无需任何操作即可继续使用，并且管理更加方便。<br>源文件版的优点是效率会略高一点，毕竟是直接修改的主题源文件。</p><p>如果像我一样，不想每次升级主题都可能要重新改一遍，或是为了方便管理，则可以选择插件版。<br>如果本来就修改了源文件，也不介意再多修改这一个，则可以选择源文件版。</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h2 id=&quot;介绍&quot;&gt;&lt;a href=&quot;#介绍&quot; class=&quot;headerlink&quot; title=&quot;介绍&quot;&gt;&lt;/a&gt;介绍&lt;/h2&gt;&lt;p&gt;之前在「&lt;a href=&quot;/p/hello-hexo/&quot; title=&quot;博客迁移至 Hexo，并更名为矩阵。&quot;&gt;博客迁移至 Hexo，并更名</summary>
      
    
    
    
    <category term="网站技术" scheme="https://android99.com/categories/%E7%BD%91%E7%AB%99%E6%8A%80%E6%9C%AF/"/>
    
    <category term="Butterfly" scheme="https://android99.com/categories/%E7%BD%91%E7%AB%99%E6%8A%80%E6%9C%AF/Butterfly/"/>
    
    
    <category term="Hexo" scheme="https://android99.com/tags/Hexo/"/>
    
    <category term="Butterfly" scheme="https://android99.com/tags/Butterfly/"/>
    
  </entry>
  
  <entry>
    <title>关于 Pjax 与 PWA 冲突，导致地址栏异常的解决方法。</title>
    <link href="https://android99.com/p/pjax-and-pwa-conflict/"/>
    <id>https://android99.com/p/pjax-and-pwa-conflict/</id>
    <published>2020-12-18T08:00:00.000Z</published>
    <updated>2021-08-24T03:10:00.000Z</updated>
    
    <content type="html"><![CDATA[<h2 id="描述"><a href="#描述" class="headerlink" title="描述"></a>描述</h2><p>如果你的网站同时配置了 <a href="https://github.com/MoOx/pjax">Pjax</a> 与 <a href="https://web.dev/progressive-web-apps/">PWA</a>。</p><p>那么在浏览网站时，地址栏则可能会出现意外的后缀。</p><p>后缀的内容与 <a href="https://web.dev/progressive-web-apps/">PWA</a> 中 <a href="https://web.dev/service-workers-cache-storage/">Service Worker</a> 的功能实现有关。</p><p>使用 <a href="https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-build">workbox-build</a> 的只有 <code>index.html</code>。</p><p>使用 <a href="https://github.com/GoogleChromeLabs/sw-precache">sw-precache</a> 的类似于 <code>index.html?_sw-precache=d65205fbf6be65ea9e136772f668efdb</code>。</p><h2 id="分析"><a href="#分析" class="headerlink" title="分析"></a>分析</h2><h3 id="PWA"><a href="#PWA" class="headerlink" title="PWA"></a>PWA</h3><h4 id="index-html"><a href="#index-html" class="headerlink" title="index.html"></a>index.html</h4><p>后缀中的 <code>index.html</code> 路径是根据其静态文件生成的。</p><p>通常这种情况，是想在链接中使用目录来访问指定页面。</p><p>例如 <code>https://example.com/about/</code>，而不是 <code>https://example.com/about/index.html</code>。</p><p>但程序并不知道，所以在生成的 precache 清单里，都是带有 <code>index.html</code> 的路径。</p><h4 id="sw-precache"><a href="#sw-precache" class="headerlink" title="_sw-precache"></a>_sw-precache</h4><p>后缀中的 <code>_sw-precache</code> 参数是根据静态文件的内容，生成的 Hash 值。</p><p>作用是用来判断文件内容是否发生变化，以便及时更新缓存。</p><p>但 <a href="https://github.com/GoogleChromeLabs/sw-precache">sw-precache</a> 从缓存响应请求时，并没有去掉自己的参数。</p><p>而 <a href="https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-build">workbox-build</a> 虽然也加了参数，叫 <code>__WB_REVISION__</code>。</p><p>不过从缓存响应请求时，会去掉自己的参数。</p><h3 id="Pjax"><a href="#Pjax" class="headerlink" title="Pjax"></a>Pjax</h3><p>如果没用 <a href="https://github.com/MoOx/pjax">Pjax</a> 的话，这个后缀是不会出现在地址栏的。</p><p>但 <a href="https://github.com/MoOx/pjax">Pjax</a> 在改变地址栏时，逻辑优先是响应地址。</p><p>所以地址栏就会出现这些后缀。</p><h2 id="解决方法"><a href="#解决方法" class="headerlink" title="解决方法"></a>解决方法</h2><div class="tabs"><div class="nav-tabs"><button type="button" class="tab active">workbox-build</button><button type="button" class="tab">sw-precache</button></div><div class="tab-contents"><div class="tab-item-content active"><p>使用 <a href="https://developers.google.com/web/tools/workbox/reference-docs/latest/module-workbox-build">workbox-build</a> 的 <code>manifestTransforms</code> 选项。</p><p>对生成的清单进行变换，去掉路径中的 <code>index.html</code>，从根源上解决问题。</p><p>声明 <code>removeIndex</code> 方法，并在上述选项中引用。</p><p>以我用的 v2 版 <a href="https://github.com/JLHwung/hexo-offline">hexo-offline</a> 插件配置文件为例。</p><figure class="highlight javascript"><figcaption><span>hexo-offline.config.cjs</span></figcaption><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br></pre></td><td class="code"><pre><span class="line"><span class="variable language_">module</span>.<span class="property">exports</span> = &#123;</span><br><span class="line">  <span class="comment">// 其他配置...</span></span><br><span class="line">  <span class="attr">manifestTransforms</span>: [removeIndex]</span><br><span class="line">&#125;</span><br><span class="line"></span><br><span class="line"><span class="comment">/** 移除 URL 末尾的 index.html */</span></span><br><span class="line"><span class="keyword">async</span> <span class="keyword">function</span> <span class="title function_">removeIndex</span>(<span class="params">manifestEntries</span>) &#123;</span><br><span class="line">  <span class="keyword">const</span> manifest = manifestEntries.<span class="title function_">map</span>(<span class="function">(<span class="params">entry</span>) =&gt;</span> &#123;</span><br><span class="line">    entry.<span class="property">url</span> = entry.<span class="property">url</span>.<span class="title function_">replace</span>(<span class="regexp">/(^|\/)index\.html$/</span>, <span class="string">&#x27;/&#x27;</span>);</span><br><span class="line">    <span class="keyword">return</span> entry;</span><br><span class="line">  &#125;);</span><br><span class="line">  <span class="keyword">return</span> &#123; manifest &#125;;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure></div><div class="tab-item-content"><p>增加一段 Javascript 代码，用来劫持 <a href="https://github.com/MoOx/pjax">Pjax</a> 处理响应的方法。</p><p>把 <code>request</code> 对象中的响应地址修改为请求地址。</p><p>这里用到了 <code>Object.defineProperty</code> 方法，因为 <code>request.responseURL</code> 是只读变量，无法直接修改。</p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 重定向浏览器地址</span></span><br><span class="line">pjax.<span class="property">site_handleResponse</span> = pjax.<span class="property">handleResponse</span>;</span><br><span class="line">pjax.<span class="property">handleResponse</span> = <span class="keyword">function</span>(<span class="params">responseText, request, href, options</span>) &#123;</span><br><span class="line">    <span class="title class_">Object</span>.<span class="title function_">defineProperty</span>(request, <span class="string">&#x27;responseURL&#x27;</span>, &#123;</span><br><span class="line">        <span class="attr">value</span>: href</span><br><span class="line">    &#125;);</span><br><span class="line">    pjax.<span class="title function_">site_handleResponse</span>(responseText, request, href, options);</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><h3 id="在Butterfly的具体操作"><a href="#在Butterfly的具体操作" class="headerlink" title="在Butterfly的具体操作"></a>在Butterfly的具体操作</h3><ol><li><p>将上述代码保存到 <code>source\js\modify.js</code>。</p></li><li><p>编辑 <code>_config.butterfly.yml</code>，增加以下代码到 <code>inject.bottom</code> 配置项。</p></li></ol><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">script</span> <span class="attr">defer</span> <span class="attr">type</span>=<span class="string">&quot;text/javascript&quot;</span> <span class="attr">src</span>=<span class="string">&quot;/js/modify.js&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br></pre></td></tr></table></figure><ol start="3"><li>修改完成后，配置类似如下。</li></ol><figure class="highlight yaml"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment"># Inject</span></span><br><span class="line"><span class="comment"># Insert the code to head (before &#x27;&lt;/head&gt;&#x27; tag) and the bottom (before &#x27;&lt;/body&gt;&#x27; tag)</span></span><br><span class="line"><span class="comment"># 插入代码到头部 &lt;/head&gt; 之前 和 底部 &lt;/body&gt; 之前</span></span><br><span class="line"><span class="attr">inject:</span></span><br><span class="line">  <span class="attr">head:</span></span><br><span class="line">    <span class="comment"># - &lt;link rel=&quot;stylesheet&quot; href=&quot;/xxx.css&quot;&gt;</span></span><br><span class="line">  <span class="attr">bottom:</span></span><br><span class="line">    <span class="bullet">-</span> <span class="string">&lt;script</span> <span class="string">defer</span> <span class="string">type=&quot;text/javascript&quot;</span> <span class="string">src=&quot;/js/modify.js&quot;&gt;&lt;/script&gt;</span></span><br></pre></td></tr></table></figure></div></div><div class="tab-to-top"><button type="button" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div></div>]]></content>
    
    
      
      
    <summary type="html">&lt;h2 id=&quot;描述&quot;&gt;&lt;a href=&quot;#描述&quot; class=&quot;headerlink&quot; title=&quot;描述&quot;&gt;&lt;/a&gt;描述&lt;/h2&gt;&lt;p&gt;如果你的网站同时配置了 &lt;a href=&quot;https://github.com/MoOx/pjax&quot;&gt;Pjax&lt;/a&gt; 与 &lt;a href=</summary>
      
    
    
    
    <category term="网站技术" scheme="https://android99.com/categories/%E7%BD%91%E7%AB%99%E6%8A%80%E6%9C%AF/"/>
    
    
    <category term="Pjax" scheme="https://android99.com/tags/Pjax/"/>
    
    <category term="PWA" scheme="https://android99.com/tags/PWA/"/>
    
    <category term="workbox-build" scheme="https://android99.com/tags/workbox-build/"/>
    
    <category term="sw-precache" scheme="https://android99.com/tags/sw-precache/"/>
    
    <category term="hexo-offline" scheme="https://android99.com/tags/hexo-offline/"/>
    
  </entry>
  
  <entry>
    <title>博客迁移至 Hexo，并更名为矩阵。</title>
    <link href="https://android99.com/p/hello-hexo/"/>
    <id>https://android99.com/p/hello-hexo/</id>
    <published>2020-11-18T10:28:45.000Z</published>
    <updated>2020-11-18T10:28:45.000Z</updated>
    
    <content type="html"><![CDATA[<h2 id="起始"><a href="#起始" class="headerlink" title="起始"></a>起始</h2><p>前不久帮 <a href="https://icemoe.moe/" title="无限殿堂">@冷筱华</a> 搭了个博客。<br>感觉我推荐的这个域名挺好的。<br>冷筱华，别名冷萌萌，<code>icemoe.moe</code> 正好完美表达这个意思。<br><img src="/p/hello-hexo/%E6%97%A0%E9%99%90%E6%AE%BF%E5%A0%82.jpg" alt="无限殿堂"></p><p>然后觉得还是有个博客比较好。<br>所以我打算将时隔一年多的博客复活。</p><h2 id="计划"><a href="#计划" class="headerlink" title="计划"></a>计划</h2><p>动态网站有些麻烦，还得挑选服务器。<br>我想用静态网站白嫖 <a href="https://pages.github.com/" title="Github Pages 介绍">Github Pages</a>。</p><p><a href="https://pages.github.com/" title="Github Pages 介绍">Github Pages</a> 原生支持 <a href="https://jekyllrb.com/" title="Jekyll 官网">Jekyll</a>。<br>但没找到合适的主题，而我又不想用跟冷萌萌一样主题，那不就”撞衫”了。</p><p>然后发现了 <a href="https://butterfly.js.org/" title="Butterfly 文档">Butterfly</a> 这个主题，觉得挺好看。<br>但这并不是 <a href="https://jekyllrb.com/" title="Jekyll 官网">Jekyll</a> 的主题，而是 <a href="https://hexo.io/" title="Hexo 官网">Hexo</a> 的主题。<br><img src="https://cdn.jsdelivr.net/gh/jerryc127/CDN@m2/img/theme-butterfly-readme.png" alt="Butterfly 效果图"></p><p><a href="https://hexo.io/" title="Hexo 官网">Hexo</a> 和 <a href="https://jekyllrb.com/" title="Jekyll 官网">Jekyll</a> 类似，不过 <a href="https://pages.github.com/" title="Github Pages 介绍">Github Pages</a> 不自带。<br>同样是编译出静态页面，然后再将静态页面上传至网站使用。<br>现在有了 <a href="https://github.com/features/actions" title="Github Actions 介绍">Github Actions</a>，可以通过配置实现自动在线部署。<br>之后就能像 <a href="https://jekyllrb.com/" title="Jekyll 官网">Jekyll</a> 一样使用。</p><h2 id="实行"><a href="#实行" class="headerlink" title="实行"></a>实行</h2><h3 id="主题"><a href="#主题" class="headerlink" title="主题"></a>主题</h3><p><a href="https://butterfly.js.org/" title="Butterfly 文档">Butterfly</a> 提供了相当丰富的配置选项，大部分内容都可以通过修改配置文件来达成。</p><p>不过选项虽然丰富，但也不一定能满足所有需求。<br>比如我想改成一图流背景，并且将首页以外的顶部图移到标题下方显示。<br><img src="/p/hello-hexo/%E9%A1%B6%E9%83%A8%E5%9B%BE.jpg" alt="顶部图"><br>这就需要用到传统艺能——魔改。<br>我不打算修改主题源文件，因为升级主题时会很麻烦。</p><p><a href="https://hexo.io/" title="Hexo 官网">Hexo</a> 提供了插件系统，插件有两种形式，分别是 脚本 (Scripts) 和 包 (Packages)。<br>我使用脚本来实现，把写好的脚本放到根目录的 <code>scripts</code> 文件夹，<a href="https://hexo.io/" title="Hexo 官网">Hexo</a> 运行时会自动加载。<br>在插件中注册 <code>after_render:html</code> 过滤器，就可以在渲染页面后，解析并插入新顶部图。<br>再配合定义页面 样式 (Stylus)，在主题配置引入，即可达成目的。</p><h3 id="内容"><a href="#内容" class="headerlink" title="内容"></a>内容</h3><p>博客一开始是用的 <a href="https://jekyllrb.com/" title="Jekyll 官网">Jekyll</a>，后来换成 <a href="http://typecho.org/" title="Typecho 官网">Typecho</a>，现在又换成 <a href="https://hexo.io/" title="Hexo 官网">Hexo</a>。<br>迁移文章比较方便，因为都是用 Markdown 来写内容的，转过来修饰一下就好了。</p><p>迁移评论就比较麻烦了，我现在用的评论系统叫 <a href="https://twikoo.js.org/" title="Twikoo 文档">Twikoo</a>。<br>之前用的 <a href="http://typecho.org/" title="Typecho 官网">Typecho</a> 是动态网站，评论都储存在自己的数据库中。<br>所以我花了点时间，做了个工具读取数据库，生成可以导入 <a href="https://twikoo.js.org/" title="Twikoo 文档">Twikoo</a> 的数据文件。<br>大功告成，评论也完美迁移到博客了。</p><h2 id="上线"><a href="#上线" class="headerlink" title="上线"></a>上线</h2><p>你看到这篇文章，就代表博客已经正式上线了。<br>之前博客没有名字，都是叫”Android 的博客”。<br>现在博客有了个新名字 —— 矩阵！<br><img src="/p/hello-hexo/%E7%9F%A9%E9%98%B5.jpg" alt="矩阵"></p>]]></content>
    
    
    <summary type="html">前不久帮 @冷筱华 搭了个博客。&lt;br&gt;然后觉得还是有个博客比较好。&lt;br&gt;所以我打算将时隔一年多的博客复活。</summary>
    
    
    
    <category term="日常" scheme="https://android99.com/categories/%E6%97%A5%E5%B8%B8/"/>
    
    
    <category term="博客" scheme="https://android99.com/tags/%E5%8D%9A%E5%AE%A2/"/>
    
  </entry>
  
  <entry>
    <title>Handsome 主题神代綺凜式魔改折腾记录</title>
    <link href="https://android99.com/p/jindaikirin-style-handsome-modified/"/>
    <id>https://android99.com/p/jindaikirin-style-handsome-modified/</id>
    <published>2019-05-31T16:00:00.000Z</published>
    <updated>2019-08-17T19:33:32.000Z</updated>
    
    <content type="html"><![CDATA[<div class="note info flat"><p>本文基于 Handsome v5.2.0 Pro 撰写</p><ul><li>handsome.css 版本 v1.6.4</li><li>handsome.js 版本 v1.6.0</li><li>github.md.mod.css 版本 v1.4.0</li></ul></div><hr><p>翻 Handsome 说明书的时候，偶然看到了这篇教程。<br><a href="https://www.sukeycz.com/course/mod-jk">「神代綺凜式魔改出现的相关问题解决附魔改教程」</a><br>就觉得这个好棒，于是乎就尝试魔改一下。<br>过程中遇到几个坑，所以在这里完整记录一下，避免自己以后忘记。</p><p>最终效果参考，也就是魔改作者大佬的博客。<br><a href="https://moe.best/">「神代綺凜の随波逐流」</a></p><h2 id="魔改步骤"><a href="#魔改步骤" class="headerlink" title="魔改步骤"></a>魔改步骤</h2><h3 id="放置样式"><a href="#放置样式" class="headerlink" title="放置样式"></a>放置样式</h3><p>将下载的自定义样式文件放在 <code>/usr/themes/handsome/assets/css</code>，命名为 <code>handsome.css</code>。</p><div class="tabs"><div class="nav-tabs"><button type="button" class="tab active">来自大佬博客 (推荐)</button><button type="button" class="tab">来自备份</button></div><div class="tab-contents"><div class="tab-item-content active"><p>由于设置了防盗链，请复制粘贴访问。</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">https://moe.best/usr/themes/handsome/assets/css/handsome.css?v=1.6.4</span><br></pre></td></tr></table></figure></div><div class="tab-item-content"><p>撰写教程时的备份，可能不是最新的。<br><a class="btn-beautify " href="/p/jindaikirin-style-handsome-modified/%E7%A5%9E%E4%BB%A3%E7%B6%BA%E5%87%9C%E5%BC%8F%E9%AD%94%E6%94%B9%E5%A4%87%E4%BB%BD.zip" title="神代綺凜式魔改备份.zip"><i class="far fa-file-archive"></i><span>神代綺凜式魔改备份.zip</span></a></p></div></div><div class="tab-to-top"><button type="button" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div></div><h3 id="放置脚本"><a href="#放置脚本" class="headerlink" title="放置脚本"></a>放置脚本</h3><p>将下载的自定义脚本文件放在 <code>/usr/themes/handsome/assets/js</code>，命名为 <code>handsome.js</code>。</p><div class="tabs"><div class="nav-tabs"><button type="button" class="tab active">来自大佬博客 (推荐)</button><button type="button" class="tab">来自备份</button></div><div class="tab-contents"><div class="tab-item-content active"><p>由于设置了防盗链，请复制粘贴访问。</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">https://moe.best/usr/themes/handsome/assets/js/handsome.js?v=1.6.0</span><br></pre></td></tr></table></figure></div><div class="tab-item-content"><p>撰写教程时的备份，可能不是最新的。<br><a class="btn-beautify " href="/p/jindaikirin-style-handsome-modified/%E7%A5%9E%E4%BB%A3%E7%B6%BA%E5%87%9C%E5%BC%8F%E9%AD%94%E6%94%B9%E5%A4%87%E4%BB%BD.zip" title="神代綺凜式魔改备份.zip"><i class="far fa-file-archive"></i><span>神代綺凜式魔改备份.zip</span></a></p></div></div><div class="tab-to-top"><button type="button" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div></div><h3 id="载入样式"><a href="#载入样式" class="headerlink" title="载入样式"></a>载入样式</h3><p>打开 <code>/usr/themes/handsome/component/header.php</code>，找到注释 <code>&lt;!--本地css静态资源--&gt;</code>。<br>在以下位置增加</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">link</span> <span class="attr">rel</span>=<span class="string">&quot;stylesheet&quot;</span> <span class="attr">href</span>=<span class="string">&quot;&lt;?php echo STATIC_PATH; ?&gt;css/handsome.css?v=1.6.4&quot;</span> <span class="attr">type</span>=<span class="string">&quot;text/css&quot;</span> /&gt;</span></span><br></pre></td></tr></table></figure><h3 id="载入脚本"><a href="#载入脚本" class="headerlink" title="载入脚本"></a>载入脚本</h3><p>打开 <code>/usr/themes/handsome/component/footer.php</code>，找到注释 <code>&lt;!--主题核心js--&gt;</code>。<br>在以下位置增加</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">script</span> <span class="attr">type</span>=<span class="string">&quot;text/javascript&quot;</span> <span class="attr">src</span>=<span class="string">&quot;&lt;?php echo STATIC_PATH ?&gt;js/handsome.js?v=1.6.0&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br></pre></td></tr></table></figure><p>打开 Handsome 主题的 <code>设置外观</code> 菜单，在 <code>开发者设置</code> &gt; <code>自定义输出body 尾部的HTML代码</code> 增加以下内容。</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">script</span> <span class="attr">type</span>=<span class="string">&quot;text/javascript&quot;</span> <span class="attr">src</span>=<span class="string">&quot;https://cdn.bootcss.com/clipboard.js/2.0.4/clipboard.min.js&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">script</span>&gt;</span></span><br></pre></td></tr></table></figure><p>在 <code>PJAX</code> &gt; <code>PJAX回调函数</code> 增加以下内容。</p><figure class="highlight javascript"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="title function_">needpjax</span>();</span><br></pre></td></tr></table></figure><h3 id="关闭主题盒子模型"><a href="#关闭主题盒子模型" class="headerlink" title="关闭主题盒子模型"></a>关闭主题盒子模型</h3><p>打开 Handsome 主题的 <code>设置外观</code> 菜单，在 <code>外观设置</code> &gt; <code>外观设置开关</code> 找到 <code>盒子模型</code>，取消勾选该项。</p><h3 id="增加背景图嵌入点"><a href="#增加背景图嵌入点" class="headerlink" title="增加背景图嵌入点"></a>增加背景图嵌入点</h3><p>打开 <code>/usr/themes/handsome/component/headnav.php</code>，在第二行增加 <code>&lt;div id=&quot;bg&quot;&gt;&lt;/div&gt;</code>。</p><h3 id="设置背景图"><a href="#设置背景图" class="headerlink" title="设置背景图"></a>设置背景图</h3><p>打开 <code>/usr/themes/handsome/assets/css/handsome.css</code>，在16行搜索 <code>img/bg</code>。<br><code>bg1.jpg</code> 为 PC 页面背景图。<br><code>bg2.jpg</code> 为手机页面背景图。<br>替换为想设置背景图的路径即可。</p><h3 id="注明魔改主题的作者信息"><a href="#注明魔改主题的作者信息" class="headerlink" title="注明魔改主题的作者信息"></a>注明魔改主题的作者信息</h3><p>打开 Handsome 主题的 <code>设置外观</code> 菜单，在 <code>开发者设置</code> &gt; <code>博客底部右侧信息</code> 增加以下内容。</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Theme modified by <span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;https://moe.best&quot;</span> <span class="attr">target</span>=<span class="string">&quot;_blank&quot;</span>&gt;</span>Jindai Kirin<span class="tag">&lt;/<span class="name">a</span>&gt;</span><span class="symbol">&amp;nbsp;</span>|<span class="symbol">&amp;nbsp;</span></span><br></pre></td></tr></table></figure><h3 id="魔改成功"><a href="#魔改成功" class="headerlink" title="魔改成功"></a>魔改成功</h3><p>至此已成功加载魔改，之后的内容 <strong>并非必须</strong> 要做。<br>如果出现相关问题，可参照下方内容。</p><h2 id="小问题"><a href="#小问题" class="headerlink" title="小问题"></a>小问题</h2><h3 id="右侧边栏不透明"><a href="#右侧边栏不透明" class="headerlink" title="右侧边栏不透明"></a>右侧边栏不透明</h3><p>打开 <code>/usr/themes/handsome/component/sidebar.php</code>，找到</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">aside</span> <span class="attr">class</span>=<span class="string">&quot;asideBar col w-md bg-white-only b-l bg-auto no-border-xs&quot;</span> <span class="attr">role</span>=<span class="string">&quot;complementary&quot;</span>&gt;</span></span><br></pre></td></tr></table></figure><p>修改为</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">aside</span> <span class="attr">class</span>=<span class="string">&quot;asideBar col w-md bg-white-only b-l no-border-xs&quot;</span> <span class="attr">role</span>=<span class="string">&quot;complementary&quot;</span>&gt;</span></span><br></pre></td></tr></table></figure><h3 id="文章无法点击图片进入"><a href="#文章无法点击图片进入" class="headerlink" title="文章无法点击图片进入"></a>文章无法点击图片进入</h3><p>打开 <code>/usr/themes/handsome/libs/Content.php</code>，找到注释 <code>&lt;!--text-muted--&gt;</code>。<br>在下方增加一行</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">a</span> <span class="attr">href</span>=<span class="string">&quot;&#123;$parameterArray[&#x27;linkUrl&#x27;]&#125;&quot;</span> <span class="attr">class</span>=<span class="string">&quot;ahover&quot;</span>&gt;</span><span class="tag">&lt;/<span class="name">a</span>&gt;</span></span><br></pre></td></tr></table></figure><h3 id="主页两篇文章均为小头图时，仍然无法并行显示"><a href="#主页两篇文章均为小头图时，仍然无法并行显示" class="headerlink" title="主页两篇文章均为小头图时，仍然无法并行显示"></a>主页两篇文章均为小头图时，仍然无法并行显示</h3><p>打开 <code>/usr/themes/handsome/libs/Content.php</code>，找到注释 <code>&lt;!--panel/panel-small--&gt;</code>。<br>删除 <code>&lt;!--panel/panel-small--&gt;</code> 与其下方 <code>EOF;</code> 之间的空行。<br><em>这个琢磨了很久，没想到居然只是因为一个空行。</em></p><h3 id="在文章页面向下滚动时，目录会被隐藏的问题"><a href="#在文章页面向下滚动时，目录会被隐藏的问题" class="headerlink" title="在文章页面向下滚动时，目录会被隐藏的问题"></a>在文章页面向下滚动时，目录会被隐藏的问题</h3><p>打开 <code>/usr/themes/handsome/assets/js/handsome.js</code>，搜索 <code>#sidebar</code>。<br>将 <code>var a=$(&quot;#sidebar&quot;).children();</code> 修改为 <code>var a=$(&quot;#sidebar&quot;).find(&quot;section&quot;);</code>。</p><h3 id="小头图的顶置文章在小屏状态下，图片下方有一条白边"><a href="#小头图的顶置文章在小屏状态下，图片下方有一条白边" class="headerlink" title="小头图的顶置文章在小屏状态下，图片下方有一条白边"></a>小头图的顶置文章在小屏状态下，图片下方有一条白边</h3><p>打开 Handsome 主题的 <code>设置外观</code> 菜单，在 <code>开发者设置</code> &gt; <code>自定义 CSS</code> 增加以下内容。</p><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-class">.panel-small</span>&gt;<span class="selector-class">.post-meta</span> &#123;</span><br><span class="line">    <span class="attribute">padding-bottom</span>: <span class="number">0</span> <span class="meta">!important</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><h3 id="在阅读模式下收缩框的内容显示不正常"><a href="#在阅读模式下收缩框的内容显示不正常" class="headerlink" title="在阅读模式下收缩框的内容显示不正常"></a>在阅读模式下收缩框的内容显示不正常</h3><p>打开 Handsome 主题的 <code>设置外观</code> 菜单，在 <code>开发者设置</code> &gt; <code>自定义 CSS</code> 增加以下内容。</p><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-class">.panel-body</span><span class="selector-class">.collapse</span><span class="selector-pseudo">:not</span>(<span class="selector-attr">[aria-expanded=true]</span>) &#123;</span><br><span class="line">    <span class="attribute">display</span>: none <span class="meta">!important</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><h2 id="「番外篇」Markdown-与代码块样式魔改"><a href="#「番外篇」Markdown-与代码块样式魔改" class="headerlink" title="「番外篇」Markdown 与代码块样式魔改"></a>「番外篇」Markdown 与代码块样式魔改</h2><p><a href="https://moe.best/modification/github-css.html">「Github Markdown Style for Handsome」</a> 参考这篇文章。<br>最终效果可参照 <a href="https://moe.best/">「神代綺凜の随波逐流」</a>。</p><h3 id="放置样式-1"><a href="#放置样式-1" class="headerlink" title="放置样式"></a>放置样式</h3><p>获取包含代码块的样式文件，放置于 <code>/usr/themes/handsome/assets/css</code>，文件名为 <code>github.md.mod.css</code>。<br>代码块效果需要配合之前的 <code>handsome.js</code> 才能正常使用。</p><div class="tabs"><div class="nav-tabs"><button type="button" class="tab active">来自大佬博客 (推荐)</button><button type="button" class="tab">来自备份</button></div><div class="tab-contents"><div class="tab-item-content active"><p>由于设置了防盗链，请复制粘贴访问。</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">https://moe.best/usr/themes/handsome/assets/css/github.md.mod.css?v=1.4.0</span><br></pre></td></tr></table></figure></div><div class="tab-item-content"><p>撰写教程时的备份，可能不是最新的。<br><a class="btn-beautify " href="/p/jindaikirin-style-handsome-modified/%E7%A5%9E%E4%BB%A3%E7%B6%BA%E5%87%9C%E5%BC%8F%E9%AD%94%E6%94%B9%E5%A4%87%E4%BB%BD.zip" title="神代綺凜式魔改备份.zip"><i class="far fa-file-archive"></i><span>神代綺凜式魔改备份.zip</span></a></p></div></div><div class="tab-to-top"><button type="button" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div></div><h3 id="载入样式-1"><a href="#载入样式-1" class="headerlink" title="载入样式"></a>载入样式</h3><p>打开 <code>/usr/themes/handsome/component/header.php</code>，找到注释 <code>&lt;!--本地css静态资源--&gt;</code>。<br>在以下位置增加</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">link</span> <span class="attr">rel</span>=<span class="string">&quot;stylesheet&quot;</span> <span class="attr">href</span>=<span class="string">&quot;&lt;?php echo STATIC_PATH; ?&gt;css/github.md.mod.css?v=1.4.0&quot;</span> <span class="attr">type</span>=<span class="string">&quot;text/css&quot;</span> /&gt;</span></span><br></pre></td></tr></table></figure><p>打开 <code>/usr/themes/handsome</code> 目录下的 <code>post.php</code> 与 <code>page.php</code>。找到</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">div</span> <span class="attr">id</span>=<span class="string">&quot;post-content&quot;</span> <span class="attr">class</span>=<span class="string">&quot;wrapper-lg&quot;</span>&gt;</span></span><br><span class="line"> <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;entry-content l-h-2x&quot;</span>&gt;</span></span><br></pre></td></tr></table></figure><p>修改为</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;wrapper-lg&quot;</span>&gt;</span></span><br><span class="line"> <span class="tag">&lt;<span class="name">div</span> <span class="attr">class</span>=<span class="string">&quot;markdown-body entry-content l-h-2x&quot;</span>&gt;</span></span><br></pre></td></tr></table></figure><p>打开 <code>/usr/themes/handsome/libs/Content.php</code>。找到</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">div</span> <span class="attr">id</span>=<span class="string">&quot;morphing-content&quot;</span> <span class="attr">class</span>=<span class="string">&quot;hidden read_mode_article&quot;</span>&gt;</span></span><br></pre></td></tr></table></figure><p>修改为</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">div</span> <span class="attr">id</span>=<span class="string">&quot;morphing-content&quot;</span> <span class="attr">class</span>=<span class="string">&quot;markdown-body hidden read_mode_article&quot;</span>&gt;</span></span><br></pre></td></tr></table></figure><p>打开 <code>/usr/themes/handsome/assets/js/core.min.js</code>。<br>将所有 <code>#post-content</code> 替换为 <code>.markdown-body</code>。</p><p>至此完成魔改。</p><h3 id="在评论中使用样式"><a href="#在评论中使用样式" class="headerlink" title="在评论中使用样式"></a>在评论中使用样式</h3><p>打开 <code>/usr/themes/handsome/component/comments.php</code>。找到</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">span</span> <span class="attr">class</span>=<span class="string">&quot;comment-content-true&quot;</span>&gt;</span></span><br></pre></td></tr></table></figure><p>修改为</p><figure class="highlight html"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line"><span class="tag">&lt;<span class="name">span</span> <span class="attr">class</span>=<span class="string">&quot;markdown-body comment-content-true&quot;</span>&gt;</span></span><br></pre></td></tr></table></figure><p>打开 Handsome 主题的 <code>设置外观</code> 菜单，在 <code>开发者设置</code> &gt; <code>自定义 CSS</code> 增加以下内容。</p><figure class="highlight css"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="selector-class">.markdown-body</span><span class="selector-class">.comment-content-true</span> &#123;</span><br><span class="line">    <span class="attribute">line-height</span>: <span class="number">1.5</span> <span class="meta">!important</span>;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure><p>即可在评论中也使用这个样式。</p><hr><div class="note primary flat"><p><strong>涉及文件列表：</strong><br>&#x2F;usr&#x2F;themes&#x2F;handsome&#x2F;assets&#x2F;css&#x2F;handsome.css<br>&#x2F;usr&#x2F;themes&#x2F;handsome&#x2F;assets&#x2F;js&#x2F;handsome.js<br>&#x2F;usr&#x2F;themes&#x2F;handsome&#x2F;component&#x2F;header.php<br>&#x2F;usr&#x2F;themes&#x2F;handsome&#x2F;component&#x2F;footer.php<br>&#x2F;usr&#x2F;themes&#x2F;handsome&#x2F;component&#x2F;headnav.php<br>&#x2F;usr&#x2F;themes&#x2F;handsome&#x2F;component&#x2F;sidebar.php<br>&#x2F;usr&#x2F;themes&#x2F;handsome&#x2F;libs&#x2F;Content.php</p><p>&#x2F;usr&#x2F;themes&#x2F;handsome&#x2F;assets&#x2F;css&#x2F;github.md.mod.css<br>&#x2F;usr&#x2F;themes&#x2F;handsome&#x2F;post.php<br>&#x2F;usr&#x2F;themes&#x2F;handsome&#x2F;page.php<br>&#x2F;usr&#x2F;themes&#x2F;handsome&#x2F;assets&#x2F;js&#x2F;core.min.js<br>&#x2F;usr&#x2F;themes&#x2F;handsome&#x2F;component&#x2F;comments.php</p></div>]]></content>
    
    
      
      
    <summary type="html">&lt;div class=&quot;note info flat&quot;&gt;&lt;p&gt;本文基于 Handsome v5.2.0 Pro 撰写&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;handsome.css 版本 v1.6.4&lt;/li&gt;
&lt;li&gt;handsome.js 版本 v1.6.0&lt;/li&gt;
&lt;li&gt;githu</summary>
      
    
    
    
    <category term="网站技术" scheme="https://android99.com/categories/%E7%BD%91%E7%AB%99%E6%8A%80%E6%9C%AF/"/>
    
    <category term="Handsome" scheme="https://android99.com/categories/%E7%BD%91%E7%AB%99%E6%8A%80%E6%9C%AF/Handsome/"/>
    
    
    <category term="Handsome" scheme="https://android99.com/tags/Handsome/"/>
    
    <category term="Typecho" scheme="https://android99.com/tags/Typecho/"/>
    
  </entry>
  
  <entry>
    <title>救命！3ds Max 一撤销就崩溃。</title>
    <link href="https://android99.com/p/3dsmax-virus-crashes-on-undo/"/>
    <id>https://android99.com/p/3dsmax-virus-crashes-on-undo/</id>
    <published>2019-04-12T13:00:00.000Z</published>
    <updated>2019-04-12T13:00:00.000Z</updated>
    
    <content type="html"><![CDATA[<h2 id="描述"><a href="#描述" class="headerlink" title="描述"></a>描述</h2><p>今天上课做模型，发现一旦撤销，3ds Max 就会直接崩溃。</p><p>啊这…… 做模型哪有不撤销的。</p><p>难道是 3ds Max 这个版本有问题，可之前还能用。</p><p>于是查了一下，3ds Max 居然还能有病毒的。</p><p>平时不运行奇怪软件的我竟然也中招了。</p><p><del>老师我真的不是在摸鱼，软件中了病毒做不了呀。</del></p><p>这个病毒会存在于场景文件。当你打开感染病毒的场景时，会在脚本加载目录创建病毒脚本，并设置 <code>系统 + 隐藏</code> 文件属性。</p><p>病毒将会导致撤回时崩溃，自动删除摄像机、灯光、材质，以及感染每一个打开的场景。</p><p>感染之后还会强制保存，就算关闭场景时选择不保存也依然会保存，以便将病毒感染。</p><p>这简直就是”3ds Max 大师级一命难度”。</p><blockquote><p>[打开场景]<br>“这样子做试试。”<br>“失误了。”<br>(既然撤销会崩溃，那就直接关闭场景不保存吧，真是机智如我。)<br>( [文件已保存] )<br>[再次打开场景]<br>“什么！我不是没保存吗，我的模型——“</p></blockquote><p>而且场景会多两个空白的对象，但是删不掉。</p><p><img src="/p/3dsmax-virus-crashes-on-undo/%E5%9C%BA%E6%99%AF%E8%B5%84%E6%BA%90%E7%AE%A1%E7%90%86%E5%99%A8.png" alt="场景资源管理器"></p><h2 id="解决方法"><a href="#解决方法" class="headerlink" title="解决方法"></a>解决方法</h2><p>我中的病毒是 vrdemat 系列。</p><p>Autodesk 官方接到反馈后，制作了杀毒脚本。感谢 <a href="https://forums.autodesk.com/t5/user/viewprofilepage/user-id/956557" title="关于 Tony Su">@Tony Su</a> 。</p><p>官方论坛：<a href="https://forums.autodesk.com/t5/maya-3ds-max-zong-he-tao-lun-qu/guan-yu-zui-jin-chu-xian-de-bing-du-lin-shi-jie-jue-fang-an/td-p/7297624" title="关于最近出现的病毒，临时解决方案。">关于最近出现的病毒，临时解决方案。</a></p><p>下载<a class="btn-beautify " href="/p/3dsmax-virus-crashes-on-undo/ALC_CRP_fixup.zip" title="ALC_CRP_fixup.zip"><i class="far fa-file-archive"></i><span>ALC_CRP_fixup.zip</span></a>。</p><p>解压 <code>ALC_fixup.ms</code> 和 <code>CRP_fixup.ms</code> 到 <code>&lt;3ds Max安装目录&gt;\scripts\Startup</code> 文件夹下。</p><p>重新打开 3ds Max，会提示发现病毒脚本，选择 <code>是</code> 清除文件。</p><p><img src="/p/3dsmax-virus-crashes-on-undo/%E5%8F%91%E7%8E%B0%E7%97%85%E6%AF%92%E8%84%9A%E6%9C%AC.png" alt="发现病毒脚本"></p><p>这样，3ds Max 的病毒就被清除了。</p><p>但如果感染病毒前，曾经打开过场景文件，这些文件也会被感染病毒。</p><p>在安装杀毒脚本的情况下，重新打开这些文件。脚本会提示发现病毒节点，选择 <code>是</code> 清除节点。</p><p><img src="/p/3dsmax-virus-crashes-on-undo/%E5%8F%91%E7%8E%B0%E7%97%85%E6%AF%92%E8%8A%82%E7%82%B9.png" alt="发现病毒节点"></p><p><strong>不过注意，这只是暂时从内存中清除了病毒。原文件依然被感染了病毒，需要再次 <code>保存</code> 或者 <code>另存为</code>。</strong></p><p>同时也小心不要把感染病毒的场景文件发给别人，毕竟这个病毒脚本实在太丧心病狂了。</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h2 id=&quot;描述&quot;&gt;&lt;a href=&quot;#描述&quot; class=&quot;headerlink&quot; title=&quot;描述&quot;&gt;&lt;/a&gt;描述&lt;/h2&gt;&lt;p&gt;今天上课做模型，发现一旦撤销，3ds Max 就会直接崩溃。&lt;/p&gt;
&lt;p&gt;啊这…… 做模型哪有不撤销的。&lt;/p&gt;
&lt;p&gt;难道是 3ds M</summary>
      
    
    
    
    <category term="软件" scheme="https://android99.com/categories/%E8%BD%AF%E4%BB%B6/"/>
    
    <category term="3ds Max" scheme="https://android99.com/categories/%E8%BD%AF%E4%BB%B6/3ds-Max/"/>
    
    
    <category term="3ds Max" scheme="https://android99.com/tags/3ds-Max/"/>
    
  </entry>
  
  <entry>
    <title>关于退出 Maya，报错&quot;确认退出&quot;或&quot;文件保存&quot;对话框被隐藏的解决办法。</title>
    <link href="https://android99.com/p/maya-error-dialog-is-hidden/"/>
    <id>https://android99.com/p/maya-error-dialog-is-hidden/</id>
    <published>2019-03-27T14:00:00.000Z</published>
    <updated>2019-03-27T14:00:00.000Z</updated>
    
    <content type="html"><![CDATA[<h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h2><p>差不多一年半没更新博客了，一直想找个机会写点东西，现在终于有个内容能写了。</p><p>我之前给同学发了个 Maya 安装包。</p><p>他在退出 Maya，询问是否保存的时候，软件直接报错崩溃了。</p><p>但是我自己就没有这个问题。</p><p>不过后来帮同学在电脑上装好 Maya，测试时也出现了这个问题。</p><h2 id="症状"><a href="#症状" class="headerlink" title="症状"></a>症状</h2><p><strong>软件：</strong> Autodesk Maya 2014</p><p><strong>系统：</strong> Windows 10 Version 1803</p><p>Maya 大部分功能正常，但退出软件询问是否保存时，报错崩溃。</p><p>报错信息为 <code>&quot;确认退出&quot;或&quot;文件保存&quot;对话框被隐藏</code>。</p><p><img src="/p/maya-error-dialog-is-hidden/Maya_%E9%94%99%E8%AF%AF%E4%BF%A1%E6%81%AF.png" alt="Maya 错误信息"></p><h2 id="分析"><a href="#分析" class="headerlink" title="分析"></a>分析</h2><p>首先网上查了一下，回答是检查 Maya 版本是 32位 的还是 64位 的，要与系统相匹配，以及软件安装路径是否包含中文。</p><p>检查了一下，系统是 64位 的，Maya 也是安装的 64位。安装路径也不包含中文。</p><p><img src="/p/maya-error-dialog-is-hidden/%E7%B3%BB%E7%BB%9F%E7%89%88%E6%9C%AC.png" alt="系统版本"></p><p><img src="/p/maya-error-dialog-is-hidden/Maya_%E7%89%88%E6%9C%AC.png" alt="Maya 版本"></p><p><img src="/p/maya-error-dialog-is-hidden/%E5%AE%89%E8%A3%85%E8%B7%AF%E5%BE%84.png" alt="安装路径"></p><p>这就很奇怪了，于是想能不能看看日志之类的东西，也许可以看出什么原因。</p><p>在 Maya 的脚本编辑器里可以看到软件的输出信息。</p><p>尝试复现问题，发现输出信息里有个包含中文的路径。</p><p><img src="/p/maya-error-dialog-is-hidden/%E8%84%9A%E6%9C%AC%E7%BC%96%E8%BE%91%E5%99%A8.png" alt="脚本编辑器"></p><p>这个路径是系统的用户目录，Maya 的配置文件就保存在 <code>Documents (文档)</code> 的 <code>maya</code> 文件夹里。</p><p>那么很有可能就是因为这个，要解决问题就得把用户目录改成英文的。</p><h2 id="修复"><a href="#修复" class="headerlink" title="修复"></a>修复</h2><p>想要直接给用户目录改名是改不了的，所以只能用另寻它法。</p><p>首先 <strong>以管理员权限</strong> 打开命令提示符，运行命令启用内置管理员用户</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">NET USER Administrator /ACTIVE:YES</span><br></pre></td></tr></table></figure><p>提示 <code>命令成功完成</code>。</p><p><img src="/p/maya-error-dialog-is-hidden/%E5%91%BD%E4%BB%A4%E6%8F%90%E7%A4%BA%E7%AC%A6.png" alt="命令提示符"></p><p>注销当前用户，登陆到 <code>Administrator</code>，期间可能会初始化用户配置，稍等片刻即可。</p><p>打开系统盘下的 <code>用户</code> 文件夹，这时候就可以直接将自己的用户目录重命名成英文的了。</p><p><strong>如果提示已被占用可以重启电脑，然后直接登陆 <code>Administrator</code> 再试。</strong></p><p>然后按 <code>Win+R</code> 键，运行 <code>regedit</code>，打开注册表编辑器。</p><p><img src="/p/maya-error-dialog-is-hidden/%E8%BF%90%E8%A1%8C.png" alt="运行"></p><p>依次展开到 <code>HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList</code>。</p><p><code>ProfileList</code> 下的目录对应系统中的用户，目录中的 <code>ProfileImagePath</code> 值代表用户目录的路径。</p><p><img src="/p/maya-error-dialog-is-hidden/%E6%B3%A8%E5%86%8C%E8%A1%A8%E7%BC%96%E8%BE%91%E5%99%A8.png" alt="注册表编辑器"></p><p>找到对应自己用户的目录，右键 <code>ProfileImagePath</code> 点击修改，将值改成之前自己重命名后的目录。</p><p><img src="/p/maya-error-dialog-is-hidden/%E7%BC%96%E8%BE%91%E5%AD%97%E7%AC%A6%E4%B8%B2.png" alt="编辑字符串"></p><p>这样用户目录就修改完成了。</p><p>注销 <code>Administrator</code>，登陆自己的用户。</p><p>再次 <strong>以管理员权限</strong> 打开命令提示符，运行命令禁用内置管理员用户</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">NET USER Administrator /ACTIVE:NO</span><br></pre></td></tr></table></figure><p>最后检查一下环境变量、快捷方式和其他软件。</p><p>因为修改了用户目录，所以要避免还在使用失效的旧目录。</p><p><strong>现在退出 Maya 应该就不会报错崩溃了。</strong></p><h2 id="补充"><a href="#补充" class="headerlink" title="补充"></a>补充</h2><h3 id="释放用户配置占用的空间"><a href="#释放用户配置占用的空间" class="headerlink" title="释放用户配置占用的空间"></a>释放用户配置占用的空间</h3><p>由于修改用户目录的过程中，我们登陆了 <code>Administrator</code> 用户，所以会产生相关的用户配置文件。</p><p>如果你以后不再需要登陆 <code>Administrator</code> 用户，可以删除用户配置文件来节省空间。</p><p><strong>首先如果你刚刚登陆过 <code>Administrator</code> 用户，记得先注销并重启一次电脑，避免文件占用。</strong></p><p>然后右键 <code>此电脑</code> 点击 <code>属性</code> 或者打开 <code>控制面板</code> 的 <code>系统</code>。</p><p>点击左侧的 <code>高级系统设置</code>，切换到 <code>高级</code> 选项卡，再点击 <code>用户配置文件</code> 的 <code>设置</code>。</p><p><img src="/p/maya-error-dialog-is-hidden/%E7%94%A8%E6%88%B7%E9%85%8D%E7%BD%AE%E6%96%87%E4%BB%B6.png" alt="用户配置文件"></p><p>找到 <code>Administrator</code> 的配置文件，如果看不全可以拖一下 <code>名称</code> 列旁边的那条杠，点击 <code>删除</code>。</p><p>这样就删掉了用户配置文件。</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h2 id=&quot;前言&quot;&gt;&lt;a href=&quot;#前言&quot; class=&quot;headerlink&quot; title=&quot;前言&quot;&gt;&lt;/a&gt;前言&lt;/h2&gt;&lt;p&gt;差不多一年半没更新博客了，一直想找个机会写点东西，现在终于有个内容能写了。&lt;/p&gt;
&lt;p&gt;我之前给同学发了个 Maya 安装包。&lt;/p&gt;
&lt;</summary>
      
    
    
    
    <category term="软件" scheme="https://android99.com/categories/%E8%BD%AF%E4%BB%B6/"/>
    
    <category term="Maya" scheme="https://android99.com/categories/%E8%BD%AF%E4%BB%B6/Maya/"/>
    
    
    <category term="Maya" scheme="https://android99.com/tags/Maya/"/>
    
  </entry>
  
  <entry>
    <title>宝藏世界模组开发指南 —— 制作 TMod 文件</title>
    <link href="https://android99.com/p/trove-mod-make-tmod/"/>
    <id>https://android99.com/p/trove-mod-make-tmod/</id>
    <published>2017-08-12T23:21:14.000Z</published>
    <updated>2017-08-12T23:21:14.000Z</updated>
    
    <content type="html"><![CDATA[<p>TMod 文件是宝藏世界的模组文件格式，它可以将你编辑的资源打包为单个文件。<br>还可以增加作者、描述、封面、标签等信息。</p><p>相比于将多个资源文件放入对应的 <code>override</code> 文件夹来载入，TMod 文件只需要放入游戏目录的 <code>mods</code> 文件夹即可。</p><p>所以在发布你的 Mod 之前，一定要打包为 TMod 文件。<br><img src="/p/trove-mod-make-tmod/%E6%A8%A1%E7%BB%84%E5%88%97%E8%A1%A8.png" alt="模组列表"></p><h2 id="准备"><a href="#准备" class="headerlink" title="准备"></a>准备</h2><h3 id="资源文件"><a href="#资源文件" class="headerlink" title="资源文件"></a>资源文件</h3><p>在打包之前要确保你的资源文件能够通过 <a href="/p/trove-mod-make-test/" title="宝藏世界模组开发指南 —— 测试">override 文件夹</a> 载入。</p><h3 id="封面"><a href="#封面" class="headerlink" title="封面"></a>封面</h3><p>其次，要为你的模组添加一个封面，格式可以是 png、jpg 或是 blueprint。<br>图片的大小是 400 x 230，放入游戏目录的 <code>\ui\override</code> 文件夹。</p><p><em>虽然资源文件放在 <code>override</code> 文件夹下，但是实际上是载入到了 <code>override</code> 的上级目录。</em><br><em>例如有一个文件是 <code>ui\override\HelloWorld.png</code>，而它实际上被载入到了 <code>ui\HelloWorld.png</code>。</em><br><em>所以下列操作需要填写目录时，请忽略 override 文件夹进行填写。</em></p><h2 id="打包"><a href="#打包" class="headerlink" title="打包"></a>打包</h2><p>接下来，你可以通过以下方法之一来生成你的 TMod 文件。</p><p><em>进行以下操作后，可到游戏目录的 <code>mods</code> 文件夹查看生成的模组文件。</em></p><div class="tabs"><div class="nav-tabs"><button type="button" class="tab">游戏中</button><button type="button" class="tab">命令行</button><button type="button" class="tab active">命令行引用 YAML 文件 (推荐)</button></div><div class="tab-contents"><div class="tab-item-content"><p>这种方式不能精确控制打包哪些资源文件，它会打包所有通过 <code>override</code> 文件夹加载的资源文件。</p><p>在聊天窗口输入以下指令。<br><code>/buildmod title=&quot;模组名称&quot; author=&quot;作者名称&quot; notes=&quot;模组注释&quot; preview=&quot;预览图片路径&quot; tags=&quot;标签1,标签2&quot;</code></p><p>指令参数中，除了 <code>title</code> 参数必须要指定，其他参数均是可选的。</p><p>例如：<br><code>/buildmod title=&quot;你好,世界!&quot; author=&quot;Android&quot; notes=&quot;我的第一个模组。&quot; preview=&quot;ui/HelloWorld.png&quot;</code></p><p>![BuildMod 指令]<br>执行后，聊天区域会显示被打包的资源文件。<br>之后会提示指定名称的模组已创建完成。</p></div><div class="tab-item-content"><p>这种方式可以精确的指定打包哪些资源文件。<br>但是值得吐槽的是，如果你执行的命令内包含中文则会出现乱码。</p><p>在游戏目录空白处 Shift + 右键，在此处打开命令窗口。<br>输入命令行:<br><code>Trove.exe -tool buildmod -title &quot;模组名称&quot; -author &quot;作者名称&quot; -notes &quot;模组注释&quot; -preview &quot;预览图片路径&quot; -tags &quot;标签a,标签b,标签c,标签d&quot; - &lt;文件1&gt; &lt;文件2&gt;</code></p><p>指令参数中必须要包含 <code>title</code>、<code>author</code> 以及要包含的文件。<br>命令最后文件的那一部分，需要填写模组要包含的所有资源文件，包括封面。</p><p>例如:<br><code>Trove.exe -tool buildmod -title &quot;HelloWorld!&quot; -author &quot;Android&quot; -notes &quot;My first mod.&quot; -preview &quot;ui/HelloWorld.png&quot; - ui/HelloWorld.png blueprints/equipment_weapon_1h_sword_001.blueprint</code></p></div><div class="tab-item-content active"><p>这种方式可以精确的指定打包哪些资源文件，而且看起来更加易读。<br>个人强烈建议使用这种方式。</p><p>首先，我们在任意目录创建一个文本文件，将其扩展名命名为 <code>.yaml</code>。<br><em>字符编码必须为 UTF-8。</em></p><p>然后，按照以下格式编辑 YAML 文件。</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line">title: 模组名称</span><br><span class="line">author: 作者名称</span><br><span class="line">notes: 模组注释</span><br><span class="line">previewPath: 预览图片路径</span><br><span class="line">files:</span><br><span class="line">- 文件1</span><br><span class="line">- 文件2</span><br><span class="line">tags:</span><br><span class="line">- 标签1</span><br><span class="line">- 标签2</span><br><span class="line">...</span><br></pre></td></tr></table></figure><p>YAML 文件中必须要指定 <code>title</code>、<code>author</code> 以及 <code>files</code>。<br><code>files</code> 中你需要填写模组要包含的所有资源文件，包括封面。</p><p>例如:</p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">---</span><br><span class="line">title: 你好,世界!</span><br><span class="line">author: Android</span><br><span class="line">notes: 我的第一个模组。</span><br><span class="line">previewPath: ui/HelloWorld.png</span><br><span class="line">files:</span><br><span class="line">- ui/HelloWorld.png</span><br><span class="line">- blueprints/equipment_weapon_1h_sword_001.blueprint</span><br><span class="line">...</span><br></pre></td></tr></table></figure><p>然后，在游戏目录空白处 Shift + 右键，在此处打开命令窗口。<br>输入命令行:<br><code>Trove.exe -tool buildmod -meta &quot;YAML 文件路径&quot;</code></p><p>例如:<br><code>Trove.exe -tool buildmod -meta &quot;D:\TroveMod\HelloWorld\HelloWorld.yaml&quot;</code></p></div></div><div class="tab-to-top"><button type="button" aria-label="scroll to top"><i class="fas fa-arrow-up"></i></button></div></div><h2 id="验证"><a href="#验证" class="headerlink" title="验证"></a>验证</h2><p>首先打开 <code>%APPDATA%\Trove\Trove.cfg</code> 文件，找到 <code>[System]</code> (没有就添加一个)。<br>在这一节下添加新的一行 <code>UseOverrides=false</code>，以禁用通过 override 加载资源。<br>之后如果需要恢复，可以删除这一行或者将 <code>false</code> 改为 <code>true</code>。</p><p>接下来就可以将 TMod 文件放到游戏目录的 <code>mods</code> 文件夹，重启游戏验证你的 TMod 文件有无问题。<br>如果没有问题，你就可以将模组分享给其他人了。</p>]]></content>
    
    
      
      
    <summary type="html">&lt;p&gt;TMod 文件是宝藏世界的模组文件格式，它可以将你编辑的资源打包为单个文件。&lt;br&gt;还可以增加作者、描述、封面、标签等信息。&lt;/p&gt;
&lt;p&gt;相比于将多个资源文件放入对应的 &lt;code&gt;override&lt;/code&gt; 文件夹来载入，TMod 文件只需要放入游戏目录的 &lt;cod</summary>
      
    
    
    
    <category term="游戏开发" scheme="https://android99.com/categories/%E6%B8%B8%E6%88%8F%E5%BC%80%E5%8F%91/"/>
    
    <category term="宝藏世界模组开发指南" scheme="https://android99.com/categories/%E6%B8%B8%E6%88%8F%E5%BC%80%E5%8F%91/%E5%AE%9D%E8%97%8F%E4%B8%96%E7%95%8C%E6%A8%A1%E7%BB%84%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97/"/>
    
    
    <category term="Trove" scheme="https://android99.com/tags/Trove/"/>
    
    <category term="Mod" scheme="https://android99.com/tags/Mod/"/>
    
  </entry>
  
  <entry>
    <title>宝藏世界模组开发指南 —— 测试</title>
    <link href="https://android99.com/p/trove-mod-make-test/"/>
    <id>https://android99.com/p/trove-mod-make-test/</id>
    <published>2017-07-23T08:49:20.000Z</published>
    <updated>2017-07-23T08:49:20.000Z</updated>
    
    <content type="html"><![CDATA[<p>编辑好文件后，需要载入到游戏中进行测试。</p><h2 id="通过-override-文件夹载入"><a href="#通过-override-文件夹载入" class="headerlink" title="通过 override 文件夹载入"></a>通过 override 文件夹载入</h2><p>在 <a href="/p/trove-mod-make-unpack/" title="宝藏世界模组开发指南 —— 解包">解包</a> 的目标路径创建一个 <code>override</code> 文件夹，将想要加载到游戏的文件放入。<br>游戏加载时会自动将 <code>override</code> 内的文件覆盖到上级目录。</p><p>例如，<a href="/p/trove-mod-make-blueprint/" title="宝藏世界模组开发指南 —— 蓝图">蓝图</a> 文件存放在游戏目录的 <code>blueprints</code> 文件夹下。<br>则在 <code>blueprints</code> 文件夹内创建一个 <code>override</code> 文件夹，将蓝图文件放入其中。<br><code>\blueprints\override</code> 内的文件将会覆盖到 <code>\blueprints</code> 中。</p><p>重启游戏即可加载放入的文件。</p><p>如果你是覆盖已有的资源文件，那么被替换的内容就会变成你制作的内容。</p><p>如果你是新增的资源文件，你需要通过以下方法预览。</p><h2 id="预览蓝图"><a href="#预览蓝图" class="headerlink" title="预览蓝图"></a>预览蓝图</h2><p><em>以下的蓝图名字不需要带扩展名，即不需要带 <code>.blueprint</code>。</em></p><h3 id="武器"><a href="#武器" class="headerlink" title="武器"></a>武器</h3><p>在聊天框输入 <code>/weaponpreview [蓝图名字]</code> 或 <code>/wp [蓝图名字]</code>。</p><h3 id="面具"><a href="#面具" class="headerlink" title="面具"></a>面具</h3><p>在聊天框输入 <code>/facepreview [蓝图名字]</code>。</p><h3 id="帽子"><a href="#帽子" class="headerlink" title="帽子"></a>帽子</h3><p>在聊天框输入 <code>/hatpreview [蓝图名字]</code>。</p><h3 id="发型"><a href="#发型" class="headerlink" title="发型"></a>发型</h3><p>在聊天框输入 <code>/hairpreview [蓝图名字]</code>。</p><h3 id="装饰"><a href="#装饰" class="headerlink" title="装饰"></a>装饰</h3><p>先在聊天框输入 <code>/metaforge</code>，进入 Metaforge。<br>然后输入 <code>/decopreview [蓝图名字]</code>。</p>]]></content>
    
    
      
      
    <summary type="html">&lt;p&gt;编辑好文件后，需要载入到游戏中进行测试。&lt;/p&gt;
&lt;h2 id=&quot;通过-override-文件夹载入&quot;&gt;&lt;a href=&quot;#通过-override-文件夹载入&quot; class=&quot;headerlink&quot; title=&quot;通过 override 文件夹载入&quot;&gt;&lt;/a&gt;通过 over</summary>
      
    
    
    
    <category term="游戏开发" scheme="https://android99.com/categories/%E6%B8%B8%E6%88%8F%E5%BC%80%E5%8F%91/"/>
    
    <category term="宝藏世界模组开发指南" scheme="https://android99.com/categories/%E6%B8%B8%E6%88%8F%E5%BC%80%E5%8F%91/%E5%AE%9D%E8%97%8F%E4%B8%96%E7%95%8C%E6%A8%A1%E7%BB%84%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97/"/>
    
    
    <category term="Trove" scheme="https://android99.com/tags/Trove/"/>
    
    <category term="Mod" scheme="https://android99.com/tags/Mod/"/>
    
  </entry>
  
  <entry>
    <title>宝藏世界模组开发指南 —— 蓝图</title>
    <link href="https://android99.com/p/trove-mod-make-blueprint/"/>
    <id>https://android99.com/p/trove-mod-make-blueprint/</id>
    <published>2017-07-23T07:44:45.000Z</published>
    <updated>2017-07-23T07:44:45.000Z</updated>
    
    <content type="html"><![CDATA[<h2 id="蓝图文件"><a href="#蓝图文件" class="headerlink" title="蓝图文件"></a>蓝图文件</h2><p>宝藏世界大部分的模型都以蓝图格式储存，它的文件扩展名是 <code>.blueprint</code>。<br>也就是说我们想让宝藏世界读取我们的模型，就需要先转换为蓝图文件。<br>蓝图文件包含了材质信息。</p><h2 id="文件结构"><a href="#文件结构" class="headerlink" title="文件结构"></a>文件结构</h2><p>蓝图文件包含多个 Qubicle 文件。<br>Qubicle 文件的扩展名是 <code>.qb</code>。<br><img src="/p/trove-mod-make-blueprint/Qubicle_%E6%96%87%E4%BB%B6.png" alt="Qubicle 文件"></p><p>所以你得将你的模型导出为 Qubicle 文件。</p><p>每个 Qubicle 文件都有不同的作用。<br>除了原始模型以外，还有定义材质的材质贴图。</p><table><thead><tr><th align="center">文件名</th><th align="center">类型</th><th align="center">示例</th></tr></thead><tbody><tr><td align="center">类型_分类_名字.qb</td><td align="center">原始模型</td><td align="center">equipment_weapon_1h_sword_excalibur_morgan.qb</td></tr><tr><td align="center">类型_分类_名字_t.qb</td><td align="center">类型贴图</td><td align="center">equipment_weapon_1h_sword_excalibur_morgan_t.qb</td></tr><tr><td align="center">类型_分类_名字_a.qb</td><td align="center">透明贴图</td><td align="center">equipment_weapon_1h_sword_excalibur_morgan_a.qb</td></tr><tr><td align="center">类型_分类_名字_s.qb</td><td align="center">高光贴图</td><td align="center">equipment_weapon_1h_sword_excalibur_morgan_s.qb</td></tr></tbody></table><p>它们形状相同且位置重叠，但颜色不相同。<br>每个类型都有特定颜色代表其特殊含义。</p><p><em>所有模型都要包含连接点。</em><br>连接点是一个只有一格的像素点，用来在游戏中确定模型位置。</p><h2 id="原始模型"><a href="#原始模型" class="headerlink" title="原始模型"></a>原始模型</h2><p>原始模型定义了模型形状和模型颜色。<br>我们主要就是在这里做好模型，然后再到材质贴图中涂色来定义材质。</p><table style="text-align:center">  <thead>    <tr>      <th>含义</th>      <th>RGB</th>      <th>十六进制</th>      <th>颜色</th>    </tr>  </thead>  <tbody>    <tr>      <td>连接点</td>      <td>255,000,255</td>      <td>#FF00FF</td>      <td bgcolor="#FF00FF"></td>    </tr>    <tr>      <td>模型颜色</td>      <td>任意</td>      <td>任意</td>      <td>任意</td>    </tr>  </tbody></table><h2 id="类型贴图-Type"><a href="#类型贴图-Type" class="headerlink" title="类型贴图 (Type)"></a>类型贴图 (Type)</h2><p><img src="/p/trove-mod-make-blueprint/%E7%B1%BB%E5%9E%8B%E8%B4%B4%E5%9B%BE.png" alt="类型贴图"><br>按照列表顺序，除去连接点，从左到右依次排列。</p><table style="text-align:center">  <thead>    <tr>      <th>含义</th>      <th>RGB</th>      <th>十六进制</th>      <th>颜色</th>    </tr>  </thead>  <tbody>    <tr>      <td>连接点</td>      <td>255,000,255</td>      <td>#FF00FF</td>      <td bgcolor="#FF00FF"></td>    </tr>    <tr>      <td>固体(默认)</td>      <td>255,255,255</td>      <td>#FFFFFF</td>      <td bgcolor="#FFFFFF"></td>    </tr>    <tr>      <td>玻璃</td>      <td>128,128,128</td>      <td>#808080</td>      <td bgcolor="#808080"></td>    </tr>    <tr>      <td>瓷砖玻璃</td>      <td>064,064,064</td>      <td>#404040</td>      <td bgcolor="#404040"></td>    </tr>    <tr>      <td>发光固体</td>      <td>255,000,000</td>      <td>#FF0000</td>      <td bgcolor="#FF0000"></td>    </tr>    <tr>      <td>发光玻璃</td>      <td>255,255,000</td>      <td>#FFFF00</td>      <td bgcolor="#FFFF00"></td>    </tr>  </tbody></table><h2 id="透明贴图-Alpha"><a href="#透明贴图-Alpha" class="headerlink" title="透明贴图 (Alpha)"></a>透明贴图 (Alpha)</h2><p><img src="/p/trove-mod-make-blueprint/%E9%80%8F%E6%98%8E%E8%B4%B4%E5%9B%BE.png" alt="透明贴图"><br>按照列表顺序，除去连接点，从左到右依次排列。</p><p><em>只有类型贴图为玻璃,瓷砖玻璃,发光玻璃时有效。</em></p><table style="text-align:center">  <thead>    <tr>      <th>含义</th>      <th>RGB</th>      <th>十六进制</th>      <th>颜色</th>    </tr>  </thead>  <tbody>    <tr>      <td>连接点</td>      <td>255,000,255</td>      <td>#FF00FF</td>      <td bgcolor="#FF00FF"></td>    </tr>    <tr>      <td>固体(默认)</td>      <td>255,255,255</td>      <td>#FFFFFF</td>      <td bgcolor="#FFFFFF"></td>    </tr>    <tr>      <td>稍微透明</td>      <td>240,240,240</td>      <td>#F0F0F0</td>      <td bgcolor="#F0F0F0"></td>    </tr>    <tr>      <td>|</td>      <td>208,208,208</td>      <td>#D0D0D0</td>      <td bgcolor="#D0D0D0"></td>    </tr>    <tr>      <td>|</td>      <td>176,176,176</td>      <td>#B0B0B0</td>      <td bgcolor="#B0B0B0"></td>    </tr>    <tr>      <td>|</td>      <td>144,144,144</td>      <td>#909090</td>      <td bgcolor="#909090"></td>    </tr>    <tr>      <td>|</td>      <td>112,112,112</td>      <td>#707070</td>      <td bgcolor="#707070"></td>    </tr>    <tr>      <td>|</td>      <td>080,080,080</td>      <td>#505050</td>      <td bgcolor="#505050"></td>    </tr>    <tr>      <td>|</td>      <td>048,048,048</td>      <td>#303030</td>      <td bgcolor="#303030"></td>    </tr>    <tr>      <td>非常透明</td>      <td>016,016,016</td>      <td>#101010</td>      <td bgcolor="#101010"></td>    </tr>  </tbody></table><h2 id="高光贴图-Specular"><a href="#高光贴图-Specular" class="headerlink" title="高光贴图 (Specular)"></a>高光贴图 (Specular)</h2><p><img src="/p/trove-mod-make-blueprint/%E9%AB%98%E5%85%89%E8%B4%B4%E5%9B%BE.png" alt="高光贴图"><br>按照列表顺序，除去连接点，从左到右依次排列。</p><table style="text-align:center">  <thead>    <tr>      <th>含义</th>      <th>RGB</th>      <th>十六进制</th>      <th>颜色</th>    </tr>  </thead>  <tbody>    <tr>      <td>连接点</td>      <td>255,000,255</td>      <td>#FF00FF</td>      <td bgcolor="#FF00FF"></td>    </tr>    <tr>      <td>粗糙(默认)</td>      <td>128,000,000</td>      <td>#800000</td>      <td bgcolor="#800000"></td>    </tr>    <tr>      <td><font color="#c00">固体*</font></td>      <td>255,255,255</td>      <td>#FFFFFF</td>      <td bgcolor="#FFFFFF"></td>    </tr>    <tr>      <td>金属</td>      <td>000,128,000</td>      <td>#008000</td>      <td bgcolor="#008000"></td>    </tr>    <tr>      <td>水</td>      <td>000,000,128</td>      <td>#000080</td>      <td bgcolor="#000080"></td>    </tr>    <tr>      <td>彩虹</td>      <td>128,128,000</td>      <td>#808000</td>      <td bgcolor="#808000"></td>    </tr>    <tr>      <td>光滑</td>      <td>128,0,128</td>      <td>#800080</td>      <td bgcolor="#800080"></td>    </tr>  </tbody></table><font color="#c00"><i>当在类型贴图使用玻璃或透明贴图使用透明时，应将高光贴图设置为固体。</i></font><h2 id="文件转换"><a href="#文件转换" class="headerlink" title="文件转换"></a>文件转换</h2><p>蓝图文件和 Qubicle 文件是可以相互转换的。</p><h3 id="Qubicle-文件转换为蓝图文件"><a href="#Qubicle-文件转换为蓝图文件" class="headerlink" title="Qubicle 文件转换为蓝图文件"></a>Qubicle 文件转换为蓝图文件</h3><p>确保所有文件都是 Qubicle 格式，如果不是请先从体素编辑器导出 qb 文件。<br>确保模型与其材质贴图文件位于同一目录，并且文件名正确。</p><p>将原始模型的文件拖动到游戏目录的 <code>devtool_convert_to_blueprint.bat</code> 文件上。<br>程序会自动加入其他相应的材质贴图文件。<br><img src="/p/trove-mod-make-blueprint/%E8%BD%AC%E6%8D%A2%E4%B8%BA%E8%93%9D%E5%9B%BE.png" alt="转换为蓝图"></p><p>转换完成后，蓝图文件将出现在模型文件所在目录。</p><h3 id="蓝图文件转换为-Qubicle-文件"><a href="#蓝图文件转换为-Qubicle-文件" class="headerlink" title="蓝图文件转换为 Qubicle 文件"></a>蓝图文件转换为 Qubicle 文件</h3><p>在游戏目录新建 <code>qbexport</code> 文件夹。</p><p>将蓝图文件拖动到游戏目录的 <code>devtool_dungeon_blueprint_to_QB.bat</code> 文件上。<br><img src="/p/trove-mod-make-blueprint/%E8%BD%AC%E6%8D%A2%E4%B8%BA_Qubicle.png" alt="转换为 Qubicle"></p><p>转换完成后，Qubicle 文件将出现在游戏目录的 <code>qbexport</code> 文件夹。</p><p>参考资料：<a href="https://trove.wikia.com/wiki/Material_Map_Guide">https://trove.wikia.com/wiki/Material_Map_Guide</a></p>]]></content>
    
    
      
      
    <summary type="html">&lt;h2 id=&quot;蓝图文件&quot;&gt;&lt;a href=&quot;#蓝图文件&quot; class=&quot;headerlink&quot; title=&quot;蓝图文件&quot;&gt;&lt;/a&gt;蓝图文件&lt;/h2&gt;&lt;p&gt;宝藏世界大部分的模型都以蓝图格式储存，它的文件扩展名是 &lt;code&gt;.blueprint&lt;/code&gt;。&lt;br&gt;也就是说我们</summary>
      
    
    
    
    <category term="游戏开发" scheme="https://android99.com/categories/%E6%B8%B8%E6%88%8F%E5%BC%80%E5%8F%91/"/>
    
    <category term="宝藏世界模组开发指南" scheme="https://android99.com/categories/%E6%B8%B8%E6%88%8F%E5%BC%80%E5%8F%91/%E5%AE%9D%E8%97%8F%E4%B8%96%E7%95%8C%E6%A8%A1%E7%BB%84%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97/"/>
    
    
    <category term="Trove" scheme="https://android99.com/tags/Trove/"/>
    
    <category term="Mod" scheme="https://android99.com/tags/Mod/"/>
    
  </entry>
  
  <entry>
    <title>宝藏世界模组开发指南 —— 解包</title>
    <link href="https://android99.com/p/trove-mod-make-unpack/"/>
    <id>https://android99.com/p/trove-mod-make-unpack/</id>
    <published>2017-07-15T13:16:00.000Z</published>
    <updated>2017-07-15T13:16:00.000Z</updated>
    
    <content type="html"><![CDATA[<p>宝藏世界的游戏资源都被打包到后缀名为 TFA 的文件中。</p><p>我们不能直接对其进行编辑，需要使用游戏给我们的工具进行解包后才能编辑。<br><img src="/p/trove-mod-make-unpack/TFA_%E6%96%87%E4%BB%B6.png" alt="TFA 文件"></p><p>首先，我们打开游戏目录。</p><p>中国版：<code>[游戏安装目录]\360游戏\trove\gameclient</code></p><p>Steam版：<code>[Steam安装目录]\Steam\steamapps\common\Trove\Games\Trove\Live</code></p><p><img src="/p/trove-mod-make-unpack/%E6%B8%B8%E6%88%8F%E7%9B%AE%E5%BD%95.png" alt="游戏目录"></p><p>按住 Shift 键并右键空白处，点击”在此处打开命令窗口(W)”。<br><img src="/p/trove-mod-make-unpack/%E5%9C%A8%E6%AD%A4%E5%A4%84%E6%89%93%E5%BC%80%E5%91%BD%E4%BB%A4%E7%AA%97%E5%8F%A3.png" alt="在此处打开命令窗口"></p><p>打开了 CMD 命令行窗口。<br><img src="/p/trove-mod-make-unpack/%E5%91%BD%E4%BB%A4%E8%A1%8C%E7%AA%97%E5%8F%A3.png" alt="命令行窗口"></p><p>输入命令行按回车进行解包。</p><h2 id="格式："><a href="#格式：" class="headerlink" title="格式："></a>格式：</h2><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Trove.exe -tool extractarchive [目标路径] [输出路径]</span><br></pre></td></tr></table></figure><h2 id="例如："><a href="#例如：" class="headerlink" title="例如："></a>例如：</h2><h3 id="解包蓝图"><a href="#解包蓝图" class="headerlink" title="解包蓝图"></a>解包蓝图</h3><p><em>大部分模组的制作只需要解包这个就可以了</em></p><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br></pre></td><td class="code"><pre><span class="line">Trove.exe -tool extractarchive blueprints extracted\blueprints</span><br></pre></td></tr></table></figure><h3 id="解包-PopcornFX-特效"><a href="#解包-PopcornFX-特效" class="headerlink" title="解包 PopcornFX 特效"></a>解包 PopcornFX 特效</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">Trove.exe -tool extractarchive particles\vfx extracted\particles\vfx</span><br><span class="line">Trove.exe -tool extractarchive particles\vfx\particles extracted\particles\vfx\particles</span><br><span class="line">Trove.exe -tool extractarchive particles\vfx\textures extracted\particles\vfx\textures</span><br><span class="line">Trove.exe -tool extractarchive particles\vfx\textures\player extracted\particles\vfx\textures\player</span><br><span class="line">Trove.exe -tool extractarchive particles\vfx\meshes extracted\particles\vfx\meshes</span><br><span class="line">Trove.exe -tool extractarchive particles\vfx\atlasdefinitions extracted\particles\vfx\atlasdefinitions</span><br><span class="line">Trove.exe -tool extractarchive particles\vfx\Animations extracted\particles\vfx\Animations</span><br><span class="line">Trove.exe -tool extractarchive particles\vfx\Cache extracted\particles\vfx\Cache\Meshes</span><br><span class="line">Trove.exe -tool extractarchive particles\vfx\Config extracted\particles\vfx\Config</span><br><span class="line">Trove.exe -tool extractarchive particles\vfx\Editor\Thumbnails\Particles extracted\particles\vfx\Thumbnails\Particles</span><br><span class="line">Trove.exe -tool extractarchive particles\vfx\Editor\Thumbnails\Meshes extracted\particles\vfx\Thumbnails\Meshes</span><br><span class="line">Trove.exe -tool extractarchive particles\vfx\Editor\MaterialProxies extracted\particles\vfx\MaterialProxies</span><br></pre></td></tr></table></figure><h3 id="解包用户界面"><a href="#解包用户界面" class="headerlink" title="解包用户界面"></a>解包用户界面</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br></pre></td><td class="code"><pre><span class="line">Trove.exe -tool extractarchive ui extracted\ui</span><br><span class="line">Trove.exe -tool extractarchive ui\ability_icons extracted\ui\ability_icons</span><br><span class="line">Trove.exe -tool extractarchive ui\crafting_icons extracted\ui\crafting_icons</span><br><span class="line">Trove.exe -tool extractarchive ui\fonts extracted\ui\fonts</span><br><span class="line">Trove.exe -tool extractarchive ui\meta_icons extracted\ui\meta_icons</span><br><span class="line">Trove.exe -tool extractarchive ui\skins extracted\ui\skins</span><br><span class="line">Trove.exe -tool extractarchive ui\store extracted\ui\store</span><br><span class="line">Trove.exe -tool extractarchive ui\classes extracted\ui\classes</span><br><span class="line">Trove.exe -tool extractarchive ui\tutorial extracted\ui\tutorial</span><br></pre></td></tr></table></figure><h3 id="解包预设文件-Metaforge"><a href="#解包预设文件-Metaforge" class="headerlink" title="解包预设文件 (Metaforge)"></a>解包预设文件 (Metaforge)</h3><figure class="highlight plaintext"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br></pre></td><td class="code"><pre><span class="line">Trove.exe -tool extractarchive prefabs\placeable extracted\prefabs\placeable</span><br><span class="line"></span><br><span class="line">~Blocks~</span><br><span class="line">Trove.exe -tool extractarchive prefabs\placeable\block\color extracted\prefabs\placeable\block\color</span><br><span class="line">Trove.exe -tool extractarchive prefabs\placeable\block\gameplay extracted\prefabs\placeable\block\gameplay</span><br><span class="line">Trove.exe -tool extractarchive prefabs\placeable\block\glass extracted\prefabs\placeable\block\glass</span><br><span class="line">Trove.exe -tool extractarchive prefabs\placeable\block\glow extracted\prefabs\placeable\block\glow</span><br><span class="line">Trove.exe -tool extractarchive prefabs\placeable\block\ice extracted\prefabs\placeable\block\ice</span><br><span class="line">Trove.exe -tool extractarchive prefabs\placeable\block\metal extracted\prefabs\placeable\block\metal</span><br><span class="line">Trove.exe -tool extractarchive prefabs\placeable\block\music extracted\prefabs\placeable\block\music</span><br><span class="line">Trove.exe -tool extractarchive prefabs\placeable\block\natural extracted\prefabs\placeable\block\natural</span><br><span class="line">Trove.exe -tool extractarchive prefabs\placeable\block\particles extracted\prefabs\placeable\block\particles</span><br><span class="line">Trove.exe -tool extractarchive prefabs\placeable\block\primal extracted\prefabs\placeable\block\primal</span><br><span class="line">Trove.exe -tool extractarchive prefabs\placeable\block\textured extracted\prefabs\placeable\block\textured</span><br><span class="line">Trove.exe -tool extractarchive prefabs\placeable\block\transmute extracted\prefabs\placeable\block\transmute</span><br><span class="line">/Blocks</span><br><span class="line">Trove.exe -tool extractarchive prefabs\placeable\collectible extracted\prefabs\placeable\collectible</span><br><span class="line">Trove.exe -tool extractarchive prefabs\plant extracted\prefabs\plant</span><br><span class="line">Trove.exe -tool extractarchive prefabs\placeable\crafting extracted\prefabs\placeable\crafting</span><br><span class="line">Trove.exe -tool extractarchive prefabs\placeable\deco extracted\prefabs\placeable\deco</span><br><span class="line">Trove.exe -tool extractarchive prefabs\placeable\mechanical extracted\prefabs\placeable\mechanical</span><br><span class="line">Trove.exe -tool extractarchive prefabs\placeable\npc extracted\prefabs\placeable\npc</span><br><span class="line">Trove.exe -tool extractarchive prefabs\placeable\portal extracted\prefabs\placeable\portal</span><br><span class="line">Trove.exe -tool extractarchive prefabs\placeable\quest extracted\prefabs\placeable\quest</span><br><span class="line">Trove.exe -tool extractarchive prefabs\placeable\sign extracted\prefabs\placeable\sign</span><br><span class="line">Trove.exe -tool extractarchive prefabs\placeable\tutorial extracted\prefabs\placeable\tutorial</span><br><span class="line">Trove.exe -tool extractarchive prefabs\placeable\vendor extracted\prefabs\placeable\vendor</span><br></pre></td></tr></table></figure><p>解包后可打开输出路径查看结果。<br><img src="/p/trove-mod-make-unpack/%E8%A7%A3%E5%8C%85%E8%93%9D%E5%9B%BE.png" alt="解包蓝图"> <img src="/p/trove-mod-make-unpack/%E8%A7%A3%E5%8C%85%E7%BB%93%E6%9E%9C.png" alt="解包结果"></p><p>参考资料：<a href="http://forums.trovegame.com/showthread.php?25707-Guide-Comprehensive-Trove-Modding-Tutorial">http://forums.trovegame.com/showthread.php?25707-Guide-Comprehensive-Trove-Modding-Tutorial</a></p><h2 id="使用批处理解包"><a href="#使用批处理解包" class="headerlink" title="使用批处理解包"></a>使用批处理解包</h2><p>你也可以使用制作好的批处理来解包全部资源文件。<br>不过这会比较耗时间。<br>如果你只需要解包一部分，建议还是使用上面的命令来手动解包。</p><ol><li>下载 <a class="btn-beautify " href="/p/trove-mod-make-unpack/TroveExtract.zip" title="TroveExtract.zip"><i class="far fa-file-archive"></i><span>TroveExtract.zip</span></a>。</li><li>解压出 <code>TroveExtract.bat</code> 文件放入游戏目录，运行该文件。</li><li>资源文件将被提取到游戏目录的 <code>extracted</code> 文件夹。</li></ol>]]></content>
    
    
      
      
    <summary type="html">&lt;p&gt;宝藏世界的游戏资源都被打包到后缀名为 TFA 的文件中。&lt;/p&gt;
&lt;p&gt;我们不能直接对其进行编辑，需要使用游戏给我们的工具进行解包后才能编辑。&lt;br&gt;&lt;img src=&quot;/p/trove-mod-make-unpack/TFA_%E6%96%87%E4%BB%B6.png&quot;</summary>
      
    
    
    
    <category term="游戏开发" scheme="https://android99.com/categories/%E6%B8%B8%E6%88%8F%E5%BC%80%E5%8F%91/"/>
    
    <category term="宝藏世界模组开发指南" scheme="https://android99.com/categories/%E6%B8%B8%E6%88%8F%E5%BC%80%E5%8F%91/%E5%AE%9D%E8%97%8F%E4%B8%96%E7%95%8C%E6%A8%A1%E7%BB%84%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97/"/>
    
    
    <category term="Trove" scheme="https://android99.com/tags/Trove/"/>
    
    <category term="Mod" scheme="https://android99.com/tags/Mod/"/>
    
  </entry>
  
  <entry>
    <title>宝藏世界模组开发指南 —— 索引</title>
    <link href="https://android99.com/p/trove-mod-make-index/"/>
    <id>https://android99.com/p/trove-mod-make-index/</id>
    <published>2017-07-15T12:16:00.000Z</published>
    <updated>2017-07-15T12:16:00.000Z</updated>
    
    <content type="html"><![CDATA[<h2 id="目录"><a href="#目录" class="headerlink" title="目录"></a>目录</h2><ol><li><a href="/p/trove-mod-make-unpack/" title="宝藏世界模组开发指南 —— 解包">解包</a></li><li><p>编辑资源<br>  2.1. 模型<br>    2.1.1. MagicaVoxel界面介绍<br>    2.1.2. <a href="/p/trove-mod-make-blueprint/" title="宝藏世界模组开发指南 —— 蓝图">蓝图</a><br>  2.2. 特效<br>    2.2.1. 使用PopcornFX</p></li><li><p>加载<br>  3.1. <a href="/p/trove-mod-make-test/" title="宝藏世界模组开发指南 —— 测试">测试</a><br>  3.2. <a href="/p/trove-mod-make-tmod/" title="宝藏世界模组开发指南 —— 制作 TMod 文件">制作TMod文件</a><br>    3.2.1. 上传Mod到Steam创意工坊</p></li><li><p>补充<br>  4.1. <a href="#%E9%97%AE%E4%B8%8E%E7%AD%94">问与答</a></p></li></ol><h2 id="序言"><a href="#序言" class="headerlink" title="序言"></a>序言</h2><p><img src="/p/trove-mod-make-index/Trove_%E8%A7%92%E8%89%B2.png" alt="Trove 角色"></p><p>大家好，我是国际服League  Team俱乐部的Android。</p><p>我要开一个新坑——宝藏世界模组开发的中文教程。</p><p>目前已经完成了部分，后续内容也会慢慢补充完整(大概)。</p><details class="toggle" ><summary class="toggle-button" style="">折叠</summary><div class="toggle-content"><p>不知道有生之年能不能填完这个坑呢。_(:3」∠)_</p></div></details><h2 id="问与答"><a href="#问与答" class="headerlink" title="问与答"></a>问与答</h2><h3 id="Q-为什么我按照教程操作后，却没有出现相应文件。"><a href="#Q-为什么我按照教程操作后，却没有出现相应文件。" class="headerlink" title="Q: 为什么我按照教程操作后，却没有出现相应文件。"></a>Q: 为什么我按照教程操作后，却没有出现相应文件。</h3><p>A: 检查你的操作路径是否包含中文，如果有中文则改为英文。</p><h3 id="Q-为什么我文件名字和教程里的不一样？"><a href="#Q-为什么我文件名字和教程里的不一样？" class="headerlink" title="Q: 为什么我文件名字和教程里的不一样？"></a>Q: 为什么我文件名字和教程里的不一样？</h3><p>A: 取消资源管理器的隐藏已知文件扩展名功能，具体操作方法可通过搜索引擎搜索”系统名字+显示扩展名”。</p><h3 id="Q-我在使用Trove的devtool时出现了未知错误。"><a href="#Q-我在使用Trove的devtool时出现了未知错误。" class="headerlink" title="Q: 我在使用Trove的devtool时出现了未知错误。"></a>Q: 我在使用Trove的devtool时出现了未知错误。</h3><p>A: devtool是不会在命令行输出执行结果的，你需要自行打开<code>%APPDATA%\Trove\DevTool.log</code>来查看错误原因。</p>]]></content>
    
    
      
      
    <summary type="html">&lt;h2 id=&quot;目录&quot;&gt;&lt;a href=&quot;#目录&quot; class=&quot;headerlink&quot; title=&quot;目录&quot;&gt;&lt;/a&gt;目录&lt;/h2&gt;&lt;ol&gt;
&lt;li&gt;&lt;a href=&quot;/p/trove-mod-make-unpack/&quot; title=&quot;宝藏世界模组开发指南 —— 解包&quot;&gt;解包&lt;</summary>
      
    
    
    
    <category term="游戏开发" scheme="https://android99.com/categories/%E6%B8%B8%E6%88%8F%E5%BC%80%E5%8F%91/"/>
    
    <category term="宝藏世界模组开发指南" scheme="https://android99.com/categories/%E6%B8%B8%E6%88%8F%E5%BC%80%E5%8F%91/%E5%AE%9D%E8%97%8F%E4%B8%96%E7%95%8C%E6%A8%A1%E7%BB%84%E5%BC%80%E5%8F%91%E6%8C%87%E5%8D%97/"/>
    
    
    <category term="Trove" scheme="https://android99.com/tags/Trove/"/>
    
    <category term="Mod" scheme="https://android99.com/tags/Mod/"/>
    
  </entry>
  
</feed>
