From 3de4e51bf557e1626a8dd78cba620817db1ae916 Mon Sep 17 00:00:00 2001 From: Eric Fredricksen Date: Mon, 12 Jul 2010 11:48:04 -0700 Subject: [PATCH] Fix broken WinEquip --- main.js | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/main.js b/main.js index 12a9fd7..9a1a4c0 100644 --- a/main.js +++ b/main.js @@ -350,8 +350,8 @@ function Dequeue() { function Put(list, key, value) { - if (!game[list.id]) - game[list.id] = list.fixedkeys ? {} : []; + if (typeof key === typeof 1) + key = list.fixedkeys ? list.fixedkeys[key] : game[list.id][key][0]; if (list.fixedkeys) { game[list.id][key] = value; @@ -507,13 +507,13 @@ function ListBox(id, columns, fixedkeys) { var that = this; var dict = game[this.id]; if (this.fixedkeys) { - this.rows().each(function (index) { - Put(that, Key(this), dict[Key(this)]); + $.each(this.fixedkeys, function (index, key) { + PutUI(that, key, dict[key]); }); } else { $.each(dict, function (index, row) { if (that.columns == 2) - Put(that, row[0], row[1]); + PutUI(that, row[0], row[1]); else that.AddUI(row); }); @@ -907,21 +907,21 @@ function Timer1Timer() { } function FormCreate() { - ExpBar = new ProgressBar("ExpBar", "$remaining XP needed for next level"); + ExpBar = new ProgressBar("ExpBar", "$remaining XP needed for next level"); EncumBar = new ProgressBar("EncumBar", "$Position/$Max cubits"); - PlotBar = new ProgressBar("PlotBar", "$time remaining"); + PlotBar = new ProgressBar("PlotBar", "$time remaining"); QuestBar = new ProgressBar("QuestBar", "$percent% complete"); - TaskBar = new ProgressBar("TaskBar", "$percent%"); + TaskBar = new ProgressBar("TaskBar", "$percent%"); AllBars = [ExpBar,PlotBar,TaskBar,QuestBar,EncumBar]; - Traits = new ListBox("Traits", 2, true); - Stats = new ListBox("Stats", 2, true); - Spells = new ListBox("Spells", 2, false); - Equips = new ListBox("Equips", 2, true); - Inventory = new ListBox("Inventory", 2, false); - Plots = new ListBox("Plots", 1); - Quests = new ListBox("Quests", 1); + Traits = new ListBox("Traits", 2, K.Traits); + Stats = new ListBox("Stats", 2, K.Stats); + Spells = new ListBox("Spells", 2); + Equips = new ListBox("Equips", 2, K.Equips); + Inventory = new ListBox("Inventory", 2); + Plots = new ListBox("Plots", 1); + Quests = new ListBox("Quests", 1); Plots.load = function (sheet) { for (var i = Max(0, game.act-99); i <= game.act; ++i)