List of commits:
Subject Hash Author Date (UTC)
Enhance console /set command to support operators 61032844fcb833f04e2f6d1e123f8f0f89333107 mse 2021-09-02 11:06:00
Add scriptable bribing & remove hard-coded karma increment 41b4d79da6331b4b1ffd96f36ae1b032a869b482 mse 2021-08-31 17:51:29
Add floor operator (_) 819304b561d474e962afa7397ef68ffae83e8649 mse 2021-08-31 13:49:57
Switch inventories and stats to floating-point c6e4142e664648ca8f4aa913b48526093c985987 mse 2021-08-31 13:35:20
Switch scripting to floating-point & code comments eb067496f4edb4420c05a09dc034ad0a25ad1e56 mse 2021-08-31 11:06:01
Add top-level command: GOSUB 62e9520aec0471fe023ead290595f735a30eb806 mse 2021-08-26 09:31:27
Add persistent VN stats 2d1ffc35afd8ae0f477cbd5aac0559fc02571600 mse 2021-08-23 10:44:16
Bribes increase karma 643f0fc6da65316aa799bbe00cea2030e2c1ccd6 mse 2021-08-17 08:16:36
Add command: #RUMBLE <intensity> <milliseconds> 02964b2ecc57a48192522ef369e33c4912d2f0d2 mse 2021-08-16 07:17:40
Reset position in non-mouse menu selection c21eb6a9d238fa1909dbbbc49907ad09bfca52c8 mse 2021-08-16 03:30:49
Add haptic rumble for combat 65ff172308b0ba26b8930e8e83eb41bd36c6b008 mse 2021-08-15 06:11:25
Reduce joystick sensitivity 3804492a52d36c40cd51d42a971fe92f4fdd52ba mse 2021-08-14 22:37:19
Set audio buffer 1024 to reduce latency b1733b33b3342b32f08e1bafb5baf63ed7db419e mse 2021-07-11 02:56:22
Update readme, deps, bump to v0.5.0 2f96bc1fe9af48874750f2ba507eda5d704313b0 mse 2021-07-05 12:14:52
New license c9932a52aaa81e6b136510157bfc3ce3e10ab800 mse 2021-07-04 16:01:57
Fix joystick dead zone 303dc3276d27f2a123e5370b31b79cdf87afc879 mse 2021-06-26 07:09:28
Windows-compatible locale 65244a8360ad6a65fea64f43f115f5c93bf966dd mse 2021-06-11 17:13:26
Detect language using std::locale 60f1680d73e559dc85f6b85e9ca69cb9be717ae6 mse 2021-06-09 16:11:30
Rename data -> base and load game as mod ec3b8aa10ee005d89d897b43c68cecd4b9ea8a75 mse 2021-06-07 12:31:53
Replace function with macro cc34567bf5b5503d90ea989004606fcca240d3cd mse 2021-05-30 20:14:02
Commit 61032844fcb833f04e2f6d1e123f8f0f89333107 - Enhance console /set command to support operators
Author: mse
Author date (UTC): 2021-09-02 11:06
Committer name: mse
Committer date (UTC): 2021-09-02 11:06
Parent(s): 41b4d79da6331b4b1ffd96f36ae1b032a869b482
Signing key:
Tree: 3cc7d52b6ea5bc6801d4c700513d693c9808b8bc
File Lines added Lines deleted
confec.cpp 6 15
include/dialogue.h 19 12
File confec.cpp changed (mode: 100644) (index 6a713e7..76d9309)
... ... void Render(){
4683 4683 std::string val_str = std::string val_str =
4684 4684 param.substr( space_at + 1 ); param.substr( space_at + 1 );
4685 4685 char* p; char* p;
4686 long double num =
4687 std::strtold( val_str.c_str(), &p );
4688 if( *p ){
4689 // Non-numeric value.
4690 convo.setVariable(
4691 param.substr( 0, space_at ),
4692 convo.getVariable( val_str )
4693 );
4694 }else{
4695 // Numeric value.
4696 convo.setVariable(
4697 param.substr( 0, space_at ),
4698 (double)num
4699 );
4700 }
4686 double num = std::strtod( val_str.c_str(), &p );
4687 convo.operate( convo.getOperation(
4688 param.substr( 0, space_at ),
4689 num,
4690 *p ? val_str : "" // Value is a string?
4691 ) );
4701 4692 } }
4702 4693 }else if( str.length() >= 5 }else if( str.length() >= 5
4703 4694 && str.substr( 0, 5 ) == "/help" ){ && str.substr( 0, 5 ) == "/help" ){
File include/dialogue.h changed (mode: 100755) (index 05aee01..d57bf57)
... ... class Talk {
66 66 void setVariable( std::string key, double valueNumber ); void setVariable( std::string key, double valueNumber );
67 67 int parseJSON( std::string &text ); int parseJSON( std::string &text );
68 68 std::string stringifyNumber( double n ); std::string stringifyNumber( double n );
69 Talk( std::string filePath = "" );
70 private:
69 Operation getOperation( std::string key, double valueNumber, std::string valueKey );
71 70 void operate( Operation o ); void operate( Operation o );
72 71 void transformString( std::string &str ); void transformString( std::string &str );
72 Talk( std::string filePath = "" );
73 73 }; };
74 74
75 75 void Talk::go( std::string id ){ void Talk::go( std::string id ){
 
... ... int Talk::parseJSON( std::string &text ){
242 242 for( auto s : allocatedDocument.document.root.getObject() ){ for( auto s : allocatedDocument.document.root.getObject() ){
243 243 std::vector<Operation> exec; std::vector<Operation> exec;
244 244 for( auto o : s.value["exec"].getObject() ){ for( auto o : s.value["exec"].getObject() ){
245 std::string key = viewToString( o.name );
246 char op = ':';
247 if( key.length() > 0 && key.find_last_of( "=!<>?%*/+-_" ) == key.length() - 1 ){
248 op = key.back();
249 key.resize( key.length() - 1 );
250 }
251 exec.push_back( {
252 key,
253 op,
245 exec.push_back( getOperation(
246 viewToString( o.name ),
254 247 o.value.getDouble(), o.value.getDouble(),
255 248 o.value.isString() ? viewToString( o.value.getString() ) : "" o.value.isString() ? viewToString( o.value.getString() ) : ""
256 } );
249 ) );
257 250 } }
258 251 std::vector<std::string> lines; std::vector<std::string> lines;
259 252 for( auto l : s.value["lines"].getArray() ) lines.push_back( viewToString( l.getString() ) ); for( auto l : s.value["lines"].getArray() ) lines.push_back( viewToString( l.getString() ) );
 
... ... Talk::Talk( std::string filePath ){
310 303 } }
311 304 } }
312 305
306 Operation Talk::getOperation( std::string key, double valueNumber, std::string valueKey ){
307 char op = ':';
308 if( key.length() > 0 && key.find_last_of( "=!<>?%*/+-_" ) == key.length() - 1 ){
309 op = key.back();
310 key.resize( key.length() - 1 );
311 }
312 return {
313 key,
314 op,
315 valueNumber,
316 valueKey
317 };
318 }
319
313 320 void Talk::operate( Operation o ){ void Talk::operate( Operation o ){
314 321 double in = o.valueNumber, out = getVariable( o.key ); double in = o.valueNumber, out = getVariable( o.key );
315 322 if( o.valueKey.length() > 0 ){ if( o.valueKey.length() > 0 ){
Hints:
Before first commit, do not forget to setup your git environment:
git config --global user.name "your_name_here"
git config --global user.email "your@email_here"

Clone this repository using HTTP(S):
git clone https://rocketgit.com/user/mse/ConfectionerEngine

Clone this repository using ssh (do not forget to upload a key first):
git clone ssh://rocketgit@ssh.rocketgit.com/user/mse/ConfectionerEngine

Clone this repository using git:
git clone git://git.rocketgit.com/user/mse/ConfectionerEngine

You are allowed to anonymously push to this repository.
This means that your pushed commits will automatically be transformed into a merge request:
... clone the repository ...
... make some changes and some commits ...
git push origin main