OpenXcom Forum
OpenXcom => Suggestions => Topic started by: Falko on July 02, 2014, 07:09:21 pm
-
see image
it would be nice to disable unusable buttons in base
it already works for the "new base" button -> (it gets black)
no soldiers -> disable soldiers
no crafts -> disable craft equip
no scientist -> disable research
no engineer -> disable manufacture
also possible but a little more complex:
no item/crafts/aliens/staff -> disable sell/transfer
no space left in base -> disable build new facilities
no storage/hangar/quarters/alien containment -> disable purchase
i sometime click on the wrong base to research stuff so i can likely avoid it
-
Make sense, I support this proposal, there is no need to go to a screen if nothing can be done, apart to close the screen. ;)
But why not in red? ::) 8)
-
red = important = do something! <- thats not the case here
grey = disabled :)
+grey is easy to do if one shifts the button color by a specific range the same color range is not available in red in the base palette iirc
-
It was just a joke. :D
-
I wholly support this idea!
Well, the grey version. :D
-
i have made the source changes already as test
additionally i made "new base" grey instead of black and removed the "clickable" function there but the rest of the grey button can still open their window
but no idea how to get this into the repository :(
-
I wholly support this idea!
Well, the grey version. :D
Mee too. A confortable one
-
+1
For the grey version !
-
Is there room for another button? (for the alien containment)
With this feature you could have a greyed out "Prisoners" button.
-
the room is well used
i looked for a good space for a aliens-button in subwindows but could not find a good place
-
Working code:
https://github.com/SupSuper/OpenXcom/pull/607
You can use it as you want, but IMHO this is not a good idea as it seems. Especially in basescape.
I tested it and I closed this pull request.
-
can you put this in basscapestate.cpp around line ~221?
if (_base->getScientists()>0)
{
_btnResearch->setColor(Palette::blockOffset(13)+5);
}else{
_btnResearch->setColor(Palette::blockOffset(13)+0);
}
if (_base->getEngineers()>0)
{
_btnManufacture->setColor(Palette::blockOffset(13)+5);
}else{
_btnManufacture->setColor(Palette::blockOffset(13)+0);
}
if (_base->getSoldiers()->size()>0)
{
_btnSoldiers->setColor(Palette::blockOffset(13)+5);
}else{
_btnSoldiers->setColor(Palette::blockOffset(13)+0);
}
if (_base->getCrafts()->size()>0)
{
_btnCrafts->setColor(Palette::blockOffset(13)+5);
}else{
_btnCrafts->setColor(Palette::blockOffset(13)+0);
}
if (_base->countAvailableSpace()>0)
{
_btnFacilities->setColor(Palette::blockOffset(13)+5);
}else{
_btnFacilities->setColor(Palette::blockOffset(13)+0);
}
if (_game->getSavedGame()->getBases()->size() < MiniBaseView::MAX_BASES){
_btnNewBase->setColor(Palette::blockOffset(13)+5);
_btnNewBase->onMouseClick((ActionHandler)&BasescapeState::btnNewBaseClick);
}else{
_btnNewBase->setColor(Palette::blockOffset(13)+0);
_btnNewBase->onMouseClick(0);
}
https://_btnNewBase->setVisible(_game->getSavedGame()->getBases()->size() < MiniBaseView::MAX_BASES);
why did you change the textbutton?
-
can you put this in basscapestate.cpp around line ~221?
First version of PR did it:
https://github.com/redv/OpenXcom/commit/96ccf669b0883bfd1797952ac4bfc827f56533ec
Just need change two strings in BasescapeState.cpp
why did you change the textbutton?
Because class TextButton has new field _inactiveColor
and new method void setActive(bool active);
https://github.com/SupSuper/OpenXcom/pull/607/files#diff-0a913ca0ca15ef780316dacfeac21158R74
Believe me, grey "New Base" is very annoying.
-
i found the non-clickable grey new base button not annoying in any way but besides that
could yo add the rest of my code that accomplishe the stuff i suggested in the start thread (grey for buttons that are not needed)
i just changed the color paltte from Palette::blockOffset(13)+5 to to Palette::blockOffset(13)+0 without a need to change the text button
do you have a enable-option in you PR?
-
do you have a enable-option in you PR?
Yes, you can use:
btn->setActive(true); https:// for activate a button
btn->setActive(false); https:// for deactivate.
-
i meant a user option to let the "keep the UI vanilla" guys happy
-
No. Because PR affected only on not-vanilla elements of UI.
-
could yo add the rest of my code that accomplishe the stuff i suggested in the start thread (grey for buttons that are not needed)
No. Because I lost interest in this option.