RandomNotes.wiki
changeset 1239 b028249e74c9
parent 1238 11ecdec25bf3
child 1726 c3de0c96ce6e
equal deleted inserted replaced
1238:11ecdec25bf3 1239:b028249e74c9
     8 = How to add a settings option =
     8 = How to add a settings option =
     9  * `QStringList HWGame::setArguments()` in `game.cpp` is the function that prepares the argument list
     9  * `QStringList HWGame::setArguments()` in `game.cpp` is the function that prepares the argument list
    10  * `void GameUIConfig::SaveOptions()` in `gameuiconfig.cpp` loads (or initializes) values and set the widgets to those values
    10  * `void GameUIConfig::SaveOptions()` in `gameuiconfig.cpp` loads (or initializes) values and set the widgets to those values
    11  * `PageOptions::PageOptions(QWidget* parent) :  AbstractPage(parent)` is where you would add your widget
    11  * `PageOptions::PageOptions(QWidget* parent) :  AbstractPage(parent)` is where you would add your widget
    12 
    12 
    13 = How to converts a `.hwmap` file to a Lua string =
    13 = How to convert a `.hwmap` file to a Lua string =
    14 
    14 
    15 Run this in a shell:
    15 Run this in a shell:
    16 
    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>
    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 
    18