Hi to all.
Wanna to share new thing for fun - db editor(for 6.2-, latest versions can require structs changes), based on my previous C# editor and imported to node/nw.js.
So, how it works?
It supports not all, but not bad part of those *.db files. Entry point is views/index.js with following content:
Part, which u need, are those _get and _set functions. First one would return content of your db file by it name(without .db, for ex., "questdetailobject"), second one would update existing table using changed data. For simplier usage u can use _call wrapper like it used in code.Code:var edge = require('edge'); var data, _get, _set; (function(){ try{ _get = edge.func("sharp/Edit.cs"); _set = edge.func("sharp/Edit.cs"); var result=_call(_get, "questdetailobject"); data=result; _modify(data); //var changed=_call(_set, "questdetailobject", result); console.log("Done"); } catch(ex){ console.log(ex); } })(); function _modify(result){ /*for(var i in result){ result[i].GUID=100000; } result.push(result[0]); console.log(result.length);*/ }
After u had execute this code, you can use data as usual array of objects directly from console(for nw.js) or just make modify/display logic inside file. For nw.js you can use jQuery as wrapper for some funny things like that:
Code:$(data).filter(function(index, x){ return x.GUID>425000; }); //return array of objects with GUID > 425000
Download url
NW.js site: NW.js
NW.js downloads: Index of /v0.12.3
If you would have some errors with edge.js, try to rebuild it as described here: https://github.com/frankhale/nw-edge-example



Reply With Quote

