diff --git a/AndorsTrailEdit/AndorsTrailEditor.js b/AndorsTrailEdit/AndorsTrailEditor.js index f1d1905f5..6b68df57c 100644 --- a/AndorsTrailEdit/AndorsTrailEditor.js +++ b/AndorsTrailEdit/AndorsTrailEditor.js @@ -6,7 +6,18 @@ IncludeJavascript("FieldList.js"); IncludeJavascript("DataStore.js"); IncludeJavascript("ImageSelector.js"); IncludeJavascript("EditorTabs.js"); +IncludeJavascript("EditorFunctions.js"); +IncludeJavascript("ImportExport.js"); + +IncludeJavascript("Editor_ActorCondition.js"); +IncludeJavascript("Editor_Quest.js"); +IncludeJavascript("Editor_Item.js"); +IncludeJavascript("Editor_Droplist.js"); +IncludeJavascript("Editor_Conversation.js"); +IncludeJavascript("Editor_Monster.js"); + IncludeJavascript("inc/jquery.shorten.min.js"); +IncludeJavascript("inc/jquery.dynatree.min.js"); var model; @@ -18,201 +29,6 @@ var equipConditionsDialog; var droplistItemDialog; -function checkboxHidesElement(checkbox, element, visibleCondition) { - checkbox.change(function () { - if (checkbox.attr("checked")) { - element.fadeIn("slow"); - } else { - element.fadeOut("slow"); - } - }); - var visible = bool(visibleCondition); - checkbox.attr("checked", visible); - element.toggle(visible); -} - -function bool(v) { - if (typeof(v) == 'undefined') return false; - if (v == '') return false; - if (v == '0') return false; - if (v == 'false') return false; - return true; -} - -function setInputFieldsToObjectValues(div, obj) { - div.find("input,select,textarea").each(function() { - $(this).val(obj[$(this).attr("id")]); - }); - div.find("input:checkbox").each(function() { - $(this).attr("checked", bool(obj[$(this).attr("id")])); - }); -} - -function bindInputFieldChangesToObject(div, obj) { - div.find("input,select,textarea").unbind("change").change(function() { - obj[$(this).attr("id")] = $(this).val(); - }); - div.find("input:checkbox").unbind("change").change(function() { - obj[$(this).attr("id")] = $(this).attr("checked") ? 1 : 0; - }); -} - -function applyEditorBindingsForObject(div, obj) { - div.find("input").addClass("ui-widget-content ui-corner-all"); - setInputFieldsToObjectValues(div, obj); - bindInputFieldChangesToObject(div, obj); -} - -function applyCommonEditorBindings(div, obj, dataStore) { - applyEditorBindingsForObject(div, obj); - div.find("#" + dataStore.nameField).change(function() { dataStore.onNameChanged(obj, $(this).val()); }); -} - -function createMonsterEditor(obj) { - var div = $( "#templates #editMonster" ).clone(); - applyCommonEditorBindings(div, obj, model.monsters); - checkboxHidesElement(div.find('#hasConversation'), div.find('#hasConversationDisplay'), obj.phraseID); - checkboxHidesElement(div.find('#hasCombat'), div.find('#hasCombatDisplay'), obj.attackChance); - checkboxHidesElement(div.find('#hasCritical'), div.find('#hasCriticalDisplay'), obj.criticalChance || obj.criticalMultiplier); - checkboxHidesElement(div.find('#hasHitEffect'), div.find('#hasHitEffectDisplay'), obj.hasHitEffect); - imageSelector.imageify(div.find('#monsterimage'), div.find('#iconID'), 'monsters'); - bindFieldToDataStore( $( "#droplistID", div ), model.droplists , function(obj) { return obj.id; } ); - - - var createNewCondition = function() { return { chance: 100, magnitude: 1 }; } - if (!obj.onHit_conditionsSource) obj.onHit_conditionsSource = []; - if (!obj.onHit_conditionsTarget) obj.onHit_conditionsTarget = []; - var setupEditor = function(div) { - bindFieldToDataStore( $( "#condition", div ), model.actorEffects , function(obj) { return obj.id; } ); - } - applyTableEditor( $( "#onHit_conditionsSource", div ) , onHitConditionsDialog, obj.onHit_conditionsSource, createNewCondition, setupEditor); - applyTableEditor( $( "#onHit_conditionsTarget", div ) , onHitConditionsDialog, obj.onHit_conditionsTarget, createNewCondition, setupEditor); - - return div; -} - -function createItemEditor(obj) { - var div = $( "#templates #editItem" ).clone(); - applyCommonEditorBindings(div, obj, model.items); - checkboxHidesElement(div.find('#hasEquipEffect'), div.find('#hasEquipEffectDisplay'), obj.hasEquipEffect); - checkboxHidesElement(div.find('#hasUseEffect'), div.find('#hasUseEffectDisplay'), obj.hasUseEffect); - checkboxHidesElement(div.find('#equip_hasCritical'), div.find('#equip_hasCriticalDisplay'), obj.equip_criticalChance || obj.equip_criticalMultiplier); - checkboxHidesElement(div.find('#hasHitEffect'), div.find('#hasHitEffectDisplay'), obj.hasHitEffect); - checkboxHidesElement(div.find('#hasKillEffect'), div.find('#hasKillEffectDisplay'), obj.hasKillEffect); - imageSelector.imageify(div.find('#itemimage'), div.find('#iconID'), 'items'); - - var createNewCondition = function() { return { chance: 100, magnitude: 1 }; } - if (!obj.equip_conditions) obj.equip_conditions = []; - if (!obj.use_conditionsSource) obj.use_conditionsSource = []; - if (!obj.hit_conditionsSource) obj.hit_conditionsSource = []; - if (!obj.hit_conditionsTarget) obj.hit_conditionsTarget = []; - if (!obj.kill_conditionsSource) obj.kill_conditionsSource = []; - var setupEditor = function(div) { - bindFieldToDataStore( $( "#condition", div ), model.actorEffects , function(obj) { return obj.id; } ); - } - applyTableEditor( $( "#equip_conditions", div ) , equipConditionsDialog, obj.equip_conditions, createNewCondition, setupEditor); - applyTableEditor( $( "#use_conditionsSource", div ) , onHitConditionsDialog, obj.use_conditionsSource, createNewCondition, setupEditor); - applyTableEditor( $( "#hit_conditionsSource", div ) , onHitConditionsDialog, obj.hit_conditionsSource, createNewCondition, setupEditor); - applyTableEditor( $( "#hit_conditionsTarget", div ) , onHitConditionsDialog, obj.hit_conditionsTarget, createNewCondition, setupEditor); - applyTableEditor( $( "#kill_conditionsSource", div ) , onHitConditionsDialog, obj.kill_conditionsSource, createNewCondition, setupEditor); - - return div; -} - -function bindFieldToDataStore(field, dataStore, converter) { - var dataCallback = function(request, response) { - var result = []; - var pattern = new RegExp(request.term, "i"); - dataStore.items.forEach(function(obj) { - var name = converter(obj); - if (name.match(pattern)) { - result.push(name); - } - }); - response(result); - }; - field.autocomplete( "destroy" ).autocomplete({ source: dataCallback, minLength: 0 }); -} - -function createStatusEffectEditor(obj) { - var div = $( "#templates #editActorEffect" ).clone(); - applyCommonEditorBindings(div, obj, model.actorEffects); - checkboxHidesElement(div.find('#hasRoundEffect'), div.find('#hasRoundEffectDisplay'), obj.hasRoundEffect); - checkboxHidesElement(div.find('#hasFullRoundEffect'), div.find('#hasFullRoundEffectDisplay'), obj.hasFullRoundEffect); - checkboxHidesElement(div.find('#hasAbilityEffect'), div.find('#hasAbilityEffectDisplay'), obj.hasAbilityEffect); - checkboxHidesElement(div.find('#hasCritical'), div.find('#hasCriticalDisplay'), obj.criticalChance || obj.criticalMultiplier); - imageSelector.imageify(div.find('#statuseffectimage'), div.find('#iconID'), 'effects'); - return div; -} - -function applyTableEditor(table, dialog, array, templateFunction, editorSetup) { - var updateRowText = function(row, obj) { - $( "td", row ).each(function() { - var id = $( this ).attr("id"); - var val = obj[id]; - val = val ? val : ""; - $( "td#" + id, row ).text(val).shorten({ - width: '200' - }).css('display',''); - }); - }; - - var addToList = function(obj) { - var row = $( "" ); - table.find("th").each(function() { - var id = $( this ).attr("id"); - row.append( $( "" ).attr("id", id) ); - }); - updateRowText(row, obj); - table.append(row); - row.click(function() { - applyEditorBindingsForObject( dialog, obj ); - if (editorSetup) { editorSetup(dialog); } - dialog.unbind( "dialogclose" ).bind( "dialogclose", function() { - updateRowText(row, obj); - }); - dialog.dialog( "open" ); - }); - return row; - }; - table.parent().find("#add").button().click(function() { - var obj = templateFunction(); - array.push( obj ); - addToList( obj ).click(); - }); - table.addClass("ui-corner-all"); - $( "thead", table ).addClass("ui-widget-header"); - array.forEach(addToList); -} - -function createQuestEditor(obj) { - var div = $( "#templates #editQuest" ).clone(true); - applyCommonEditorBindings(div, obj, model.quests); - if (!obj.stages) obj.stages = []; - var array = obj.stages; - var createNewStage = function() { - var nextProgress; - if (array.length > 0) { nextProgress = parseInt(array[array.length - 1].progress) + 10; } - if (!nextProgress) { nextProgress = 10; } - return { progress: nextProgress }; - }; - applyTableEditor( $( "#stages", div ) , questlogDialog, array, createNewStage, function() {}); - return div; -} - -function createDroplistEditor(obj) { - var div = $( "#templates #editDroplist" ).clone(true); - applyCommonEditorBindings(div, obj, model.droplists); - if (!obj.items) obj.items = []; - var createNewDroplistItem = function() { return { quantity: 1, chance: 100 } }; - var setupEditor = function(div) { - bindFieldToDataStore( $( "#itemID", div ), model.items , function(obj) { return obj.searchTag; } ); - } - applyTableEditor( $( "#items", div ) , droplistItemDialog, obj.items, createNewDroplistItem, setupEditor); - return div; -} - - function openTabForObject(obj, dataStore) { tabs.openTabForObject(obj, dataStore.objectTypename, obj[dataStore.nameField]); } @@ -239,30 +55,6 @@ function bindObjectsToItemList(itemListDiv, dataStore) { }; } - -function exportIfExists(dataStore, div) { - var exists = false; - if (dataStore && dataStore.items.length > 0) exists = true; - div.toggle(exists); - if (!exists) { return; } - var exportData = dataStore.serialize(); - $( "#value" , div ).val(exportData); -} - -function prepareImport(dataStore, div) { - var importButton = $( "#import", div ); - var textarea = $( "#value", div ); - importButton.button({ disabled: true }).click(function() { - if (!textarea.val()) return; - dataStore.deserialize(textarea.val()); - div.hide('slow'); - }); - textarea.val("").change(function() { - var disabled = $(this).val() ? false : true; - importButton.button( "option", "disabled", disabled ); - }); -} - function bindEditorType(dataStore, div, createObjectEditor, newObjectCreator) { tabs.registerEditorType(dataStore.objectTypename, createObjectEditor); @@ -277,10 +69,30 @@ function bindEditorType(dataStore, div, createObjectEditor, newObjectCreator) { }); } +function addExampleModelItems(model) { + model.actorConditions.add({id: "bless", name: "Bless", iconID: "items_tiles:318", hasAbilityEffect: 1, attackChance: 15, blockChance: 5}); + model.actorConditions.add({id: "poison_weak", name: "Weak Poison", iconID: "items_tiles:340", hasRoundEffect: 1, round_visualEffectID: 2, round_boostHP_Min: -1, round_boostHP_Max: -1}); + + model.quests.add({id: "testQuest", name: "Test quest", stages: [ { progress: 10, logText: "Stage 10"} , { progress: 20, logText: "Stage 20", finishesQuest: 1 } ] }); + + model.items.add({iconID: "items_tiles:70", name: "Test item", searchTag: "item0", category: 0, baseMarketCost: 51, hasEquipEffect: 1, equip_attackChance: 10, equip_attackDamage_Min: 2, equip_attackDamage_Max: 4}); + model.items.add({iconID: "items_tiles:266", name: "Ring of damage +1", searchTag: "dmg_ring1", category: 7, baseMarketCost: 62, hasEquipEffect: 1, equip_attackDamage_Min: 1, equip_attackDamage_Max: 1}); + + model.droplists.add({id: "merchant1", items: [ { itemID: 'dmg_ring1', quantity_Min: 4, quantity_Max: 5, chance: 100 } , { itemID: 'item0', quantity_Min: 1, quantity_Max: 1, chance: 100 } ] } ); + + model.dialogue.add({id: "mikhail_default", message: 'Anything else I can help you with?', replies: [ { text: 'Do you have any tasks for me?', nextPhraseID: 'mikhail_tasks' }, { text: 'Is there anything else you can tell me about Andor?', nextPhraseID: 'mikhail_andor1' } ]}); + model.dialogue.add({id: 'mikhail_andor1', message: 'As I said, Andor went out yesterday and hasn\'t been back since. I\'m starting to worry about him. Please go look for your brother, he said he would only be out a short while.'}); + model.dialogue.add({id: 'mikhail_tasks', message: 'Oh yes, there were some things I need help with, bread and rats. Which one would you like to talk about?'}); + + model.monsters.add({name: "Small ant", iconID: "monsters_insects:2", maxHP: 30, size: '1x1'}); + model.monsters.add({name: "Red ant", iconID: "monsters_insects:3", maxHP: 20, size: '1x1'}); + model.monsters.add({name: "Wasp", iconID: "monsters_insects:1", maxHP: 10, size: '1x1'}); +} + function startEditor() { model = { - actorEffects: new DataStore('effect', new FieldList("[id|name|iconID|isStacking|" + actorConditions: new DataStore('actorcondition', new FieldList("[id|name|iconID|isStacking|" + "hasRoundEffect|round_visualEffectID|round_boostHP_Min|round_boostHP_Max|round_boostAP_Min|round_boostAP_Max|" + "hasFullRoundEffect|fullround_visualEffectID|fullround_boostHP_Min|fullround_boostHP_Max|fullround_boostAP_Min|fullround_boostAP_Max|" + "hasAbilityEffect|boostMaxHP|boostMaxAP|moveCostPenalty|attackCost|attackChance|criticalChance|criticalMultiplier|attackDamage_Min|attackDamage_Max|blockChance|damageResistance|" @@ -293,35 +105,21 @@ function startEditor() { + "hasKillEffect|kill_boostHP_Min|kill_boostHP_Max|kill_boostAP_Min|kill_boostAP_Max|kill_conditionsSource[condition|magnitude|duration|chance|]|" + "];")) ,droplists: new DataStore('droplist', new FieldList("[id|items[itemID|quantity_Min|quantity_Max|chance|]|];"), 'id') - ,dialogue: new DataStore('dialogue', new FieldList("[id|name|];")) + ,dialogue: new DataStore('dialogue', new FieldList("[id|message|progressQuest|rewardDropListID|replies[text|nextPhraseID|requires_Progress|requires_itemID|requires_Quantity|]|];"), 'id') ,monsters: new DataStore('monster', new FieldList("[iconID|name|tags|size|maxHP|maxAP|moveCost|attackCost|attackChance|criticalChance|criticalMultiplier|attackDamage_Min|attackDamage_Max|blockChance|damageResistance|droplistID|phraseID|" + "hasHitEffect|onHit_boostHP_Min|onHit_boostHP_Max|onHit_boostAP_Min|onHit_boostAP_Max|onHit_conditionsSource[condition|magnitude|duration|chance|]|onHit_conditionsTarget[condition|magnitude|duration|chance|]|" + "];")) }; - - model.actorEffects.add({id: "bless", name: "Bless", iconID: "items_tiles:318", hasAbilityEffect: 1, attackChance: 15, blockChance: 5}); - model.actorEffects.add({id: "poison_weak", name: "Weak Poison", iconID: "items_tiles:340", hasRoundEffect: 1, round_visualEffectID: 2, round_boostHP_Min: -1, round_boostHP_Max: -1}); - - model.quests.add({id: "testQuest", name: "Test quest", stages: [ { progress: 10, logText: "Stage 10"} , { progress: 20, logText: "Stage 20", finishesQuest: 1 } ] }); - - model.items.add({iconID: "items_tiles:70", name: "Test item", searchTag: "item0", category: 0, baseMarketCost: 51, hasEquipEffect: 1, equip_attackChance: 10, equip_attackDamage_Min: 2, equip_attackDamage_Max: 4}); - model.items.add({iconID: "items_tiles:266", name: "Ring of damage +1", searchTag: "dmg_ring1", category: 7, baseMarketCost: 62, hasEquipEffect: 1, equip_attackDamage_Min: 1, equip_attackDamage_Max: 1}); - - model.droplists.add({id: "merchant1", items: [ { itemID: 'dmg_ring1', quantity_Min: 4, quantity_Max: 5, chance: 100 } , { itemID: 'item0', quantity_Min: 1, quantity_Max: 1, chance: 100 } ] } ); - - model.monsters.add({name: "Small ant", iconID: "monsters_insects:2", maxHP: 30, size: '1x1'}); - model.monsters.add({name: "Red ant", iconID: "monsters_insects:3", maxHP: 20, size: '1x1'}); - model.monsters.add({name: "Wasp", iconID: "monsters_insects:1", maxHP: 10, size: '1x1'}); - + addExampleModelItems(model); $( "#left #tools" ).accordion({ fillSpace: true }); tabs = new EditorTabs( $( "#center #tabs" ) ); - bindEditorType(model.actorEffects, $( "#tools #effectlist" ), createStatusEffectEditor, function() { - return {name: "New Effect", id: 'new_effect' }; + bindEditorType(model.actorConditions, $( "#tools #actorconditionlist" ), createActorConditionEditor, function() { + return {name: "New Condition", id: 'new_condition' }; }); bindEditorType(model.quests, $( "#tools #questlist" ), createQuestEditor, function() { return {name: "New Quest", id: 'new_quest' }; @@ -332,39 +130,17 @@ function startEditor() { bindEditorType(model.droplists, $( "#tools #droplist" ), createDroplistEditor, function() { return {id: "new_droplist" }; }); + bindEditorType(model.dialogue, $( "#tools #conversationlist" ), createConversationEditor, function() { + return {id: "new_conversation" }; + }); bindEditorType(model.monsters, $( "#tools #monsterlist" ), createMonsterEditor, function() { return {name: "New Monster", maxAP: 10, attackCost: 5, moveCost: 5 }; }); - var importExportDialog; - $( "#buttons #import" ) - .button() - .click(function() { - importExportDialog.dialog({ title: "Import data" }); - $( "div", importExportDialog ).show(); - prepareImport(model.actorEffects, $( "#statuseffects", importExportDialog )); - prepareImport(model.quests, $( "#quests", importExportDialog )); - prepareImport(model.items, $( "#items", importExportDialog )); - prepareImport(model.droplists, $( "#droplists", importExportDialog )); - prepareImport(model.dialogue, $( "#dialogue", importExportDialog )); - prepareImport(model.monsters, $( "#monsters", importExportDialog )); - importExportDialog.dialog( "open" ); - }); - $( "#buttons #export" ) - .button() - .click(function() { - importExportDialog.dialog({ title: "Export data" }); - exportIfExists(model.actorEffects, $( "#statuseffects", importExportDialog )); - exportIfExists(model.quests, $( "#quests", importExportDialog )); - exportIfExists(model.items, $( "#items", importExportDialog )); - exportIfExists(model.droplists, $( "#droplists", importExportDialog )); - exportIfExists(model.dialogue, $( "#dialogue", importExportDialog )); - exportIfExists(model.monsters, $( "#monsters", importExportDialog )); - $( "#import", importExportDialog ).hide(); - importExportDialog.dialog( "open" ); - }); + $( "#buttons #import" ).button().click( showImportDialog ); + $( "#buttons #export" ).button().click( showExportDialog ); var defaultButtons = { Close: function() { $( this ).dialog( "close" ); } @@ -417,7 +193,7 @@ function startEditor() { imageSelector = new ImageSelector("http://andors-trail.googlecode.com/svn/trunk/AndorsTrail/res/drawable/", $( "#dialog-images" ) ); - imageSelector.add(new TilesetImage("items_tiles", {x: 14, y:30}, {x:34, y:34}, [ 'items', 'effects' ] )); + imageSelector.add(new TilesetImage("items_tiles", {x: 14, y:30}, {x:34, y:34}, [ 'items', 'conditions' ] )); imageSelector.add(new TilesetImage("monsters_armor1", {x: 1, y:1}, undefined, [ 'monsters' ] )); imageSelector.add(new TilesetImage("monsters_demon1", {x: 1, y:1}, {x:64, y:64}, [ 'monsters' ] )); imageSelector.add(new TilesetImage("monsters_demon2", {x: 1, y:1}, undefined, [ 'monsters' ] )); diff --git a/AndorsTrailEdit/DataStore.js b/AndorsTrailEdit/DataStore.js index faac266be..c64053aed 100644 --- a/AndorsTrailEdit/DataStore.js +++ b/AndorsTrailEdit/DataStore.js @@ -36,6 +36,11 @@ function DataStore(objectTypename, fieldList, nameField) { } this.get = function(index) { return this.items[index]; } this.clear = function() { this.items = {}; } + this.findById = function(id) { + for (var i = 0; i < this.items.length; ++i) { + if (this.items[i].id == id) return this.items[i]; + } + } this.onAdded = function(obj) { } this.onNameChanged = function(obj, name) { } diff --git a/AndorsTrailEdit/EditorFunctions.js b/AndorsTrailEdit/EditorFunctions.js new file mode 100644 index 000000000..1582b6a51 --- /dev/null +++ b/AndorsTrailEdit/EditorFunctions.js @@ -0,0 +1,134 @@ + +function changeHidesElement(changedElement, elementToHide, visibilityEvaluator) { + changedElement.change(function () { + if (visibilityEvaluator()) { + elementToHide.fadeIn("slow"); + } else { + elementToHide.fadeOut("slow"); + } + }); + elementToHide.toggle(visibilityEvaluator()); +} + +function checkboxHidesElement(checkbox, element, visibleCondition) { + var visible = bool(visibleCondition); + checkbox.attr("checked", visible); + var evaluator = function() { return checkbox.attr("checked"); }; + changeHidesElement(checkbox, element, evaluator); +} + +function checkboxShowsElement(checkbox, element, visibleCondition) { + var visible = !bool(visibleCondition); + checkbox.attr("checked", visible); + var evaluator = function() { return !checkbox.attr("checked"); }; + changeHidesElement(checkbox, element, evaluator); +} + +function bool(v) { + if (typeof(v) == 'undefined') return false; + if (v == '') return false; + if (v == '0') return false; + if (v == 'false') return false; + return true; +} + +function setInputFieldsToObjectValues(div, obj) { + div.find("input,select,textarea").each(function() { + $(this).val(obj[$(this).attr("id")]); + }); + div.find("input:checkbox").each(function() { + $(this).attr("checked", bool(obj[$(this).attr("id")])); + }); +} + +function bindInputFieldChangesToObject(div, obj) { + div.find("input,select,textarea").unbind("change").change(function() { + obj[$(this).attr("id")] = $(this).val(); + }); + div.find("input:checkbox").unbind("change").change(function() { + obj[$(this).attr("id")] = $(this).attr("checked") ? 1 : 0; + }); +} + +function applyEditorBindingsForObject(div, obj) { + div.find("input").addClass("ui-widget-content ui-corner-all"); + setInputFieldsToObjectValues(div, obj); + bindInputFieldChangesToObject(div, obj); +} + +function applyCommonEditorBindings(div, obj, dataStore) { + applyEditorBindingsForObject(div, obj); + if (dataStore) { + div.find("#" + dataStore.nameField).change(function() { dataStore.onNameChanged(obj, $(this).val()); }); + } +} + +function bindFieldToDataStore(field, dataStore, converter) { + var dataCallback = function(request, response) { + var result = []; + var pattern = new RegExp(request.term, "i"); + dataStore.items.forEach(function(obj) { + var name = converter(obj); + if (name.match(pattern)) { + result.push(name); + } + }); + response(result); + }; + field.autocomplete( "destroy" ).autocomplete({ + source: dataCallback, + minLength: 0, + select: function(event, ui) { + field.val(ui.item.value); + field.change(); + } + }); +} + +function applyTableEditor(input) { + + var updateRowText = function(row, obj) { + $( "td", row ).each(function() { + var id = $( this ).attr("id"); + var val = obj[id]; + val = val ? val : ""; + $( this ).text(val).shorten({ + width: '200' + }).css('display',''); + }); + }; + + var onItemSelected = input.onItemSelected ? input.onItemSelected : function(obj, row) { + var dialog = input.dialog; + applyEditorBindingsForObject( dialog, obj ); + if (input.editorSetup) { input.editorSetup(dialog); } + dialog.unbind( "dialogclose" ).bind( "dialogclose", function() { + updateRowText(row, obj); + }); + dialog.dialog( "open" ); + }; + + var table = input.table; + var addToList = function(obj) { + var row = $( "" ); + table.find("th").each(function() { + var id = $( this ).attr("id"); + row.append( $( "" ).attr("id", id) ); + }); + updateRowText(row, obj); + table.append(row); + row.click(function() { onItemSelected(obj, row); }); + return row; + }; + table.parent().find("#add").button().unbind("click").click(function() { + var obj = input.templateFunction(); + input.array.push( obj ); + if (input.onItemAdded) { input.onItemAdded(obj); } + addToList( obj ).click(); + }); + table.addClass("ui-corner-all"); + $( "thead", table ).addClass("ui-widget-header"); + $( "tbody", table ).empty(); + input.array.forEach(addToList); +} + diff --git a/AndorsTrailEdit/Editor_ActorCondition.js b/AndorsTrailEdit/Editor_ActorCondition.js new file mode 100644 index 000000000..3013eccb2 --- /dev/null +++ b/AndorsTrailEdit/Editor_ActorCondition.js @@ -0,0 +1,12 @@ + +function createActorConditionEditor(obj) { + var div = $( "#templates #editActorCondition" ).clone(); + applyCommonEditorBindings(div, obj, model.actorConditions); + checkboxHidesElement(div.find('#hasRoundEffect'), div.find('#hasRoundEffectDisplay'), obj.hasRoundEffect); + checkboxHidesElement(div.find('#hasFullRoundEffect'), div.find('#hasFullRoundEffectDisplay'), obj.hasFullRoundEffect); + checkboxHidesElement(div.find('#hasAbilityEffect'), div.find('#hasAbilityEffectDisplay'), obj.hasAbilityEffect); + checkboxHidesElement(div.find('#hasCritical'), div.find('#hasCriticalDisplay'), obj.criticalChance || obj.criticalMultiplier); + imageSelector.imageify(div.find('#actorconditionimage'), div.find('#iconID'), 'conditions'); + return div; +} + diff --git a/AndorsTrailEdit/Editor_Conversation.js b/AndorsTrailEdit/Editor_Conversation.js new file mode 100644 index 000000000..1aa67e9d9 --- /dev/null +++ b/AndorsTrailEdit/Editor_Conversation.js @@ -0,0 +1,302 @@ + + +function createConversationEditor(obj) { + var div = $( "#templates #editDialogue" ).clone(true); + + var treeDiv = $ ( "#dialogueTree", div ); + treeDiv.dynatree({ + title: "Conversation flow" + ,imagePath: 'img' + }); + var tree = treeDiv.dynatree("getTree"); + + var rootNode = treeDiv.dynatree("getRoot"); + updatePhraseTreeNodesBelow(tree, rootNode, obj); + + treeDiv.dynatree({ + onActivate: function(node) { + onConversationPhraseSelected(div, node.data.model, tree); + } + }); + + tree.activateKey(obj.id); + + return div; +} + +function getPhraseByPhraseID(phraseID) { + if (!phraseID) return; + return model.dialogue.findById(phraseID); +} + +function onConversationPhraseSelected(div, obj, tree) { + var dialoguePhrase = $( "#dialoguePhrase", div ); + var dialogueReply = $( "#dialogueReply", div ); + var dialoguePhraseReplies = $( "#dialoguePhraseReplies", div ); + dialogueReply.hide(); + dialoguePhrase.hide(); + dialoguePhraseReplies.hide(); + if (!obj) return; + + var treeNodeKey = getTreeNodeKey(obj); + var treeNode = tree.getNodeByKey(treeNodeKey); + if (!treeNode) { + treeNode = updatePhraseTreeNodesBelow(tree, tree.getRoot(), obj, true); + } + + treeNode.activateSilently(); + + applyCommonEditorBindings(div, obj, model.dialogue); + + if (obj.isPhrase) { + buildEditorForPhrase(div, obj, tree, treeNode); + } else { + buildEditorForReply(div, obj, tree, treeNode); + } +} + +// ======================================================== +// Set up editor for NPC phrases + +function buildEditorForPhrase(div, phrase, tree, treeNode) { + var dialoguePhrase = $( "#dialoguePhrase", div ); + var dialoguePhraseReplies = $( "#dialoguePhraseReplies", div ); + + checkboxHidesElement( $( '#hasProgressQuest', dialoguePhrase ), $( '#hasProgressQuestDisplay', dialoguePhrase ), phrase.progressQuest); + checkboxHidesElement( $( '#hasRewardDroplist', dialoguePhrase ), $( '#hasRewardDroplistDisplay', dialoguePhrase ), phrase.rewardDropListID); + bindFieldToDataStore( $( "#progressQuest", dialoguePhrase ), model.quests , function(obj) { return obj.id; } ); + bindFieldToDataStore( $( "#rewardDropListID", dialoguePhrase ), model.droplists , function(obj) { return obj.id; } ); + + var reloadReplyTable = function() { + applyTableEditor({ + table: $( "#replies", dialoguePhraseReplies ), + array: phrase.replies, + templateFunction: function() { return createReplyForPhrase(phrase); }, + onItemSelected: function(obj) { + onConversationPhraseSelected(div, obj, tree); + }, + onItemAdded: function(addedObject) { + updatePhraseReplyTreeNodesBelow(tree, treeNode, phrase); + } + }); + } + reloadReplyTable(); + + var hasOnlyNextReply = $( '#hasOnlyNextReply', dialoguePhraseReplies ); + checkboxHidesElement( hasOnlyNextReply, $( '#hasOnlyNextReplyDisplay', dialoguePhraseReplies ), phrase.hasOnlyNextReply); + checkboxShowsElement( hasOnlyNextReply, $( '#hasRepliesDisplay', dialoguePhraseReplies ), !phrase.hasOnlyNextReply); + + hasOnlyNextReply.change(function() { + if ( $(this).attr("checked") ) { + var nextReply = createReplyForPhrase(phrase); + nextReply.text = 'N'; + phrase.replies = [ nextReply ]; + } else { + phrase.replies = [ ]; + reloadReplyTable(); + } + updatePhraseReplyTreeNodesBelow(tree, treeNode, phrase); + }); + var nextPhraseID = $( "#nextPhraseID", dialoguePhraseReplies ); + + nextPhraseID.unbind("change").change(function() { + phrase.replies[0].nextPhraseID = $( this ).val(); + updatePhraseReplyTreeNodesBelow(tree, treeNode, phrase); + }); + if (phrase.hasOnlyNextReply) { + nextPhraseID.val(phrase.replies[0].nextPhraseID); + } + + $( "#followNextReply", dialoguePhraseReplies ).button().unbind('click').click(function() { + openNextPhrase(nextPhraseID.val(), div, phrase.replies[0], tree); + }); + + $( '#message', dialoguePhrase ).change(function() { treeNode.setTitle( getPhraseNodeText(phrase) ); }); + + dialoguePhrase.show(); + dialoguePhraseReplies.show(); +} + +function createReplyForPhrase(phrase) { + return { + id: phrase.id, + isPhrase: false, + phrase: phrase + }; +} + +function openNextPhrase(nextPhraseID, div, reply, tree) { + var createNewPhrase = true; + var phrase; + if (nextPhraseID) { + phrase = getPhraseByPhraseID(nextPhraseID); + if (phrase) { + createNewPhrase = false; + } + } else { + nextPhraseID = generatePhraseID(reply.phrase.id); + } + + if (createNewPhrase) { + phrase = { id: nextPhraseID, isPhrase: true }; + model.dialogue.add(phrase); + } + reply.nextPhraseID = nextPhraseID; + + var treeNodeKey = getTreeNodeKey(reply.phrase); + var treeNode = tree.getNodeByKey(treeNodeKey); + updatePhraseReplyTreeNodesBelow(tree, treeNode, reply.phrase); + //alert("followNextReply: " + nextPhraseID); + onConversationPhraseSelected(div, phrase, tree); +} + +var phraseIDPattern = new RegExp("^(.*)(\d+)$", 'g'); +function generatePhraseID(previousPhraseID) { + var suffix; + var n = 1; + + var match = /^(.*)(\d+)$/(previousPhraseID); + if (match) { + suffix = match[1]; + n = parseInt(match[2]) + 1; + } else { + suffix = previousPhraseID + "_"; + } + + for (var i = n; i < 1000; ++i) { + var phraseID = suffix + i; + if (!getPhraseByPhraseID(phraseID)) return phraseID; + } +} + +// ======================================================== +// Set up editor for replies + +function buildEditorForReply(div, reply, tree, treeNode) { + var dialogueReply = $( "#dialogueReply", div ); + + checkboxHidesElement( $( '#requiresItems', dialogueReply ), $( '#requiresItemsDisplay', dialogueReply ), reply.requires_itemID); + checkboxHidesElement( $( '#requiresQuest', dialogueReply ), $( '#requiresQuestDisplay', dialogueReply ), reply.requires_Progress); + bindFieldToDataStore( $( "#requires_itemID", dialogueReply ), model.items , function(obj) { return obj.searchTag; } ); + bindFieldToDataStore( $( "#requires_Progress", dialogueReply ), model.quests , function(obj) { return obj.id; } ); + + var replyLeadsTo = $( "#replyLeadsTo", dialogueReply ); + replyLeadsTo.change(function() { nextPhraseID.val( $(this).val() ).change(); }); + replyLeadsTo.val(reply.nextPhraseID); + changeHidesElement(replyLeadsTo, $( "#nextPhraseIDDisplay", dialogueReply ) , function() { return replyLeadsTo.val() == ''; } ); + + var nextPhraseID = $( "#nextPhraseID", dialogueReply ); + nextPhraseID.change(function() { + updatePhraseTreeNodesBelow(tree, treeNode, getPhraseByPhraseID(reply.nextPhraseID) ); + }); + + $( "#followReply", dialogueReply ).button().unbind('click').click(function() { + openNextPhrase(nextPhraseID.val(), div, reply, tree); + }); + + $( '#text', dialogueReply ).change(function() { treeNode.setTitle( getReplyNodeText(reply) ); }); + + dialogueReply.show(); +} + + +// ======================================================== +// Tree node key generators + + function getTreeNodeKey(obj) { + if (!obj) return ""; + if (obj.isPhrase) return obj.id; + return getTreeNodeReplyKey(obj); + } + + function getTreeNodeReplyKey(obj) { + var idx = 0; + for (var i = 0; i < obj.phrase.replies.length; ++i) { + if (obj.phrase.replies[i] == obj) { + idx = i; + break; + } + } + return getTreeNodeReplyKeyIndex(obj, idx); + } + + function getTreeNodeReplyKeyIndex(obj, idx) { + return getTreeNodeKey(obj.phrase) + "__reply_" + idx; + } + + +// ======================================================== +// Tree node title generators + + function getPhraseNodeText(phrase) { + return phrase.message ? phrase.message : "(no phrase text)"; + } + + function getReplyNodeText(reply) { + return reply.text ? reply.text : "(no reply text)"; + } + +// ======================================================== +// Tree-building functions + + // (re)Build a NPC phrase node + function updatePhraseTreeNodesBelow(tree, parent, phrase, keepExisting) { + if (!keepExisting) { parent.removeChildren(); } + + if (!phrase) return; + + phrase.isPhrase = true; + var key = getTreeNodeKey(phrase); + + if (tree.getNodeByKey(key)) { + parent.addChild({ + title: '(conversation loop)' + ,model: phrase + }); + return; + } + + var phraseNode = parent.addChild({ + title: getPhraseNodeText(phrase) + ,key: key + ,model: phrase + ,icon: 'phrase.png' + }); + + if (!phrase.replies) phrase.replies = []; + updatePhraseReplyTreeNodesBelow(tree, phraseNode, phrase, phrase.replies); + + phraseNode.expand(true); + return phraseNode; + } + + // (re)Build all nodes below a NPC phrase (i.e. rebuild all reply nodes) + function updatePhraseReplyTreeNodesBelow(tree, phraseNode, phrase) { + phraseNode.removeChildren(); + + if (!phrase.replies) phrase.replies = []; + + if (phrase.replies.length == 1) { + var singleReply = phrase.replies[0]; + if (singleReply.text == 'N') { + phrase.hasOnlyNextReply = true; + updatePhraseTreeNodesBelow(tree, phraseNode, getPhraseByPhraseID(singleReply.nextPhraseID) ); + return; + } + } + + phrase.replies.forEach(function(reply, idx) { + jQuery.extend(reply, createReplyForPhrase(phrase)); + var key = getTreeNodeReplyKeyIndex(reply, idx); + var replyNode = phraseNode.addChild({ + title: getReplyNodeText(reply) + ,key: key + ,model: reply + ,icon: 'reply.png' + }); + if (reply.nextPhraseID) { + updatePhraseTreeNodesBelow(tree, replyNode, getPhraseByPhraseID(reply.nextPhraseID) ); + } + replyNode.expand(true); + }); + } diff --git a/AndorsTrailEdit/Editor_Droplist.js b/AndorsTrailEdit/Editor_Droplist.js new file mode 100644 index 000000000..e1edbb08f --- /dev/null +++ b/AndorsTrailEdit/Editor_Droplist.js @@ -0,0 +1,18 @@ + +function createDroplistEditor(obj) { + var div = $( "#templates #editDroplist" ).clone(true); + applyCommonEditorBindings(div, obj, model.droplists); + if (!obj.items) obj.items = []; + + applyTableEditor({ + table: $( "#items", div ), + dialog: droplistItemDialog, + array: obj.items, + templateFunction: function() { return { quantity: 1, chance: 100 } }, + editorSetup: function(div) { + bindFieldToDataStore( $( "#itemID", div ), model.items , function(obj) { return obj.searchTag; } ); + } + }); + + return div; +} diff --git a/AndorsTrailEdit/Editor_Item.js b/AndorsTrailEdit/Editor_Item.js new file mode 100644 index 000000000..ff632fd39 --- /dev/null +++ b/AndorsTrailEdit/Editor_Item.js @@ -0,0 +1,60 @@ + +function createItemEditor(obj) { + var div = $( "#templates #editItem" ).clone(); + applyCommonEditorBindings(div, obj, model.items); + checkboxHidesElement(div.find('#hasEquipEffect'), div.find('#hasEquipEffectDisplay'), obj.hasEquipEffect); + checkboxHidesElement(div.find('#hasUseEffect'), div.find('#hasUseEffectDisplay'), obj.hasUseEffect); + checkboxHidesElement(div.find('#equip_hasCritical'), div.find('#equip_hasCriticalDisplay'), obj.equip_criticalChance || obj.equip_criticalMultiplier); + checkboxHidesElement(div.find('#hasHitEffect'), div.find('#hasHitEffectDisplay'), obj.hasHitEffect); + checkboxHidesElement(div.find('#hasKillEffect'), div.find('#hasKillEffectDisplay'), obj.hasKillEffect); + imageSelector.imageify(div.find('#itemimage'), div.find('#iconID'), 'items'); + + var createNewCondition = function() { return { chance: 100, magnitude: 1 }; } + if (!obj.equip_conditions) obj.equip_conditions = []; + if (!obj.use_conditionsSource) obj.use_conditionsSource = []; + if (!obj.hit_conditionsSource) obj.hit_conditionsSource = []; + if (!obj.hit_conditionsTarget) obj.hit_conditionsTarget = []; + if (!obj.kill_conditionsSource) obj.kill_conditionsSource = []; + var setupEditor = function(div) { + bindFieldToDataStore( $( "#condition", div ), model.actorConditions , function(obj) { return obj.id; } ); + } + + applyTableEditor({ + table: $( "#equip_conditions", div ), + dialog: equipConditionsDialog, + array: obj.equip_conditions, + templateFunction: createNewCondition, + editorSetup: setupEditor + }); + applyTableEditor({ + table: $( "#use_conditionsSource", div ), + dialog: onHitConditionsDialog, + array: obj.use_conditionsSource, + templateFunction: createNewCondition, + editorSetup: setupEditor + }); + applyTableEditor({ + table: $( "#hit_conditionsSource", div ), + dialog: onHitConditionsDialog, + array: obj.hit_conditionsSource, + templateFunction: createNewCondition, + editorSetup: setupEditor + }); + applyTableEditor({ + table: $( "#hit_conditionsTarget", div ), + dialog: onHitConditionsDialog, + array: obj.hit_conditionsTarget, + templateFunction: createNewCondition, + editorSetup: setupEditor + }); + applyTableEditor({ + table: $( "#kill_conditionsSource", div ), + dialog: onHitConditionsDialog, + array: obj.kill_conditionsSource, + templateFunction: createNewCondition, + editorSetup: setupEditor + }); + + return div; +} + diff --git a/AndorsTrailEdit/Editor_Monster.js b/AndorsTrailEdit/Editor_Monster.js new file mode 100644 index 000000000..302c43813 --- /dev/null +++ b/AndorsTrailEdit/Editor_Monster.js @@ -0,0 +1,34 @@ + +function createMonsterEditor(obj) { + var div = $( "#templates #editMonster" ).clone(); + applyCommonEditorBindings(div, obj, model.monsters); + checkboxHidesElement(div.find('#hasConversation'), div.find('#hasConversationDisplay'), obj.phraseID); + checkboxHidesElement(div.find('#hasCombat'), div.find('#hasCombatDisplay'), obj.attackChance); + checkboxHidesElement(div.find('#hasCritical'), div.find('#hasCriticalDisplay'), obj.criticalChance || obj.criticalMultiplier); + checkboxHidesElement(div.find('#hasHitEffect'), div.find('#hasHitEffectDisplay'), obj.hasHitEffect); + imageSelector.imageify(div.find('#monsterimage'), div.find('#iconID'), 'monsters'); + bindFieldToDataStore( $( "#droplistID", div ), model.droplists , function(obj) { return obj.id; } ); + + var createNewCondition = function() { return { chance: 100, magnitude: 1 }; } + if (!obj.onHit_conditionsSource) obj.onHit_conditionsSource = []; + if (!obj.onHit_conditionsTarget) obj.onHit_conditionsTarget = []; + var setupEditor = function(div) { + bindFieldToDataStore( $( "#condition", div ), model.actorConditions , function(obj) { return obj.id; } ); + } + applyTableEditor({ + table: $( "#onHit_conditionsSource", div ), + dialog: onHitConditionsDialog, + array: obj.onHit_conditionsSource, + templateFunction: createNewCondition, + editorSetup: setupEditor + }); + applyTableEditor({ + table: $( "#onHit_conditionsTarget", div ), + dialog: onHitConditionsDialog, + array: obj.onHit_conditionsTarget, + templateFunction: createNewCondition, + editorSetup: setupEditor + }); + return div; +} + diff --git a/AndorsTrailEdit/Editor_Quest.js b/AndorsTrailEdit/Editor_Quest.js new file mode 100644 index 000000000..dc1af51cd --- /dev/null +++ b/AndorsTrailEdit/Editor_Quest.js @@ -0,0 +1,21 @@ + +function createQuestEditor(obj) { + var div = $( "#templates #editQuest" ).clone(true); + applyCommonEditorBindings(div, obj, model.quests); + if (!obj.stages) obj.stages = []; + var array = obj.stages; + var createNewStage = function() { + var nextProgress; + if (array.length > 0) { nextProgress = parseInt(array[array.length - 1].progress) + 10; } + if (!nextProgress) { nextProgress = 10; } + return { progress: nextProgress }; + }; + applyTableEditor({ + table: $( "#stages", div ), + dialog: questlogDialog, + array: array, + templateFunction: createNewStage + }); + return div; +} + diff --git a/AndorsTrailEdit/ImportExport.js b/AndorsTrailEdit/ImportExport.js new file mode 100644 index 000000000..51f121545 --- /dev/null +++ b/AndorsTrailEdit/ImportExport.js @@ -0,0 +1,55 @@ + +function exportIfExists(dataStore, div) { + var exists = false; + if (dataStore && dataStore.items.length > 0) exists = true; + div.toggle(exists); + if (!exists) { return; } + var exportData = dataStore.serialize(); + $( "#value" , div ).val(exportData); +} + +function importDatastore(dataStore, content) { + dataStore.deserialize(content); +} + +function prepareImport(dataStore, div) { + var importButton = $( "#import", div ); + var textarea = $( "#value", div ); + importButton.button({ disabled: true }).click(function() { + if (!textarea.val()) return; + importDatastore(dataStore, textarea.val()); + div.hide('slow'); + }); + textarea.val("").change(function() { + var disabled = $(this).val() ? false : true; + importButton.button( "option", "disabled", disabled ); + }); +} + + +var importExportDialog; + +function showImportDialog() { + importExportDialog.dialog({ title: "Import data" }); + $( "div", importExportDialog ).show(); + prepareImport(model.actorConditions, $( "#actorconditions", importExportDialog )); + prepareImport(model.quests, $( "#quests", importExportDialog )); + prepareImport(model.items, $( "#items", importExportDialog )); + prepareImport(model.droplists, $( "#droplists", importExportDialog )); + prepareImport(model.dialogue, $( "#dialogue", importExportDialog )); + prepareImport(model.monsters, $( "#monsters", importExportDialog )); + importExportDialog.dialog( "open" ); +} + +function showExportDialog() { + importExportDialog.dialog({ title: "Export data" }); + exportIfExists(model.actorConditions, $( "#actorconditions", importExportDialog )); + exportIfExists(model.quests, $( "#quests", importExportDialog )); + exportIfExists(model.items, $( "#items", importExportDialog )); + exportIfExists(model.droplists, $( "#droplists", importExportDialog )); + exportIfExists(model.dialogue, $( "#dialogue", importExportDialog )); + exportIfExists(model.monsters, $( "#monsters", importExportDialog )); + $( "#import", importExportDialog ).hide(); + importExportDialog.dialog( "open" ); +} + diff --git a/AndorsTrailEdit/editdialog.html b/AndorsTrailEdit/editdialog.html deleted file mode 100644 index 5f7e185bf..000000000 --- a/AndorsTrailEdit/editdialog.html +++ /dev/null @@ -1 +0,0 @@ - Dialog Editor
Phrases:

\ No newline at end of file diff --git a/AndorsTrailEdit/editdroplists.html b/AndorsTrailEdit/editdroplists.html deleted file mode 100644 index d5ac0bc19..000000000 --- a/AndorsTrailEdit/editdroplists.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - Droplist Editor - - - - -
- Items:
-
- - - - - - -
-
-
-
-
-
- -
-
-
-
-
- - diff --git a/AndorsTrailEdit/edititems.html b/AndorsTrailEdit/edititems.html deleted file mode 100644 index 498ef975e..000000000 --- a/AndorsTrailEdit/edititems.html +++ /dev/null @@ -1,57 +0,0 @@ - - - - - - - - - - Item Editor - - - - -
- Items:
-
- - - - - - -
-
-
-
-
-
- -
-
-
-
-
- - diff --git a/AndorsTrailEdit/editmonsters.html b/AndorsTrailEdit/editmonsters.html deleted file mode 100644 index dec831da4..000000000 --- a/AndorsTrailEdit/editmonsters.html +++ /dev/null @@ -1,93 +0,0 @@ - - - - - - - - - - Monster Editor - - - - -
- Monsters:
-
- - - - - - -
-
-
-
-
-
- -
-
-
-
-
- - diff --git a/AndorsTrailEdit/editor.html b/AndorsTrailEdit/editor.html index bb61b6974..f10ea7636 100644 --- a/AndorsTrailEdit/editor.html +++ b/AndorsTrailEdit/editor.html @@ -6,7 +6,9 @@ + + Andor's Trail Content Editor @@ -17,7 +19,7 @@
@@ -28,8 +30,8 @@
-

Actor status effects

-
+

Actor conditions

+
Add
@@ -54,11 +56,7 @@

Dialogue

-
    -
  • TODO: Conversation 1
  • -
  • TODO: Conversation 2
  • -
  • TODO: Conversation 3
  • -
+
Add
@@ -226,7 +224,7 @@
- +
@@ -409,7 +407,7 @@
- + @@ -432,7 +430,7 @@
-
- +
Condition
@@ -457,7 +455,7 @@
-
- +
Condition
@@ -471,7 +469,7 @@
Add
- +
Condition
@@ -496,7 +494,7 @@
-
- +
Condition
@@ -515,7 +513,7 @@
- +
@@ -582,18 +580,131 @@
Finishes quest
+ + + + + + +
+

Dialogue

+
+ Conversation flow +
+
+
+ NPC phrase +
+ + +
+
+ + +
+
+
Reaching this phrase progresses quest
+
+
+ + +
+
+
Reaching this phrase gives items
+
+
+ + +
+
+
+ Replies +
+
Phrase leads directly to another phrase without replies
+
+
+ +
+ + Follow +
+
+
+ +
Condition
+ + + + + + +
Reply
+
Add
+
+ +
+ Player reply +
+ + +
+
+ + +
+
+ + +
+
+ +
+ + Follow +
+
+
+
Player must have item(s) to select this reply
+
+
+
+ + +
+
+ + +
+
+
+
Player must have progressed quest to select this reply
+
+
+ + +
+ +
+
+
- + -
-

Actor status effect

+
+

Actor condition

General
-
+
@@ -712,9 +823,9 @@
-
-
Actor status effects
-
This data corresponds to res/values/actorstatuseffects.xml in the source code.
+
+
Actor conditions
+
This data corresponds to res/values/actorconditions.xml in the source code.
Import
diff --git a/AndorsTrailEdit/editquestlogs.html b/AndorsTrailEdit/editquestlogs.html deleted file mode 100644 index a5ec7a077..000000000 --- a/AndorsTrailEdit/editquestlogs.html +++ /dev/null @@ -1,47 +0,0 @@ - - - - - - - - - - Quest Log Editor - - - - -
- Items:
-
- - - - - - -
-
-
-
-
-
- -
-
-
-
-
- - diff --git a/AndorsTrailEdit/editquests.html b/AndorsTrailEdit/editquests.html deleted file mode 100644 index db3f34ab1..000000000 --- a/AndorsTrailEdit/editquests.html +++ /dev/null @@ -1,46 +0,0 @@ - - - - - - - - - - Quest Editor - - - - -
- Items:
-
- - - - - - -
-
-
-
-
-
- -
-
-
-
-
- - diff --git a/AndorsTrailEdit/imgarrowright.png b/AndorsTrailEdit/imgarrowright.png new file mode 100644 index 000000000..1009e8246 Binary files /dev/null and b/AndorsTrailEdit/imgarrowright.png differ diff --git a/AndorsTrailEdit/imgphrase.png b/AndorsTrailEdit/imgphrase.png new file mode 100644 index 000000000..5ca1e8a13 Binary files /dev/null and b/AndorsTrailEdit/imgphrase.png differ diff --git a/AndorsTrailEdit/imgreply.png b/AndorsTrailEdit/imgreply.png new file mode 100644 index 000000000..38d6b74be Binary files /dev/null and b/AndorsTrailEdit/imgreply.png differ diff --git a/AndorsTrailEdit/inc/icons.gif b/AndorsTrailEdit/inc/icons.gif new file mode 100644 index 000000000..a58eb93f1 Binary files /dev/null and b/AndorsTrailEdit/inc/icons.gif differ diff --git a/AndorsTrailEdit/inc/jquery.dynatree.min.js b/AndorsTrailEdit/inc/jquery.dynatree.min.js new file mode 100644 index 000000000..9791d55cb --- /dev/null +++ b/AndorsTrailEdit/inc/jquery.dynatree.min.js @@ -0,0 +1,252 @@ +// jquery.dynatree.js build 1.1.1 +// Revision: 481, date: 2011-03-02 07:25:35 +// Copyright (c) 2008-10 Martin Wendt (http://dynatree.googlecode.com/) +// Dual licensed under the MIT or GPL Version 2 licenses. + +var _canLog=true;function _log(mode,msg){if(!_canLog){return;} +var args=Array.prototype.slice.apply(arguments,[1]);var dt=new Date();var tag=dt.getHours()+":"+dt.getMinutes()+":"+dt.getSeconds()+"."+dt.getMilliseconds();args[0]=tag+" - "+args[0];try{switch(mode){case"info":window.console.info.apply(window.console,args);break;case"warn":window.console.warn.apply(window.console,args);break;default:window.console.log.apply(window.console,args);break;}}catch(e){if(!window.console){_canLog=false;}}} +function logMsg(msg){Array.prototype.unshift.apply(arguments,["debug"]);_log.apply(this,arguments);} +var getDynaTreePersistData=null;var DTNodeStatus_Error=-1;var DTNodeStatus_Loading=1;var DTNodeStatus_Ok=0;(function($){var Class={create:function(){return function(){this.initialize.apply(this,arguments);};}};function getDtNodeFromElement(el){var iMax=5;while(el&&iMax--){if(el.dtnode){return el.dtnode;} +el=el.parentNode;} +return null;} +function noop(){} +var DynaTreeNode=Class.create();DynaTreeNode.prototype={initialize:function(parent,tree,data){this.parent=parent;this.tree=tree;if(typeof data==="string"){data={title:data};} +if(data.key===undefined){data.key="_"+tree._nodeCount++;} +this.data=$.extend({},$.ui.dynatree.nodedatadefaults,data);this.li=null;this.span=null;this.ul=null;this.childList=null;this.isLoading=false;this.hasSubSel=false;this.bExpanded=false;this.bSelected=false;},toString:function(){return"DynaTreeNode<"+this.data.key+">: '"+this.data.title+"'";},toDict:function(recursive,callback){var dict=$.extend({},this.data);dict.activate=(this.tree.activeNode===this);dict.focus=(this.tree.focusNode===this);dict.expand=this.bExpanded;dict.select=this.bSelected;if(callback){callback(dict);} +if(recursive&&this.childList){dict.children=[];for(var i=0,l=this.childList.length;i1){res+=cache.tagConnector;}}else if(this.hasChildren()!==false){res+=cache.tagExpander;}else{res+=cache.tagConnector;} +if(opts.checkbox&&data.hideCheckbox!==true&&!data.isStatusNode){res+=cache.tagCheckbox;} +if(data.icon){res+="";}else if(data.icon===false){noop();}else{res+=cache.tagNodeIcon;} +var nodeTitle="";if(opts.onCustomRender){nodeTitle=opts.onCustomRender.call(tree,this)||"";} +if(!nodeTitle){var tooltip=data.tooltip?" title='"+data.tooltip+"'":"";if(opts.noLink||data.noLink){nodeTitle=""+data.title+"";}else{nodeTitle=""+data.title+"";}} +res+=nodeTitle;return res;},_fixOrder:function(){var cl=this.childList;if(!cl||!this.ul){return;} +var childLI=this.ul.firstChild;for(var i=0,l=cl.length-1;i1){this.ul.className=cn.container+" "+cn.noConnector;}else{this.ul.className=cn.container;}}else if(parent){if(!this.li){this.li=document.createElement("li");this.li.dtnode=this;if(data.key&&opts.generateIds){this.li.id=opts.idPrefix+data.key;} +this.span=document.createElement("span");this.span.className=cn.title;this.li.appendChild(this.span);if(!parent.ul){parent.ul=document.createElement("ul");parent.ul.style.display="none";parent.li.appendChild(parent.ul);} +parent.ul.appendChild(this.li);} +this.span.innerHTML=this._getInnerHtml();var cnList=[];cnList.push(cn.node);if(data.isFolder){cnList.push(cn.folder);} +if(this.bExpanded){cnList.push(cn.expanded);} +if(this.hasChildren()!==false){cnList.push(cn.hasChildren);} +if(data.isLazy&&this.childList===null){cnList.push(cn.lazy);} +if(isLastSib){cnList.push(cn.lastsib);} +if(this.bSelected){cnList.push(cn.selected);} +if(this.hasSubSel){cnList.push(cn.partsel);} +if(tree.activeNode===this){cnList.push(cn.active);} +if(data.addClass){cnList.push(data.addClass);} +cnList.push(cn.combinedExpanderPrefix ++(this.bExpanded?"e":"c") ++(data.isLazy&&this.childList===null?"d":"") ++(isLastSib?"l":""));cnList.push(cn.combinedIconPrefix ++(this.bExpanded?"e":"c") ++(data.isFolder?"f":""));this.span.className=cnList.join(" ");this.li.className=isLastSib?cn.lastsib:"";if(opts.onRender){opts.onRender.call(tree,this,this.span);}} +if((this.bExpanded||includeInvisible===true)&&this.childList){for(var i=0,l=this.childList.length;ib.data.title?1:-1;};cl.sort(cmp);if(deep){for(var i=0,l=cl.length;i0){this.childList[0].focus();}else{this.focus();}} +break;case DTNodeStatus_Loading:this.isLoading=true;$(this.span).addClass(this.tree.options.classNames.nodeLoading);if(!this.parent){this._setStatusNode({title:this.tree.options.strings.loading+info,tooltip:tooltip,addClass:this.tree.options.classNames.nodeWait});} +break;case DTNodeStatus_Error:this.isLoading=false;this._setStatusNode({title:this.tree.options.strings.loadError+info,tooltip:tooltip,addClass:this.tree.options.classNames.nodeError});break;default:throw"Bad LazyNodeStatus: '"+lts+"'.";}},_parentList:function(includeRoot,includeSelf){var l=[];var dtn=includeSelf?this:this.parent;while(dtn){if(includeRoot||dtn.parent){l.unshift(dtn);} +dtn=dtn.parent;} +return l;},getLevel:function(){var level=0;var dtn=this.parent;while(dtn){level++;dtn=dtn.parent;} +return level;},_getTypeForOuterNodeEvent:function(event){var cns=this.tree.options.classNames;var target=event.target;if(target.className.indexOf(cns.node)<0){return null;} +var eventX=event.pageX-target.offsetLeft;var eventY=event.pageY-target.offsetTop;for(var i=0,l=target.childNodes.length;i=x&&eventX<=(x+nx)&&eventY>=y&&eventY<=(y+ny)){if(cn.className==cns.title){return"title";}else if(cn.className==cns.expander){return"expander";}else if(cn.className==cns.checkbox){return"checkbox";}else if(cn.className==cns.nodeIcon){return"icon";}}} +return"prefix";},getEventTargetType:function(event){var tcn=event&&event.target?event.target.className:"";var cns=this.tree.options.classNames;if(tcn===cns.title){return"title";}else if(tcn===cns.expander){return"expander";}else if(tcn===cns.checkbox){return"checkbox";}else if(tcn===cns.nodeIcon){return"icon";}else if(tcn===cns.empty||tcn===cns.vline||tcn===cns.connector){return"prefix";}else if(tcn.indexOf(cns.node)>=0){return this._getTypeForOuterNodeEvent(event);} +return null;},isVisible:function(){var parents=this._parentList(true,false);for(var i=0,l=parents.length;ia").focus();}catch(e){}},isFocused:function(){return(this.tree.tnFocused===this);},_activate:function(flag,fireEvents){this.tree.logDebug("dtnode._activate(%o, fireEvents=%o) - %o",flag,fireEvents,this);var opts=this.tree.options;if(this.data.isStatusNode){return;} +if(fireEvents&&opts.onQueryActivate&&opts.onQueryActivate.call(this.tree,flag,this)===false){return;} +if(flag){if(this.tree.activeNode){if(this.tree.activeNode===this){return;} +this.tree.activeNode.deactivate();} +if(opts.activeVisible){this.makeVisible();} +this.tree.activeNode=this;if(opts.persist){$.cookie(opts.cookieId+"-active",this.data.key,opts.cookie);} +this.tree.persistence.activeKey=this.data.key;$(this.span).addClass(opts.classNames.active);if(fireEvents&&opts.onActivate){opts.onActivate.call(this.tree,this);}}else{if(this.tree.activeNode===this){if(opts.onQueryActivate&&opts.onQueryActivate.call(this.tree,false,this)===false){return;} +$(this.span).removeClass(opts.classNames.active);if(opts.persist){$.cookie(opts.cookieId+"-active","",opts.cookie);} +this.tree.persistence.activeKey=null;this.tree.activeNode=null;if(fireEvents&&opts.onDeactivate){opts.onDeactivate.call(this.tree,this);}}}},activate:function(){this._activate(true,true);},activateSilently:function(){this._activate(true,false);},deactivate:function(){this._activate(false,true);},isActive:function(){return(this.tree.activeNode===this);},_userActivate:function(){var activate=true;var expand=false;if(this.data.isFolder){switch(this.tree.options.clickFolderMode){case 2:activate=false;expand=true;break;case 3:activate=expand=true;break;}} +if(this.parent===null){expand=false;} +if(expand){this.toggleExpand();this.focus();} +if(activate){this.activate();}},_setSubSel:function(hasSubSel){if(hasSubSel){this.hasSubSel=true;$(this.span).addClass(this.tree.options.classNames.partsel);}else{this.hasSubSel=false;$(this.span).removeClass(this.tree.options.classNames.partsel);}},_fixSelectionState:function(){var p,i,l;if(this.bSelected){this.visit(function(node){node.parent._setSubSel(true);node._select(true,false,false);});p=this.parent;while(p){p._setSubSel(true);var allChildsSelected=true;for(i=0,l=p.childList.length;i=0;i--){sib=parents[i].getNextSibling();if(sib){break;}}} +if(sib){sib.focus();} +break;default:handled=false;} +if(handled){event.preventDefault();}},_onKeypress:function(event){},_onFocus:function(event){var opts=this.tree.options;if(event.type=="blur"||event.type=="focusout"){if(opts.onBlur){opts.onBlur.call(this.tree,this);} +if(this.tree.tnFocused){$(this.tree.tnFocused.span).removeClass(opts.classNames.focused);} +this.tree.tnFocused=null;if(opts.persist){$.cookie(opts.cookieId+"-focus","",opts.cookie);}}else if(event.type=="focus"||event.type=="focusin"){if(this.tree.tnFocused&&this.tree.tnFocused!==this){this.tree.logDebug("dtnode.onFocus: out of sync: curFocus: %o",this.tree.tnFocused);$(this.tree.tnFocused.span).removeClass(opts.classNames.focused);} +this.tree.tnFocused=this;if(opts.onFocus){opts.onFocus.call(this.tree,this);} +$(this.tree.tnFocused.span).addClass(opts.classNames.focused);if(opts.persist){$.cookie(opts.cookieId+"-focus",this.data.key,opts.cookie);}}},visit:function(fn,includeSelf){var res=true;if(includeSelf===true){res=fn(this);if(res===false||res=="skip"){return res;}} +if(this.childList){for(var i=0,l=this.childList.length;i reloading %s...",this,keyPath,child);var self=this;child.reloadChildren(function(node,isOk){if(isOk){tree.logDebug("%s._loadKeyPath(%s) -> reloaded %s.",node,keyPath,node);callback.call(tree,child,"loaded");node._loadKeyPath(segList.join(tree.options.keyPathSeparator),callback);}else{tree.logWarning("%s._loadKeyPath(%s) -> reloadChildren() failed.",self,keyPath);callback.call(tree,child,"error");}});}else{callback.call(tree,child,"loaded");child._loadKeyPath(segList.join(tree.options.keyPathSeparator),callback);} +return;}} +tree.logWarning("Node not found: "+seg);return;},resetLazy:function(){if(this.parent===null){throw"Use tree.reload() instead";}else if(!this.data.isLazy){throw"node.resetLazy() requires lazy nodes.";} +this.expand(false);this.removeChildren();},_addChildNode:function(dtnode,beforeNode){var tree=this.tree;var opts=tree.options;var pers=tree.persistence;dtnode.parent=this;if(this.childList===null){this.childList=[];}else if(!beforeNode){if(this.childList.length>0){$(this.childList[this.childList.length-1].span).removeClass(opts.classNames.lastsib);}} +if(beforeNode){var iBefore=$.inArray(beforeNode,this.childList);if(iBefore<0){throw" must be a child of ";} +this.childList.splice(iBefore,0,dtnode);}else{this.childList.push(dtnode);} +var isInitializing=tree.isInitializing();if(opts.persist&&pers.cookiesFound&&isInitializing){if(pers.activeKey==dtnode.data.key){tree.activeNode=dtnode;} +if(pers.focusedKey==dtnode.data.key){tree.focusNode=dtnode;} +dtnode.bExpanded=($.inArray(dtnode.data.key,pers.expandedKeyList)>=0);dtnode.bSelected=($.inArray(dtnode.data.key,pers.selectedKeyList)>=0);}else{if(dtnode.data.activate){tree.activeNode=dtnode;if(opts.persist){pers.activeKey=dtnode.data.key;}} +if(dtnode.data.focus){tree.focusNode=dtnode;if(opts.persist){pers.focusedKey=dtnode.data.key;}} +dtnode.bExpanded=(dtnode.data.expand===true);if(dtnode.bExpanded&&opts.persist){pers.addExpand(dtnode.data.key);} +dtnode.bSelected=(dtnode.data.select===true);if(dtnode.bSelected&&opts.persist){pers.addSelect(dtnode.data.key);}} +if(opts.minExpandLevel>=dtnode.getLevel()){this.bExpanded=true;} +if(dtnode.bSelected&&opts.selectMode==3){var p=this;while(p){if(!p.hasSubSel){p._setSubSel(true);} +p=p.parent;}} +if(tree.bEnableUpdate){this.render();} +return dtnode;},addChild:function(obj,beforeNode){if(typeof(obj)=="string"){throw"Invalid data type for "+obj;}else if(!obj||obj.length===0){return;}else if(obj instanceof DynaTreeNode){return this._addChildNode(obj,beforeNode);} +if(!obj.length){obj=[obj];} +var prevFlag=this.tree.enableUpdate(false);var tnFirst=null;for(var i=0,l=obj.length;i=0){this.expandedKeyList.splice(idx,1);$.cookie(this.cookieId+"-expand",this.expandedKeyList.join(","),this.cookieOpts);}},addSelect:function(key){this._log("addSelect(%o)",key);if($.inArray(key,this.selectedKeyList)<0){this.selectedKeyList.push(key);$.cookie(this.cookieId+"-select",this.selectedKeyList.join(","),this.cookieOpts);}},clearSelect:function(key){this._log("clearSelect(%o)",key);var idx=$.inArray(key,this.selectedKeyList);if(idx>=0){this.selectedKeyList.splice(idx,1);$.cookie(this.cookieId+"-select",this.selectedKeyList.join(","),this.cookieOpts);}},isReloading:function(){return this.cookiesFound===true;},toDict:function(){return{cookiesFound:this.cookiesFound,activeKey:this.activeKey,focusedKey:this.activeKey,expandedKeyList:this.expandedKeyList,selectedKeyList:this.selectedKeyList};},lastentry:undefined};var DynaTree=Class.create();DynaTree.version="$Version: 1.1.1$";DynaTree.prototype={initialize:function($widget){this.phase="init";this.$widget=$widget;this.options=$widget.options;this.$tree=$widget.element;this.timer=null;this.divTree=this.$tree.get(0);_initDragAndDrop(this);},_load:function(callback){var $widget=this.$widget;var opts=this.options;this.bEnableUpdate=true;this._nodeCount=1;this.activeNode=null;this.focusNode=null;if(opts.rootVisible!==undefined){_log("warn","Option 'rootVisible' is no longer supported.");} +if(opts.minExpandLevel<1){_log("warn","Option 'minExpandLevel' must be >= 1.");opts.minExpandLevel=1;} +if(opts.classNames!==$.ui.dynatree.prototype.options.classNames){opts.classNames=$.extend({},$.ui.dynatree.prototype.options.classNames,opts.classNames);} +if(opts.ajaxDefaults!==$.ui.dynatree.prototype.options.ajaxDefaults){opts.ajaxDefaults=$.extend({},$.ui.dynatree.prototype.options.ajaxDefaults,opts.ajaxDefaults);} +if(opts.dnd!==$.ui.dynatree.prototype.options.dnd){opts.dnd=$.extend({},$.ui.dynatree.prototype.options.dnd,opts.dnd);} +if(!opts.imagePath){$("script").each(function(){var _rexDtLibName=/.*dynatree[^\/]*\.js$/i;if(this.src.search(_rexDtLibName)>=0){if(this.src.indexOf("/")>=0){opts.imagePath=this.src.slice(0,this.src.lastIndexOf("/"))+"/skin/";}else{opts.imagePath="skin/";} +logMsg("Guessing imagePath from '%s': '%s'",this.src,opts.imagePath);return false;}});} +this.persistence=new DynaTreeStatus(opts.cookieId,opts.cookie);if(opts.persist){if(!$.cookie){_log("warn","Please include jquery.cookie.js to use persistence.");} +this.persistence.read();} +this.logDebug("DynaTree.persistence: %o",this.persistence.toDict());this.cache={tagEmpty:"",tagVline:"",tagExpander:"",tagConnector:"",tagNodeIcon:"",tagCheckbox:"",lastentry:undefined};if(opts.children||(opts.initAjax&&opts.initAjax.url)||opts.initId){$(this.divTree).empty();} +var $ulInitialize=this.$tree.find(">ul:first").hide();this.tnRoot=new DynaTreeNode(null,this,{});this.tnRoot.bExpanded=true;this.tnRoot.render();this.divTree.appendChild(this.tnRoot.ul);var root=this.tnRoot;var isReloading=(opts.persist&&this.persistence.isReloading());var isLazy=false;var prevFlag=this.enableUpdate(false);this.logDebug("Dynatree._load(): read tree structure...");if(opts.children){root.addChild(opts.children);}else if(opts.initAjax&&opts.initAjax.url){isLazy=true;root.data.isLazy=true;this._reloadAjax(callback);}else if(opts.initId){this._createFromTag(root,$("#"+opts.initId));}else{this._createFromTag(root,$ulInitialize);$ulInitialize.remove();} +this._checkConsistency();this.logDebug("Dynatree._load(): render nodes...");this.enableUpdate(prevFlag);this.logDebug("Dynatree._load(): bind events...");this.$widget.bind();this.logDebug("Dynatree._load(): postInit...");this.phase="postInit";if(opts.persist){this.persistence.write();} +if(this.focusNode&&this.focusNode.isVisible()){this.logDebug("Focus on init: %o",this.focusNode);this.focusNode.focus();} +if(!isLazy&&opts.onPostInit){opts.onPostInit.call(this,isReloading,false);} +this.phase="idle";},_reloadAjax:function(callback){var opts=this.options;if(!opts.initAjax||!opts.initAjax.url){throw"tree.reload() requires 'initAjax' mode.";} +var pers=this.persistence;var ajaxOpts=$.extend({},opts.initAjax);if(ajaxOpts.addActiveKey){ajaxOpts.data.activeKey=pers.activeKey;} +if(ajaxOpts.addFocusedKey){ajaxOpts.data.focusedKey=pers.focusedKey;} +if(ajaxOpts.addExpandedKeyList){ajaxOpts.data.expandedKeyList=pers.expandedKeyList.join(",");} +if(ajaxOpts.addSelectedKeyList){ajaxOpts.data.selectedKeyList=pers.selectedKeyList.join(",");} +if(opts.onPostInit){if(ajaxOpts.success){this.logWarning("initAjax: success callback is ignored when onPostInit was specified.");} +if(ajaxOpts.error){this.logWarning("initAjax: error callback is ignored when onPostInit was specified.");} +var isReloading=pers.isReloading();ajaxOpts.success=function(dtnode){opts.onPostInit.call(dtnode.tree,isReloading,false);if(callback){callback.call(dtnode.tree,"ok");}};ajaxOpts.error=function(dtnode){opts.onPostInit.call(dtnode.tree,isReloading,true);if(callback){callback.call(dtnode.tree,"error");}};} +this.logDebug("Dynatree._init(): send Ajax request...");this.tnRoot.appendAjax(ajaxOpts);},toString:function(){return"Dynatree '"+this.$tree.attr("id")+"'";},toDict:function(){return this.tnRoot.toDict(true);},serializeArray:function(stopOnParents){var nodeList=this.getSelectedNodes(stopOnParents),name=this.$tree.attr("name")||this.$tree.attr("id"),arr=[];for(var i=0,l=nodeList.length;i=2){Array.prototype.unshift.apply(arguments,["debug"]);_log.apply(this,arguments);}},logInfo:function(msg){if(this.options.debugLevel>=1){Array.prototype.unshift.apply(arguments,["info"]);_log.apply(this,arguments);}},logWarning:function(msg){Array.prototype.unshift.apply(arguments,["warn"]);_log.apply(this,arguments);},isInitializing:function(){return(this.phase=="init"||this.phase=="postInit");},isReloading:function(){return(this.phase=="init"||this.phase=="postInit")&&this.options.persist&&this.persistence.cookiesFound;},isUserEvent:function(){return(this.phase=="userEvent");},redraw:function(){this.tnRoot.render(false,false);},renderInvisibleNodes:function(){this.tnRoot.render(false,true);},reload:function(callback){this._load(callback);},getRoot:function(){return this.tnRoot;},enable:function(){this.$widget.enable();},disable:function(){this.$widget.disable();},getNodeByKey:function(key){var el=document.getElementById(this.options.idPrefix+key);if(el){return el.dtnode?el.dtnode:null;} +var match=null;this.visit(function(node){if(node.data.key==key){match=node;return false;}},true);return match;},getActiveNode:function(){return this.activeNode;},reactivate:function(setFocus){var node=this.activeNode;if(node){this.activeNode=null;node.activate();if(setFocus){node.focus();}}},getSelectedNodes:function(stopOnParents){var nodeList=[];this.tnRoot.visit(function(node){if(node.bSelected){nodeList.push(node);if(stopOnParents===true){return"skip";}}});return nodeList;},activateKey:function(key){var dtnode=(key===null)?null:this.getNodeByKey(key);if(!dtnode){if(this.activeNode){this.activeNode.deactivate();} +this.activeNode=null;return null;} +dtnode.focus();dtnode.activate();return dtnode;},loadKeyPath:function(keyPath,callback){var segList=keyPath.split(this.options.keyPathSeparator);if(segList[0]===""){segList.shift();} +if(segList[0]==this.tnRoot.data.key){this.logDebug("Removed leading root key.");segList.shift();} +keyPath=segList.join(this.options.keyPathSeparator);return this.tnRoot._loadKeyPath(keyPath,callback);},selectKey:function(key,select){var dtnode=this.getNodeByKey(key);if(!dtnode){return null;} +dtnode.select(select);return dtnode;},enableUpdate:function(bEnable){if(this.bEnableUpdate==bEnable){return bEnable;} +this.bEnableUpdate=bEnable;if(bEnable){this.redraw();} +return!bEnable;},count:function(){return this.tnRoot.countChildren();},visit:function(fn,includeRoot){return this.tnRoot.visit(fn,includeRoot);},_createFromTag:function(parentTreeNode,$ulParent){var self=this;$ulParent.find(">li").each(function(){var $li=$(this);var $liSpan=$li.find(">span:first");var title;if($liSpan.length){title=$liSpan.html();}else{title=$li.html();var iPos=title.search(/
    =0){title=$.trim(title.substring(0,iPos));}else{title=$.trim(title);}} +var data={title:title,isFolder:$li.hasClass("folder"),isLazy:$li.hasClass("lazy"),expand:$li.hasClass("expanded"),select:$li.hasClass("selected"),activate:$li.hasClass("active"),focus:$li.hasClass("focused"),noLink:$li.hasClass("noLink")};if($li.attr("title")){data.tooltip=$li.attr("title");} +if($li.attr("id")){data.key=$li.attr("id");} +if($li.attr("data")){var dataAttr=$.trim($li.attr("data"));if(dataAttr){if(dataAttr.charAt(0)!="{"){dataAttr="{"+dataAttr+"}";} +try{$.extend(data,eval("("+dataAttr+")"));}catch(e){throw("Error parsing node data: "+e+"\ndata:\n'"+dataAttr+"'");}}} +var childNode=parentTreeNode.addChild(data);var $ul=$li.find(">ul:first");if($ul.length){self._createFromTag(childNode,$ul);}});},_checkConsistency:function(){},_setDndStatus:function(sourceNode,targetNode,helper,hitMode,accept){var $source=sourceNode?$(sourceNode.span):null;var $target=$(targetNode.span);if(!this.$dndMarker){this.$dndMarker=$("
    ").hide().prependTo($(this.divTree).parent());} +if(hitMode==="after"||hitMode==="before"||hitMode==="over"){var pos=$target.position();switch(hitMode){case"before":this.$dndMarker.removeClass("dynatree-drop-after dynatree-drop-over");this.$dndMarker.addClass("dynatree-drop-before");pos.top-=8;break;case"after":this.$dndMarker.removeClass("dynatree-drop-before dynatree-drop-over");this.$dndMarker.addClass("dynatree-drop-after");pos.top+=8;break;default:this.$dndMarker.removeClass("dynatree-drop-after dynatree-drop-before");this.$dndMarker.addClass("dynatree-drop-over");$target.addClass("dynatree-drop-target");pos.left+=8;} +this.$dndMarker.css({"left":(pos.left)+"px","top":(pos.top)+"px"}).show();}else{$target.removeClass("dynatree-drop-target");this.$dndMarker.hide();} +if(hitMode==="after"){$target.addClass("dynatree-drop-after");}else{$target.removeClass("dynatree-drop-after");} +if(hitMode==="before"){$target.addClass("dynatree-drop-before");}else{$target.removeClass("dynatree-drop-before");} +if(accept===true){if($source){$source.addClass("dynatree-drop-accept");} +$target.addClass("dynatree-drop-accept");helper.addClass("dynatree-drop-accept");}else{if($source){$source.removeClass("dynatree-drop-accept");} +$target.removeClass("dynatree-drop-accept");helper.removeClass("dynatree-drop-accept");} +if(accept===false){if($source){$source.addClass("dynatree-drop-reject");} +$target.addClass("dynatree-drop-reject");helper.addClass("dynatree-drop-reject");}else{if($source){$source.removeClass("dynatree-drop-reject");} +$target.removeClass("dynatree-drop-reject");helper.removeClass("dynatree-drop-reject");}},_onDragEvent:function(eventName,node,otherNode,event,ui,draggable){var opts=this.options;var dnd=this.options.dnd;var res=null;var nodeTag=$(node.span);var hitMode;switch(eventName){case"helper":var helper=$("
    ").append($(event.target).closest('a').clone());helper.data("dtSourceNode",node);res=helper;break;case"start":if(node.isStatusNode()){res=false;}else if(dnd.onDragStart){res=dnd.onDragStart(node);} +if(res===false){this.logDebug("tree.onDragStart() cancelled");ui.helper.trigger("mouseup");ui.helper.hide();}else{nodeTag.addClass("dynatree-drag-source");} +break;case"enter":res=dnd.onDragEnter?dnd.onDragEnter(node,otherNode):null;res={over:(res!==false)&&((res===true)||(res==="over")||$.inArray("over",res)>=0),before:(res!==false)&&((res===true)||(res==="before")||$.inArray("before",res)>=0),after:(res!==false)&&((res===true)||(res==="after")||$.inArray("after",res)>=0)};ui.helper.data("enterResponse",res);break;case"over":var enterResponse=ui.helper.data("enterResponse");hitMode=null;if(enterResponse===false){break;}else if(typeof enterResponse==="string"){hitMode=enterResponse;}else{var nodeOfs=nodeTag.offset();var relPos={x:event.pageX-nodeOfs.left,y:event.pageY-nodeOfs.top};var relPos2={x:relPos.x/nodeTag.width(),y:relPos.y/nodeTag.height()};if(enterResponse.after&&relPos2.y>0.75){hitMode="after";}else if(!enterResponse.over&&enterResponse.after&&relPos2.y>0.5){hitMode="after";}else if(enterResponse.before&&relPos2.y<=0.25){hitMode="before";}else if(!enterResponse.over&&enterResponse.before&&relPos2.y<=0.5){hitMode="before";}else if(enterResponse.over){hitMode="over";} +if(dnd.preventVoidMoves){if(node===otherNode){hitMode=null;}else if(hitMode==="before"&&otherNode&&node===otherNode.getNextSibling()){hitMode=null;}else if(hitMode==="after"&&otherNode&&node===otherNode.getPrevSibling()){hitMode=null;}else if(hitMode==="over"&&otherNode&&otherNode.parent===node&&otherNode.isLastSibling()){hitMode=null;}} +ui.helper.data("hitMode",hitMode);} +if(hitMode==="over"&&dnd.autoExpandMS&&node.hasChildren()!==false&&!node.bExpanded){node.scheduleAction("expand",dnd.autoExpandMS);} +if(hitMode&&dnd.onDragOver){res=dnd.onDragOver(node,otherNode,hitMode);} +this._setDndStatus(otherNode,node,ui.helper,hitMode,res!==false);break;case"drop":hitMode=ui.helper.data("hitMode");if(hitMode&&dnd.onDrop){dnd.onDrop(node,otherNode,hitMode,ui,draggable);} +break;case"leave":node.scheduleAction("cancel");ui.helper.data("enterResponse",null);ui.helper.data("hitMode",null);this._setDndStatus(otherNode,node,ui.helper,"out",undefined);if(dnd.onDragLeave){dnd.onDragLeave(node,otherNode);} +break;case"stop":nodeTag.removeClass("dynatree-drag-source");if(dnd.onDragStop){dnd.onDragStop(node);} +break;default:throw"Unsupported drag event: "+eventName;} +return res;},cancelDrag:function(){var dd=$.ui.ddmanager.current;if(dd){dd.cancel();}},lastentry:undefined};$.widget("ui.dynatree",{_init:function(){if(parseFloat($.ui.version)<1.8){_log("warn","ui.dynatree._init() was called; you should upgrade to jquery.ui.core.js v1.8 or higher.");return this._create();} +_log("debug","ui.dynatree._init() was called; no current default functionality.");},_create:function(){logMsg("Dynatree._create(): version='%s', debugLevel=%o.",DynaTree.version,this.options.debugLevel);var opts=this.options;this.options.event+=".dynatree";var divTree=this.element.get(0);this.tree=new DynaTree(this);this.tree._load();this.tree.logDebug("Dynatree._init(): done.");},bind:function(){this.unbind();var eventNames="click.dynatree dblclick.dynatree";if(this.options.keyboard){eventNames+=" keypress.dynatree keydown.dynatree";} +this.element.bind(eventNames,function(event){var dtnode=getDtNodeFromElement(event.target);if(!dtnode){return true;} +var tree=dtnode.tree;var o=tree.options;tree.logDebug("event(%s): dtnode: %s",event.type,dtnode);var prevPhase=tree.phase;tree.phase="userEvent";try{switch(event.type){case"click":return(o.onClick&&o.onClick.call(tree,dtnode,event)===false)?false:dtnode._onClick(event);case"dblclick":return(o.onDblClick&&o.onDblClick.call(tree,dtnode,event)===false)?false:dtnode._onDblClick(event);case"keydown":return(o.onKeydown&&o.onKeydown.call(tree,dtnode,event)===false)?false:dtnode._onKeydown(event);case"keypress":return(o.onKeypress&&o.onKeypress.call(tree,dtnode,event)===false)?false:dtnode._onKeypress(event);}}catch(e){var _=null;tree.logWarning("bind(%o): dtnode: %o, error: %o",event,dtnode,e);}finally{tree.phase=prevPhase;}});function __focusHandler(event){event=$.event.fix(event||window.event);var dtnode=getDtNodeFromElement(event.target);return dtnode?dtnode._onFocus(event):false;} +var div=this.tree.divTree;if(div.addEventListener){div.addEventListener("focus",__focusHandler,true);div.addEventListener("blur",__focusHandler,true);}else{div.onfocusin=div.onfocusout=__focusHandler;}},unbind:function(){this.element.unbind(".dynatree");},enable:function(){this.bind();$.Widget.prototype.enable.apply(this,arguments);},disable:function(){this.unbind();$.Widget.prototype.disable.apply(this,arguments);},getTree:function(){return this.tree;},getRoot:function(){return this.tree.getRoot();},getActiveNode:function(){return this.tree.getActiveNode();},getSelectedNodes:function(){return this.tree.getSelectedNodes();},lastentry:undefined});if(parseFloat($.ui.version)<1.8){$.ui.dynatree.getter="getTree getRoot getActiveNode getSelectedNodes";} +$.ui.dynatree.prototype.options={title:"Dynatree",minExpandLevel:1,imagePath:null,children:null,initId:null,initAjax:null,autoFocus:true,keyboard:true,persist:false,autoCollapse:false,clickFolderMode:3,activeVisible:true,checkbox:false,selectMode:2,fx:null,noLink:false,onClick:null,onDblClick:null,onKeydown:null,onKeypress:null,onFocus:null,onBlur:null,onQueryActivate:null,onQuerySelect:null,onQueryExpand:null,onPostInit:null,onActivate:null,onDeactivate:null,onSelect:null,onExpand:null,onLazyRead:null,onCustomRender:null,onRender:null,dnd:{onDragStart:null,onDragStop:null,autoExpandMS:1000,preventVoidMoves:true,onDragEnter:null,onDragOver:null,onDrop:null,onDragLeave:null},ajaxDefaults:{cache:false,dataType:"json"},strings:{loading:"Loading…",loadError:"Load error!"},generateIds:false,idPrefix:"dynatree-id-",keyPathSeparator:"/",cookieId:"dynatree",cookie:{expires:null},classNames:{container:"dynatree-container",node:"dynatree-node",folder:"dynatree-folder",empty:"dynatree-empty",vline:"dynatree-vline",expander:"dynatree-expander",connector:"dynatree-connector",checkbox:"dynatree-checkbox",nodeIcon:"dynatree-icon",title:"dynatree-title",noConnector:"dynatree-no-connector",nodeError:"dynatree-statusnode-error",nodeWait:"dynatree-statusnode-wait",hidden:"dynatree-hidden",combinedExpanderPrefix:"dynatree-exp-",combinedIconPrefix:"dynatree-ico-",nodeLoading:"dynatree-loading",hasChildren:"dynatree-has-children",active:"dynatree-active",selected:"dynatree-selected",expanded:"dynatree-expanded",lazy:"dynatree-lazy",focused:"dynatree-focused",partsel:"dynatree-partsel",lastsib:"dynatree-lastsib"},debugLevel:1,lastentry:undefined};if(parseFloat($.ui.version)<1.8){$.ui.dynatree.defaults=$.ui.dynatree.prototype.options;} +$.ui.dynatree.nodedatadefaults={title:null,key:null,isFolder:false,isLazy:false,tooltip:null,icon:null,addClass:null,noLink:false,activate:false,focus:false,expand:false,select:false,hideCheckbox:false,unselectable:false,children:null,lastentry:undefined};function _initDragAndDrop(tree){var dnd=tree.options.dnd||null;if(dnd&&(dnd.onDragStart||dnd.onDrop)){_registerDnd();} +if(dnd&&dnd.onDragStart){tree.$tree.draggable({addClasses:false,appendTo:"body",containment:false,delay:0,distance:4,revert:false,connectToDynatree:true,helper:function(event){var sourceNode=getDtNodeFromElement(event.target);return sourceNode.tree._onDragEvent("helper",sourceNode,null,event,null,null);},_last:null});} +if(dnd&&dnd.onDrop){tree.$tree.droppable({addClasses:false,tolerance:"intersect",greedy:false,_last:null});}} +var didRegisterDnd=false;var _registerDnd=function(){if(didRegisterDnd){return;} +$.ui.plugin.add("draggable","connectToDynatree",{start:function(event,ui){var draggable=$(this).data("draggable");var sourceNode=ui.helper.data("dtSourceNode")||null;if(sourceNode){draggable.offset.click.top=-2;draggable.offset.click.left=+16;return sourceNode.tree._onDragEvent("start",sourceNode,null,event,ui,draggable);}},drag:function(event,ui){var draggable=$(this).data("draggable");var sourceNode=ui.helper.data("dtSourceNode")||null;var prevTargetNode=ui.helper.data("dtTargetNode")||null;var targetNode=getDtNodeFromElement(event.target);if(event.target&&!targetNode){var isHelper=$(event.target).closest("div.dynatree-drag-helper,#dynatree-drop-marker").length>0;if(isHelper){return;}} +ui.helper.data("dtTargetNode",targetNode);if(prevTargetNode&&prevTargetNode!==targetNode){prevTargetNode.tree._onDragEvent("leave",prevTargetNode,sourceNode,event,ui,draggable);} +if(targetNode){if(!targetNode.tree.options.dnd.onDrop){noop();}else if(targetNode===prevTargetNode){targetNode.tree._onDragEvent("over",targetNode,sourceNode,event,ui,draggable);}else{targetNode.tree._onDragEvent("enter",targetNode,sourceNode,event,ui,draggable);}}},stop:function(event,ui){var draggable=$(this).data("draggable");var sourceNode=ui.helper.data("dtSourceNode")||null;var targetNode=ui.helper.data("dtTargetNode")||null;var mouseDownEvent=draggable._mouseDownEvent;var eventType=event.type;var dropped=(eventType=="mouseup"&&event.which==1);if(!dropped){logMsg("Drag was cancelled");} +if(targetNode){if(dropped){targetNode.tree._onDragEvent("drop",targetNode,sourceNode,event,ui,draggable);} +targetNode.tree._onDragEvent("leave",targetNode,sourceNode,event,ui,draggable);} +if(sourceNode){sourceNode.tree._onDragEvent("stop",sourceNode,null,event,ui,draggable);}}});didRegisterDnd=true;};})(jQuery); \ No newline at end of file diff --git a/AndorsTrailEdit/inc/loading.gif b/AndorsTrailEdit/inc/loading.gif new file mode 100644 index 000000000..251df0544 Binary files /dev/null and b/AndorsTrailEdit/inc/loading.gif differ diff --git a/AndorsTrailEdit/inc/ui.dynatree.css b/AndorsTrailEdit/inc/ui.dynatree.css new file mode 100644 index 000000000..4976f5b02 --- /dev/null +++ b/AndorsTrailEdit/inc/ui.dynatree.css @@ -0,0 +1,441 @@ +/******************************************************************************* + * Tree container + */ +ul.dynatree-container +{ + font-family: tahoma, arial, helvetica; + font-size: 10pt; /* font size should not be too big */ + white-space: nowrap; + padding: 3px; + + background-color: white; + border: 1px dotted gray; + + overflow: auto; +} + +ul.dynatree-container ul +{ + padding: 0 0 0 16px; + margin: 0; +} + +ul.dynatree-container li +{ + list-style-image: none; + list-style-position: outside; + list-style-type: none; + -moz-background-clip:border; + -moz-background-inline-policy: continuous; + -moz-background-origin: padding; + background-attachment: scroll; + background-color: transparent; + background-repeat: repeat-y; + background-image: url("vline.gif"); + background-position: 0 0; + /* + background-image: url("icons_96x256.gif"); + background-position: -80px -64px; + */ + margin: 0; + padding: 1px 0 0 0; +} +/* Suppress lines for last child node */ +ul.dynatree-container li.dynatree-lastsib +{ + background-image: none; +} +/* Suppress lines if level is fixed expanded (option minExpandLevel) */ +ul.dynatree-no-connector > li +{ + background-image: none; +} + +/* Style, when control is disabled */ +.ui-dynatree-disabled ul.dynatree-container +{ + opacity: 0.5; +/* filter: alpha(opacity=50); /* Yields a css warning */ + background-color: silver; +} + +/******************************************************************************* + * Common icon definitions + */ +span.dynatree-empty, +span.dynatree-vline, +span.dynatree-connector, +span.dynatree-expander, +span.dynatree-icon, +span.dynatree-checkbox, +span.dynatree-radio, +span.dynatree-drag-helper-img, +#dynatree-drop-marker +{ + width: 16px; + height: 16px; + display: -moz-inline-box; /* @ FF 1+2 */ + display: inline-block; /* Required to make a span sizeable */ + vertical-align: top; + background-repeat: no-repeat; + background-position: left; + background-image: url("icons.gif"); + background-position: 0 0; +} + +/** Used by 'icon' node option: */ +ul.dynatree-container img +{ + width: 16px; + height: 16px; + margin-left: 3px; + vertical-align: top; + border-style: none; +} + + +/******************************************************************************* + * Lines and connectors + */ + +span.dynatree-connector +{ + background-position: -16px -64px; +} + +/******************************************************************************* + * Expander icon + * Note: IE6 doesn't correctly evaluate multiples class names, + * so we create combined class names that can be used in the CSS. + * + * Prefix: dynatree-exp- + * 1st character: 'e': expanded, 'c': collapsed + * 2nd character (optional): 'd': lazy (Delayed) + * 3rd character (optional): 'l': Last sibling + */ + +span.dynatree-expander +{ + background-position: 0px -80px; + cursor: pointer; +} +.dynatree-exp-cl span.dynatree-expander /* Collapsed, not delayed, last sibling */ +{ + background-position: 0px -96px; +} +.dynatree-exp-cd span.dynatree-expander /* Collapsed, delayed, not last sibling */ +{ + background-position: -64px -80px; +} +.dynatree-exp-cdl span.dynatree-expander /* Collapsed, delayed, last sibling */ +{ + background-position: -64px -96px; +} +.dynatree-exp-e span.dynatree-expander, /* Expanded, not delayed, not last sibling */ +.dynatree-exp-ed span.dynatree-expander /* Expanded, delayed, not last sibling */ +{ + background-position: -32px -80px; +} +.dynatree-exp-el span.dynatree-expander, /* Expanded, not delayed, last sibling */ +.dynatree-exp-edl span.dynatree-expander /* Expanded, delayed, last sibling */ +{ + background-position: -32px -96px; +} +.dynatree-loading span.dynatree-expander /* 'Loading' status overrides all others */ +{ + background-position: 0 0; + background-image: url("loading.gif"); +} + + +/******************************************************************************* + * Checkbox icon + */ +span.dynatree-checkbox +{ + margin-left: 3px; + background-position: 0px -32px; +} +span.dynatree-checkbox:hover +{ + background-position: -16px -32px; +} + +.dynatree-partsel span.dynatree-checkbox +{ + background-position: -64px -32px; +} +.dynatree-partsel span.dynatree-checkbox:hover +{ + background-position: -80px -32px; +} + +.dynatree-selected span.dynatree-checkbox +{ + background-position: -32px -32px; +} +.dynatree-selected span.dynatree-checkbox:hover +{ + background-position: -48px -32px; +} + +/******************************************************************************* + * Radiobutton icon + * This is a customization, that may be activated by overriding the 'checkbox' + * class name as 'dynatree-radio' in the tree options. + */ +span.dynatree-radio +{ + margin-left: 3px; + background-position: 0px -48px; +} +span.dynatree-radio:hover +{ + background-position: -16px -48px; +} + +.dynatree-partsel span.dynatree-radio +{ + background-position: -64px -48px; +} +.dynatree-partsel span.dynatree-radio:hover +{ + background-position: -80px -48px; +} + +.dynatree-selected span.dynatree-radio +{ + background-position: -32px -48px; +} +.dynatree-selected span.dynatree-radio:hover +{ + background-position: -48px -48px; +} + +/******************************************************************************* + * Node type icon + * Note: IE6 doesn't correctly evaluate multiples class names, + * so we create combined class names that can be used in the CSS. + * + * Prefix: dynatree-ico- + * 1st character: 'e': expanded, 'c': collapsed + * 2nd character (optional): 'f': folder + */ + +span.dynatree-icon /* Default icon */ +{ + margin-left: 3px; + background-position: 0px 0px; +} + +.dynatree-ico-cf span.dynatree-icon /* Collapsed Folder */ +{ + background-position: 0px -16px; +} + +.dynatree-ico-ef span.dynatree-icon /* Expanded Folder */ +{ + background-position: -64px -16px; +} + +/* Status node icons */ + +.dynatree-statusnode-wait span.dynatree-icon +{ + background-image: url("loading.gif"); +} + +.dynatree-statusnode-error span.dynatree-icon +{ + background-position: 0px -112px; +/* background-image: url("ltError.gif");*/ +} + +/******************************************************************************* + * Node titles + */ + +/* @Chrome: otherwise hit area of node titles is broken (issue 133) + Removed again for issue 165; (133 couldn't be reproduced) */ +span.dynatree-node +{ +/* display: -moz-inline-box; /* @ FF 1+2 */ +/* display: inline-block; /* Required to make a span sizeable */ +} + + +/* Remove blue color and underline from title links */ +ul.dynatree-container a +/*, ul.dynatree-container a:visited*/ +{ + color: black; /* inherit doesn't work on IE */ + text-decoration: none; + vertical-align: top; + margin: 0px; + margin-left: 3px; +/* outline: 0; /* @ Firefox, prevent dotted border after click */ +} + +ul.dynatree-container a:hover +{ +/* text-decoration: underline; */ + background: #F2F7FD; /* light blue */ + border-color: #B8D6FB; /* darker light blue */ +} + +span.dynatree-node a +{ + display: inline-block; /* Better alignment, when title contains
    */ +/* vertical-align: top;*/ + padding-left: 3px; + padding-right: 3px; /* Otherwise italic font will be outside bounds */ + /* line-height: 16px; /* should be the same as img height, in case 16 px */ +} +span.dynatree-folder a +{ + font-weight: bold; +} + +ul.dynatree-container a:focus, +span.dynatree-focused a:link /* @IE */ +{ + background-color: #EFEBDE; /* gray */ +} + +span.dynatree-has-children a +{ +} + +span.dynatree-expanded a +{ +} + +span.dynatree-selected a +{ + color: green; + font-style: italic; +} + +span.dynatree-active a +{ + background-color: #3169C6 !important; + color: white !important; /* @ IE6 */ +} + +/******************************************************************************* + * Drag'n'drop support + */ + +/*** Helper object ************************************************************/ +div.dynatree-drag-helper +{ +} +div.dynatree-drag-helper a +{ + border: 1px solid gray; + background-color: white; + padding-left: 5px; + padding-right: 5px; + opacity: 0.8; +} +span.dynatree-drag-helper-img +{ + /* + position: relative; + left: -16px; + */ +} +div.dynatree-drag-helper /*.dynatree-drop-accept*/ +{ + +/* border-color: green; + background-color: red;*/ +} +div.dynatree-drop-accept span.dynatree-drag-helper-img +{ + background-position: -32px -112px; +} +div.dynatree-drag-helper.dynatree-drop-reject +{ + border-color: red; +} +div.dynatree-drop-reject span.dynatree-drag-helper-img +{ + background-position: -16px -112px; +} + +/*** Drop marker icon *********************************************************/ + +#dynatree-drop-marker +{ + width: 24px; + position: absolute; + background-position: 0 -128px; +} +#dynatree-drop-marker.dynatree-drop-after, +#dynatree-drop-marker.dynatree-drop-before +{ + width:64px; + background-position: 0 -144px; +} +#dynatree-drop-marker.dynatree-drop-copy +{ + background-position: -64px -128px; +} +#dynatree-drop-marker.dynatree-drop-move +{ + background-position: -64px -128px; +} + +/*** Source node while dragging ***********************************************/ + +span.dynatree-drag-source +{ + /* border: 1px dotted gray; */ + background-color: #e0e0e0; +} +span.dynatree-drag-source a +{ + color: gray; +} + +/*** Target node while dragging cursor is over it *****************************/ + +span.dynatree-drop-target +{ + /*border: 1px solid gray;*/ +} +span.dynatree-drop-target a +{ + /*background-repeat: no-repeat; + background-position: right; + background-image: url("drop_child.gif");*/ +} +span.dynatree-drop-target.dynatree-drop-accept a +{ + /*border: 1px solid green;*/ + background-color: #3169C6 !important; + color: white !important; /* @ IE6 */ + text-decoration: none; +} +span.dynatree-drop-target.dynatree-drop-reject +{ + /*border: 1px solid red;*/ +} +span.dynatree-drop-target.dynatree-drop-after a +{ + /*background-repeat: repeat-x; + background-position: bottom; + background-image: url("drop_append.gif");*/ +} + + +/******************************************************************************* + * Custom node classes (sample) + */ + +span.custom1 a +{ + background-color: maroon; + color: yellow; +} diff --git a/AndorsTrailEdit/inc/vline.gif b/AndorsTrailEdit/inc/vline.gif new file mode 100644 index 000000000..1b00ae50e Binary files /dev/null and b/AndorsTrailEdit/inc/vline.gif differ diff --git a/AndorsTrailEdit/styles.css b/AndorsTrailEdit/styles.css deleted file mode 100644 index 3bda589e3..000000000 --- a/AndorsTrailEdit/styles.css +++ /dev/null @@ -1,22 +0,0 @@ -#inputarea { - height: 500px; - overflow: auto; -} -.rowdiv { - -} -.selectimage { - width: 32px; - height: 32px; -} -#invisible { - display: none; -} -#datatable td { - padding: 2px 10px 2px 10px; - border-bottom: 1px black solid; - background-color: #dddddd; -} -.editorbutton { - margin-right: 20px; -} diff --git a/AndorsTrailEdit/styles2.css b/AndorsTrailEdit/styles2.css index b4f82da4e..7be8666ba 100644 --- a/AndorsTrailEdit/styles2.css +++ b/AndorsTrailEdit/styles2.css @@ -17,7 +17,7 @@ html,body { margin:0; padding:0; height: 100%; font-size: 0.9em; } .fieldWithLabel .label { display: block; margin-top: 1ex; } .fieldWithLabel .field { display: block; } .fieldWithLabel .hint { } -.fieldWithLabel .fieldInput { } +.fieldWithLabel .fieldInput { vertical-align: top; } .fieldSet { float: left; margin: 1ex; background-color: #f7f7ff; } .endSets { clear: both; } @@ -33,3 +33,8 @@ html,body { margin:0; padding:0; height: 100%; font-size: 0.9em; } .fieldWithLabel table td { border: 1px #ccc solid; padding: 0.5ex; cursor: pointer; } .fieldWithLabel table tbody tr:nth-child(even) { background-color: #eee } .fieldWithLabel table tbody tr:hover { background-color: #d7d7ff; } +#dialogueTreeContainer { } +#dialogueTree { width: 400px; } +#dialogueData { } +input[readonly] { color: #888; } +.imageButton { padding: 5px; }