2015-06-12 13:14:38 +00:00
|
|
|
#if defined(Hiro_MenuRadioItem)
|
|
|
|
|
|
|
|
namespace hiro {
|
|
|
|
|
|
|
|
auto pMenuRadioItem::construct() -> void {
|
Update to v094r43 release.
byuu says:
Updated to compile with all of the new hiro changes. My next step is to
write up hiro API documentation, and move the API from alpha (constantly
changing) to beta (rarely changing), in preparation for the first stable
release (backward-compatible changes only.)
Added "--fullscreen" command-line option. I like this over
a configuration file option. Lets you use the emulator in both modes
without having to modify the config file each time.
Also enhanced the command-line game loading. You can now use any of
these methods:
higan /path/to/game-folder.sfc
higan /path/to/game-folder.sfc/
higan /path/to/game-folder.sfc/program.rom
The idea is to support launchers that insist on loading files only.
Technically, the file can be any name (manifest.bml also works); the
only criteria is that the file actually exists and is a file, and not
a directory. This is a requirement to support the first version (a
directory lacking the trailing / identifier), because I don't want my
nall::string class to query the file system to determine if the string
is an actual existing file or directory for its pathname() / dirname()
functions.
Anyway, every game folder I've made so far has program.rom, and that's
very unlikely to change, so this should be fine.
Now, of course, if you drop a regular "game.sfc" file on the emulator,
it won't even try to load it, unless it's in a folder that ends in .fc,
.sfc, etc. In which case, it'll bail out immediately by being unable to
produce a manifest for what is obviously not really a game folder.
2015-08-30 02:08:26 +00:00
|
|
|
setGroup(state().group);
|
2015-06-12 13:14:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
auto pMenuRadioItem::destruct() -> void {
|
|
|
|
}
|
|
|
|
|
|
|
|
auto pMenuRadioItem::setChecked() -> void {
|
Update to v094r43 release.
byuu says:
Updated to compile with all of the new hiro changes. My next step is to
write up hiro API documentation, and move the API from alpha (constantly
changing) to beta (rarely changing), in preparation for the first stable
release (backward-compatible changes only.)
Added "--fullscreen" command-line option. I like this over
a configuration file option. Lets you use the emulator in both modes
without having to modify the config file each time.
Also enhanced the command-line game loading. You can now use any of
these methods:
higan /path/to/game-folder.sfc
higan /path/to/game-folder.sfc/
higan /path/to/game-folder.sfc/program.rom
The idea is to support launchers that insist on loading files only.
Technically, the file can be any name (manifest.bml also works); the
only criteria is that the file actually exists and is a file, and not
a directory. This is a requirement to support the first version (a
directory lacking the trailing / identifier), because I don't want my
nall::string class to query the file system to determine if the string
is an actual existing file or directory for its pathname() / dirname()
functions.
Anyway, every game folder I've made so far has program.rom, and that's
very unlikely to change, so this should be fine.
Now, of course, if you drop a regular "game.sfc" file on the emulator,
it won't even try to load it, unless it's in a folder that ends in .fc,
.sfc, etc. In which case, it'll bail out immediately by being unable to
produce a manifest for what is obviously not really a game folder.
2015-08-30 02:08:26 +00:00
|
|
|
if(auto& group = state().group) {
|
2015-06-12 13:14:38 +00:00
|
|
|
for(auto& weak : group->state.objects) {
|
|
|
|
if(auto object = weak.acquire()) {
|
|
|
|
if(auto menuRadioItem = dynamic_cast<mMenuRadioItem*>(object.data())) {
|
|
|
|
if(auto self = menuRadioItem->self()) {
|
|
|
|
if(auto menu = self->_parentMenu()) {
|
|
|
|
//CheckMenuRadioItem takes: lo, hi, id; checking only id when lo <= id <= hi
|
|
|
|
//hiro does not force IDs to be linear, so to uncheck id, we use: lo == hi == id + 1 (out of range)
|
|
|
|
//to check id, we use: lo == hi == id (only ID, but in range)
|
|
|
|
CheckMenuRadioItem(
|
|
|
|
menu->hmenu,
|
|
|
|
self->position, self->position, self->position + (position != self->position),
|
|
|
|
MF_BYPOSITION
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
auto pMenuRadioItem::setGroup(sGroup group) -> void {
|
Update to v094r43 release.
byuu says:
Updated to compile with all of the new hiro changes. My next step is to
write up hiro API documentation, and move the API from alpha (constantly
changing) to beta (rarely changing), in preparation for the first stable
release (backward-compatible changes only.)
Added "--fullscreen" command-line option. I like this over
a configuration file option. Lets you use the emulator in both modes
without having to modify the config file each time.
Also enhanced the command-line game loading. You can now use any of
these methods:
higan /path/to/game-folder.sfc
higan /path/to/game-folder.sfc/
higan /path/to/game-folder.sfc/program.rom
The idea is to support launchers that insist on loading files only.
Technically, the file can be any name (manifest.bml also works); the
only criteria is that the file actually exists and is a file, and not
a directory. This is a requirement to support the first version (a
directory lacking the trailing / identifier), because I don't want my
nall::string class to query the file system to determine if the string
is an actual existing file or directory for its pathname() / dirname()
functions.
Anyway, every game folder I've made so far has program.rom, and that's
very unlikely to change, so this should be fine.
Now, of course, if you drop a regular "game.sfc" file on the emulator,
it won't even try to load it, unless it's in a folder that ends in .fc,
.sfc, etc. In which case, it'll bail out immediately by being unable to
produce a manifest for what is obviously not really a game folder.
2015-08-30 02:08:26 +00:00
|
|
|
bool first = true;
|
|
|
|
if(auto& group = state().group) {
|
|
|
|
for(auto& weak : group->state.objects) {
|
|
|
|
if(auto object = weak.acquire()) {
|
|
|
|
if(auto menuRadioItem = dynamic_cast<mMenuRadioItem*>(object.data())) {
|
|
|
|
if(auto self = menuRadioItem->self()) {
|
|
|
|
menuRadioItem->state.checked = first;
|
|
|
|
first = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
setChecked();
|
2015-06-12 13:14:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
auto pMenuRadioItem::setText(const string& text) -> void {
|
|
|
|
_synchronize();
|
|
|
|
}
|
|
|
|
|
|
|
|
auto pMenuRadioItem::onActivate() -> void {
|
|
|
|
if(state().checked) return;
|
|
|
|
self().setChecked();
|
|
|
|
self().doActivate();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|