lTz 12 Posted January 4 Share Posted January 4 Hi , i'm kinda new here and i want to ask something i have something like this in client source boll test = true; if(test){ do stuf else{ do other stuff } } now the problem that i don't know how to do and pls don't make fun of me i want a button in a window to acces this bool and based on the toggle of that button to select an if ty for help:P Link to comment Share on other sites More sharing options...
Solution lTz 12 Posted January 5 Author Solution Share Posted January 5 Edit : i manage to do it after some research what i did was something like this: public: bool test; void SetTest(bool value) {test = value;} PyObject* miniMapSetChose(PyObject* poSelf, PyObject* poArgs) { bool bValue; if (!PyTuple_GetBoolean(poArgs, 0, &bValue)) return Py_BuildException(); CPythonCharacterManager::Instance().SetChose(bValue); Tracef("SetChose: %s", bValue ? "True" : "False"); return Py_BuildNone(); } { "SetChose", miniMapSetChose, METH_VARARGS }, TraceF("code chose") if (test){ do stuff TraceF("true") } else{ do other sutff TraceF("false") } } TraceF("looping rest of code") rest of code logic and in client i call it like miniMap.SetChose(False) or True now i have another problem whatever i chose True or False the code is working with the true value the traceback only show true and after some other edits i manage to make it so that is show true or false whatever i chose but when this happen the rest of the code is no longer working the traceback is not showing looping rest of code If anyone know a fix or go around Ty Link to comment Share on other sites More sharing options...
lTz 12 Posted January 5 Author Share Posted January 5 (edited) Well i did it , somehow is working as i wanted You can t/c ty all Edited January 5 by lTz Link to comment Share on other sites More sharing options...
Recommended Posts
Please sign in to comment
You will be able to leave a comment after signing in
Sign In Now