Skip to content

Commit

Permalink
Add new mecenaries for D2R.
Browse files Browse the repository at this point in the history
  • Loading branch information
daidodo committed Oct 29, 2022
1 parent dacd0f4 commit c2dc31d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 6 deletions.
14 changes: 8 additions & 6 deletions Diablo Edit2/DlgCharItems.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -817,11 +817,11 @@ void CDlgCharItems::ResetAll()
Invalidate();
}

static void loadTextMercCB(CComboBox & cb, int sz, function<CString (int i)> name) {
static void loadTextMercCB(CComboBox & cb, int sz, function<CString (int i)> nameOf) {
int sel = cb.GetCurSel(); //保存当前选中项
cb.ResetContent(); //删除旧项
for (int i = 0; i < sz; ++i) //更新文字
cb.InsertString(i, name(i));
cb.InsertString(i, nameOf(i));
if (sz > 0) //重新设置选择项
cb.SetCurSel(min(sel, sz - 1));
}
Expand Down Expand Up @@ -1274,11 +1274,13 @@ void CDlgCharItems::OnItemRemove() {
Invalidate();
}

static int mercNameGroup(int type) {
if (type < 0)
static int mercNameGroup(int name) {
if (name < 0)
return - 1;
const int INDEX[] = {5, 14, 23};
return lower_bound(begin(INDEX), end(INDEX), type, less<int>()) - begin(INDEX);
const int NAME_INDEX[] = {5, 14, 23, 29, 35};
const int TYPE_INDEX[] = {0, 1, 2, 3, 1, 3};
int type = lower_bound(begin(NAME_INDEX), end(NAME_INDEX), name, less<int>()) - begin(NAME_INDEX);
return TYPE_INDEX[type];
}

void CDlgCharItems::OnCbnSelchangeComboMercType() {
Expand Down
Binary file modified Diablo Edit2/language.dat
Binary file not shown.
9 changes: 9 additions & 0 deletions Generate Data/language.txt
Original file line number Diff line number Diff line change
Expand Up @@ -413,6 +413,15 @@
Barbarian - Nightmare
Barbarian - Hell
Barbarian - Hell
Mercenary - Prayer Arura (D2R only) 沙漠雇佣兵 - 祈祷光环 (D2R only)
Mercenary - Defiance Arura (D2R only) 沙漠雇佣兵 - 反抗光环 (D2R only)
Mercenary - Blessed Arura (D2R only) 沙漠雇佣兵 - 精准祝福光环 (D2R only)
Mercenary - Thorns Arura (D2R only) 沙漠雇佣兵 - 荆棘光环 (D2R only)
Mercenary - Holy Freeze Arura (D2R only) 沙漠雇佣兵 - 神圣冰冻光环 (D2R only)
Mercenary - Might Arura (D2R only) 沙漠雇佣兵 - 力量光环 (D2R only)
Barbarian - Frenzy (D2R only) 野蛮人 - 狂乱 (D2R only)
Barbarian - Frenzy (D2R only) 野蛮人 - 狂乱 (D2R only)
Barbarian - Frenzy (D2R only) 野蛮人 - 狂乱 (D2R only)
*=======================物品种类名字
General items 一般物品 一般物品
Helmets 头盔 頭盔
Expand Down

0 comments on commit c2dc31d

Please sign in to comment.