diff --git a/game/engines/default/engine/ui/WebView.lua b/game/engines/default/engine/ui/WebView.lua index c5025b8b768e67aa0e025e9edf1bd4448e311fa8..7749a4cd721e1b96dd686dc0196e05448a0b7125 100644 --- a/game/engines/default/engine/ui/WebView.lua +++ b/game/engines/default/engine/ui/WebView.lua @@ -69,6 +69,10 @@ function _M:generate() on_loading = function(url, status) self.loading = status end, + on_crash = function() + print("WebView crashed, closing C view") + self.view = nil + end, } if self.allow_downloads then self:onDownload(handlers) end self.view = core.webview.new(self.w, self.h, handlers) diff --git a/game/engines/default/modules/boot/dialogs/MainMenu.lua b/game/engines/default/modules/boot/dialogs/MainMenu.lua index 6c469bd8dddf018a5799426a85993e7c56e12f1b..8a51a39bdb0c34f21a8189abd50e941f68a775f2 100644 --- a/game/engines/default/modules/boot/dialogs/MainMenu.lua +++ b/game/engines/default/modules/boot/dialogs/MainMenu.lua @@ -57,6 +57,7 @@ function _M:init() l[#l+1] = {name="Credits", fct=function() game:registerDialog(require("mod.dialogs.Credits").new()) end} l[#l+1] = {name="Exit", fct=function() game:onQuit() end} if config.settings.cheat then l[#l+1] = {name="Reboot", fct=function() util.showMainMenu() end} end + if config.settings.cheat then l[#l+1] = {name="webtest2", fct=function() Dialog:webPopup("http://te4.org/dlc/steamtech-ui") end} end if config.settings.cheat then l[#l+1] = {name="webtest", fct=function() local tween = require "tween" local i = 1 diff --git a/game/modules/tome/data/general/objects/world-artifacts.lua b/game/modules/tome/data/general/objects/world-artifacts.lua index 0a388cc502ced76a748fdfe058422fc92ec30b3a..c10ca26e4cf990d6212ac4c5ef1a004f3067c636 100644 --- a/game/modules/tome/data/general/objects/world-artifacts.lua +++ b/game/modules/tome/data/general/objects/world-artifacts.lua @@ -6519,7 +6519,7 @@ newEntity{ base = "BASE_HELM", newEntity{ base = "BASE_GREATSWORD", power_source = {technique=true, arcane=true}, - name = "Champion's Will", unique=true, image = "object/artifact/dawn_blade.png", + name = "Champion's Will", unique=true, image = "object/artifact/champions_will.png", unided_name = "blindingly bright sword", color=colors.YELLOW, desc = [[This impressive looking sword features a golden engraving of a sun in its hilt. Etched into its blade are a series of runes claiming that only one who has mastered both their body and mind may wield this sword effectively.]], require = { stat = { str=35 }, }, @@ -6579,7 +6579,7 @@ newEntity{ base = "BASE_GREATSWORD", newEntity{ base = "BASE_MASSIVE_ARMOR", power_source = {technique=true}, unique = true, - name = "Tarrasca", image = "object/artifact/armor_cuirass_of_the_thronesmen.png", + name = "Tarrasca", image = "object/artifact/terrasca.png", unided_name = "absurdly large armor", desc = [[This massive suit of plate boasts an enormous bulk and overbearing weight. Said to belong to a nameless soldier who safeguarded a passage across the bridge to his village, in defiance to the cohorts of invading orcs. After days of assault failed to fell him, the orcs turned back. The man however, fell dead on the spot - from exhaustion. The armor had finally claimed his life.]], color = colors.RED, @@ -6616,7 +6616,7 @@ newEntity{ base = "BASE_LEATHER_CAP", power_source = {unknown=true}, unique = true, name = "The Face of Fear", - unided_name = "bone mask", image = "object/artifact/eye_of_the_forest.png", + unided_name = "bone mask", image = "object/artifact/the_face_of_fear.png", level_range = {24, 32}, color=colors.GREEN, encumber = 2, @@ -6638,7 +6638,7 @@ newEntity{ base = "BASE_LEATHER_CAP", newEntity{ base = "BASE_LEATHER_BOOT", power_source = {arcane=true}, unided_name = "flame coated sandals", - name = "Cinderfeet", unique=true, image = "object/artifact/scorched_boots.png", + name = "Cinderfeet", unique=true, image = "object/artifact/cinderfeet.png", desc = [[A cautionary tale tells of the ancient warlock by the name of Caim, who fancied himself daily walks through Goedalath, both to test himself and the harsh demonic wastes. He was careful to never bring anything back with him, lest it provide a beacon for the demons to find him. Unfortunately, over time, his sandals drenched in the soot and ashes of the fearscape and the fire followed his footsteps outside, drawing in the conclusion of his grim fate.]], require = { stat = { dex=10 }, }, level_range = {28, 38}, diff --git a/src/web.c b/src/web.c index f4a2e05fe227d91aef8650ad8828b45509bceaa9..ce392f5a256d0947d9bbd9364677a50e4afb93a4 100644 --- a/src/web.c +++ b/src/web.c @@ -351,6 +351,16 @@ static void handle_event(WebEvent *event) { } else lua_pop(he_L, 1); break; + case TE4_WEB_EVENT_END_BROWSER: + lua_rawgeti(he_L, LUA_REGISTRYINDEX, event->handlers); + lua_pushstring(he_L, "on_crash"); + lua_gettable(he_L, -2); + lua_remove(he_L, -2); + if (!lua_isnil(he_L, -1)) { + docall(he_L, 0, 0); + } else lua_pop(he_L, 1); + break; + case TE4_WEB_EVENT_LOCAL_REQUEST: lua_getglobal(he_L, "core"); lua_getfield(he_L, -1, "webview");