How to tell sleeping menu from waiting menu?

Post » Sat Feb 19, 2011 4:58 am

Menumode 1012 is both valid for the sleeping and waiting menu. Is there a way to tell which is showing? Thanks.
User avatar
Jah Allen
 
Posts: 3444
Joined: Wed Jan 24, 2007 2:09 am

Post » Fri Feb 18, 2011 10:07 pm

When menumode is indeed 1012, use IsPCSleeping to test.
User avatar
Lucky Girl
 
Posts: 3486
Joined: Wed Jun 06, 2007 4:14 pm

Post » Sat Feb 19, 2011 2:57 am

IsPCSleeping only returns 1 if the player has pressed the Rest button on the sleeping menu. I however need to know this before pressing that button.
User avatar
Zoe Ratcliffe
 
Posts: 3370
Joined: Mon Feb 19, 2007 12:45 am

Post » Fri Feb 18, 2011 10:06 pm

Hhhhmmm...... Well, the only way the "rest" menu comes up, is if the player activates a usable bed. if you don't have anything against OBSE, you could get the crosshair ref when the player hits the activate key, and test to see if it is a usable bed? This would give you the info before the menu even came up..... sorta.
User avatar
phil walsh
 
Posts: 3317
Joined: Wed May 16, 2007 8:46 pm

Post » Sat Feb 19, 2011 3:55 am

I'm currently trying to add support for a mod called ''Roughing It'', which enables you to sleep without actually having a bed, so the crosshair idea doesn't work that well. an option might be to do let mystring := ( GetMenuStringValue "sleep_background\sleep_display_text\string" 1012 ) and compare it with the sleeping string, but I'm guessing this string will be different depending on the game language used and I can't find the string in the game settings anywhere.
User avatar
Colton Idonthavealastna
 
Posts: 3337
Joined: Sun Sep 30, 2007 2:13 am

Post » Fri Feb 18, 2011 11:01 pm

What about using a modifier key along with the "rest/wait" key, for when you want to 'rough it'? Just intercept the menu..... and activate a virtual 'bed' instead?
User avatar
Claire Jackson
 
Posts: 3422
Joined: Thu Jul 20, 2006 11:38 pm

Post » Sat Feb 19, 2011 3:43 am

The ''Roughing It'' mod isn't mine, but I guess I could always create my own version and make them compatible.
User avatar
JUan Martinez
 
Posts: 3552
Joined: Tue Oct 16, 2007 7:12 am

Post » Fri Feb 18, 2011 8:40 pm

From the xml:
<!-- sleep_wait_menu.xml -->	 &SleepWaitMenu; 	 &no_click_past; 		0 	 0.25 	 &true; 		 &false; 	<!-- true if sleeping, false if waiting -->

So this:
if GetMenuFloatValue "user0" 1012 == 2  ; the user is trying to sleepelse  ; the user is trying to waitendif

should probably do the trick.
Wow, that syntax highlighting is horrid.
User avatar
Flesh Tunnel
 
Posts: 3409
Joined: Mon Sep 18, 2006 7:43 pm

Post » Fri Feb 18, 2011 10:11 pm

That does indeed work. Thanks!
User avatar
Rach B
 
Posts: 3419
Joined: Thu Mar 08, 2007 11:30 am


Return to IV - Oblivion