瀏覽代碼

mods can now extend which uis are loaded on the login screen

tags/v0.7.0^2
Shaun 4 年之前
父節點
當前提交
4401b0585c
共有 3 個檔案被更改,包括 50 行新增45 行删除
  1. +1
    -2
      src/client/js/main.js
  2. +10
    -42
      src/client/ui/factory.js
  3. +39
    -1
      src/server/config/clientConfig.js

+ 1
- 2
src/client/js/main.js 查看文件

@@ -74,8 +74,7 @@ define([

numbers.init();

uiFactory.init(null, globals.clientConfig.uiList);
uiFactory.build('login', 'body');
uiFactory.init(null);

fnQueueTick = getQueueTick(this.update.bind(this));
fnQueueTick();


+ 10
- 42
src/client/ui/factory.js 查看文件

@@ -9,67 +9,35 @@ define([
globals,
tosAcceptanceValid
) {
const startupUis = [
'inventory',
'equipment',
'hud',
'target',
'menu',
'spells',
'messages',
'online',
'mainMenu',
'context',
'party',
'help',
'dialogue',
'buffs',
'tooltips',
'tooltipInfo',
'tooltipItem',
'announcements',
'quests',
'events',
'progressBar',
'stash',
'talk',
'trade',
'overlay',
'death',
'leaderboard',
'reputation',
'mail',
'wardrobe',
'passives',
'workbench',
'middleHud',
'options'
];

return {
uis: [],
root: '',

init: function (root, uiList = []) {
init: function (root) {
if (root)
this.root = root + '/';

startupUis.push(...uiList);

events.on('onEnterGame', this.onEnterGame.bind(this));
events.on('onUiKeyDown', this.onUiKeyDown.bind(this));
events.on('onResize', this.onResize.bind(this));

globals.clientConfig.uiLoginList.forEach(u => {
if (u.path)
this.buildModUi(u);
else
this.build(u);
});
},

onEnterGame: function () {
events.clearQueue();

startupUis.forEach(function (u) {
globals.clientConfig.uiList.forEach(u => {
if (u.path)
this.buildModUi(u);
else
this.build(u);
}, this);
});
},

buildModUi: function (config) {


+ 39
- 1
src/server/config/clientConfig.js 查看文件

@@ -25,7 +25,45 @@ const config = {
'images/skins/0010.png',
'images/skins/0012.png'
],
uiList: [],
uiLoginList: [
'login'
],
uiList: [
'inventory',
'equipment',
'hud',
'target',
'menu',
'spells',
'messages',
'online',
'mainMenu',
'context',
'party',
'help',
'dialogue',
'buffs',
'tooltips',
'tooltipInfo',
'tooltipItem',
'announcements',
'quests',
'events',
'progressBar',
'stash',
'talk',
'trade',
'overlay',
'death',
'leaderboard',
'reputation',
'mail',
'wardrobe',
'passives',
'workbench',
'middleHud',
'options'
],
contextMenuActions: {
player: [],
npc: []


Loading…
取消
儲存