Code Monkey home page Code Monkey logo

qa_block's People

Contributors

bell07 avatar dacmot avatar hybriddog avatar wuzzy2 avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

qa_block's Issues

Multi-line string in globals list breaks the display

If there is a string variable with line breaks, it is displayed incorrectly in the list; the list looks broken in this case because text gets written “over” other text.

This can be easily tested by adding any global multi-line string variable in any mod.

A possible solution would be just to eliminate all newlines before they get printed on the list and by replacing them with a literal “\n”.

Mod does not work with developer version of Minetest

As of Minetest commit cc7c31a5bc44ab0010997e86c0a8c9f5f832b398, qa_block does not work. When I start the world, I immediately get this error:

2016-12-21 13:11:01: ERROR[Main]: ModError: Failed to load and run script from /home/wuzzy/src/minetest/git/minetest/bin/../mods/qa_block/init.lua:
2016-12-21 13:11:01: ERROR[Main]: .../src/minetest/git/minetest/bin/../mods/qa_block/init.lua:63: bad argument #1 to 'ipairs' (table expected, got string)
2016-12-21 13:11:01: ERROR[Main]: stack traceback:
2016-12-21 13:11:01: ERROR[Main]: 	[C]: in function 'ipairs'
2016-12-21 13:11:01: ERROR[Main]: 	.../src/minetest/git/minetest/bin/../mods/qa_block/init.lua:63: in function 'print'
2016-12-21 13:11:01: ERROR[Main]: 	.../src/minetest/git/minetest/bin/../mods/qa_block/init.lua:138: in main chunk

minetest.chat_send_all --> log

Hi,

can you change print function minetest.chat_send_all(outsting) to minetest.log(outsting)?

The reason is, that .log is logged into the debug.txt by default. It's easier to analyze it.

Add help for the QA block

I suggest to add help texts for the QA block by supporting the doc_items mod.

Support is very simple, you don't need to depend. You just need to add
_doc_items_longdesc = "<long description of what the QA block is good for goes here>"
and
_doc_items_usagehelp = "<explanation on how the QA block can be used goes here>"

to the node def. of the QA block. There is no length limit.
The QA block is quite complex now, so I (and especially other users) would appreciate a good and understandable explanation. :-)

You can test the help entry by installing the Help modpack:
https://forum.minetest.net/viewtopic.php?f=9&t=15912

Variable editing menu should only open for numbers and strings

In the Globals tab, you can double-click booleans which opens the editing menu. But if you save, the variable becomes a string.
You can also overwrite an userdata variable like this and accidentally turn them into a string.

I think the editing menu should only open for strings and numbers, but not for any other data type because it is only able to save values of these types.

Colorize the list of variables

I suggest to use color coding for the list of variables in the Globals tab.

Use a different color for different variable types.
For example:

  • Cyan for functions
  • Purple for strings
  • Yellow for numbers
  • White for tables

I don't care much about the actual colors, what is important they are easy on the eye and easy to distinguish.

Global value smartfs_enabled

qa_block pollutes the global namespace with the variable smartfs_enabled but I think it should be made local.

Add 'bit' to acceptable global variables

The global variables check complains about the bit table looking suspicious but this one is part of the official Lua API now for bit operations (see lua_api.txt).

So please add bit to the accepted global variables.

Hide core variables from Lua itself and Minetest's Lua API

In the globals tab, there are many variables which come from the core APIs.

I mean global Lua variables like:

  • _G
  • _VERSION
  • string
  • math
  • xpcall
  • dofile

And global Minetest variables like:

  • minetest
  • core
  • dump
  • dump2

It is not really useful to have these in the list as they just clutter the view IMO. I am mostly interested in the globals which come from mods.

I like to have a checkbox which allows me to filter out anything which comes from the core APIs (either Lua or Minetest).

Activating the checkbox should filter out:

  • Functions which have “=[C]” as the source (this automatically means they come either from Lua or Minetest)
  • Functions in the path of builtin (more Lua API stuff)
  • For the remaining variables which are not functions:

The first 2 checks can be done automatically. The non-function variables can be filtered out by a hard-coded list.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.