author | Wuzzy |
Wed, 17 Apr 2019 13:24:41 +0100 | |
changeset 1775 | 9a5472760632 |
parent 1765 | 3e23edc6d087 |
child 1814 | e6e9ed9d2626 |
permissions | -rw-r--r-- |
1728
26fbc53190c5
Add sandbox page to play around with wiki syntax
Wuzzy <almikes@aol.com>
parents:
1726
diff
changeset
|
1 |
#summary Little tidbits that await proper structuring |
8
55340ce0339a
Created wiki page through web user interface.
vittorio.giovara@gmail.com
parents:
diff
changeset
|
2 |
|
504
fbc43fa808ff
Explain purpose of page, add undocumented Lua functions with parameters and guesses what they might do.
almikes@aol.com
parents:
8
diff
changeset
|
3 |
= Introduction = |
fbc43fa808ff
Explain purpose of page, add undocumented Lua functions with parameters and guesses what they might do.
almikes@aol.com
parents:
8
diff
changeset
|
4 |
This page is a collection of random unsorted or unfinished stuff which is not good or structured enough to be put into one of the “real” wiki pages. Wiki editors: If something becomes actually useable, please move it to the appropriate wiki page and remove it from this page. |
fbc43fa808ff
Explain purpose of page, add undocumented Lua functions with parameters and guesses what they might do.
almikes@aol.com
parents:
8
diff
changeset
|
5 |
|
fbc43fa808ff
Explain purpose of page, add undocumented Lua functions with parameters and guesses what they might do.
almikes@aol.com
parents:
8
diff
changeset
|
6 |
This page is intentionally chaotic and may change rapidliy at any time. |
fbc43fa808ff
Explain purpose of page, add undocumented Lua functions with parameters and guesses what they might do.
almikes@aol.com
parents:
8
diff
changeset
|
7 |
|
fbc43fa808ff
Explain purpose of page, add undocumented Lua functions with parameters and guesses what they might do.
almikes@aol.com
parents:
8
diff
changeset
|
8 |
= How to add a settings option = |
fbc43fa808ff
Explain purpose of page, add undocumented Lua functions with parameters and guesses what they might do.
almikes@aol.com
parents:
8
diff
changeset
|
9 |
* `QStringList HWGame::setArguments()` in `game.cpp` is the function that prepares the argument list |
fbc43fa808ff
Explain purpose of page, add undocumented Lua functions with parameters and guesses what they might do.
almikes@aol.com
parents:
8
diff
changeset
|
10 |
* `void GameUIConfig::SaveOptions()` in `gameuiconfig.cpp` loads (or initializes) values and set the widgets to those values |
634 | 11 |
* `PageOptions::PageOptions(QWidget* parent) : AbstractPage(parent)` is where you would add your widget |
12 |
||
1239 | 13 |
= How to convert a `.hwmap` file to a Lua string = |
1238 | 14 |
|
15 |
Run this in a shell: |
|
16 |
||
17 |
<code>IN="map.hwmap";OUT="temp.lua";base64 -d $IN | tail -c +7 | head -c -4 > foo;echo -ne "\x1f\x8b\x08\0\0\0\0\0\x02\xff" > bar;cat bar foo | gunzip > baz;C=0;echo -n "local map = { " >> $OUT;od -w240 -t u1 baz | grep -Ev "^[0-9]*[[:space:]]*$" | while read f;do C=$((C+1));if ((C!=1));then echo "," >> $OUT;fi;echo -n $f | sed "s/^......./'/;s/ */\\\\/g;s/$/'/" >> $OUT;done;echo "}" >> $OUT</code> |
|
18 |
||
1731 | 19 |
* Input file: `map.hwmap` |
20 |
* Output file: `temp.lua` |
|
21 |
||
1749
91756d20ce3e
Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
1731
diff
changeset
|
22 |
= Undocumented Lua functions = |
91756d20ce3e
Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
1731
diff
changeset
|
23 |
This script was used on [LuaAPI] to detect undocumented functions: |
91756d20ce3e
Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
1731
diff
changeset
|
24 |
|
91756d20ce3e
Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
1731
diff
changeset
|
25 |
[http://hw.ercatec.net/docs/lua_wiki_check.php] |
91756d20ce3e
Separate core Lua stuff into new Lua pages for better maintainability. Main LuaAPI page not touched yet
Wuzzy <almikes@aol.com>
parents:
1731
diff
changeset
|
26 |
|
1765 | 27 |
But due to a restructuring, this script no longer works, it needs to be updated. |