Jump to content

Functional Panel Menu Thread


Tweak1971

Recommended Posts

mercie_blink.gif SANNY BUILDER CODE WITHOUT CLEO mercie_blink.gif for a complete and FUNCTIONAL menu, yes it actually works, total shocker!!!

 

 

:MenuExampleWait 500If AND  Player.Defined($PLAYER_CHAR)  $ONMISSION == 0  Actor.Stopped($PLAYER_ACTOR)  NOT Actor.Driving($PLAYER_ACTOR)00E1:   player 0 pressed_key 11 // YESElse_Jump @MenuExampleWait 500If AND  Player.Defined($PLAYER_CHAR)  $ONMISSION == 0  Actor.Stopped($PLAYER_ACTOR)  NOT Actor.Driving($PLAYER_ACTOR)00E1:   player 0 pressed_key 11 // YESElse_Jump @MenuExampleWait 500If AND  Player.Defined($PLAYER_CHAR)  $ONMISSION == 0  Actor.Stopped($PLAYER_ACTOR)  NOT Actor.Driving($PLAYER_ACTOR)00E1:   player 0 pressed_key 11 // YESElse_Jump @MenuExample015D: set_gamespeed 0.0Player.CanMove($PLAYER_CHAR) = False07CC: set_player $PLAYER_CHAR button_15 001F7: set_player $PLAYER_CHAR ignored_by_cops 103BF: set_player $PLAYER_CHAR ignored_by_everyone 103E6: remove_text_box0512: show_permanent_text_box 'AMMU_H3'08D4:  $MeMENU = create_panel_with_title 'FEC_NUS' position 29.0 129.0 width 250.0 columns 1 interactive 1 background 1 alignment 008DB:  set_panel $MeMENU column 0 header 'FEC_NUS' data 'B_NUM_0' 'B_NUM_1' 'B_NUM_2' 'B_NUM_3' 'B_NUM_4' 'B_NUM_5' 'B_NUM_6' 'B_NUM_7' 'B_NUM_8' 'B_NUM_9' 'B_NUM10' 'B_NUM11'// Replace 'FEC_NUS' or 'B_NUM_X' with what text you like from the [MAIN]// section of AMERICAN.GXT or if you wish fewer options or just gaps use 'DUMMY'// the "title" and "header" 'FEC_NUS' do not seem to like underscores (_) but try what you like out and see:MenuExampleLoopWait 008D7: $MeChoise = panel $MeMENU active_rowIf80E1:   NOT player 0 pressed_key 15 // Enter/ExitElse_Jump @MenuExampleExitIf00E1:   player 0 pressed_key 16 // SprintElse_Jump @MenuExampleLoop08D7: $MeChoise = panel $MeMENU active_row08DA: remove_panel $MeMENU03E6: remove_text_box015D: set_gamespeed 1.0Player.CanMove($PLAYER_CHAR) = TrueWait 1007CC: set_player $PLAYER_CHAR button_15 101F7: set_player $PLAYER_CHAR ignored_by_cops 003BF: set_player $PLAYER_CHAR ignored_by_everyone 0:MenuExample00If   $MeChoise == 0Else_Jump @MenuExample0100BC: show_text_highpriority GXT 'FEC_NUS' time 3000 flag 101E3: show_text_1number_styled GXT 'NUMBER' number $MeChoise time 1000 style 7 // ~1~Jump @MenuExample:MenuExample01If   $MeChoise == 1Else_Jump @MenuExample0200BC: show_text_highpriority GXT 'FEC_NUS' time 3000 flag 101E3: show_text_1number_styled GXT 'NUMBER' number $MeChoise time 1000 style 7 // ~1~Jump @MenuExample:MenuExample02If   $MeChoise == 2Else_Jump @MenuExample0300BC: show_text_highpriority GXT 'FEC_NUS' time 3000 flag 101E3: show_text_1number_styled GXT 'NUMBER' number $MeChoise time 1000 style 7 // ~1~Jump @MenuExample:MenuExample03If   $MeChoise == 3Else_Jump @MenuExample0400BC: show_text_highpriority GXT 'FEC_NUS' time 3000 flag 101E3: show_text_1number_styled GXT 'NUMBER' number $MeChoise time 1000 style 7 // ~1~Jump @MenuExample:MenuExample04If   $MeChoise == 4Else_Jump @MenuExample0500BC: show_text_highpriority GXT 'FEC_NUS' time 3000 flag 101E3: show_text_1number_styled GXT 'NUMBER' number $MeChoise time 1000 style 7 // ~1~Jump @MenuExample:MenuExample05If   $MeChoise == 5Else_Jump @MenuExample0600BC: show_text_highpriority GXT 'FEC_NUS' time 3000 flag 101E3: show_text_1number_styled GXT 'NUMBER' number $MeChoise time 1000 style 7 // ~1~Jump @MenuExample:MenuExample06If   $MeChoise == 6Else_Jump @MenuExample0700BC: show_text_highpriority GXT 'FEC_NUS' time 3000 flag 101E3: show_text_1number_styled GXT 'NUMBER' number $MeChoise time 1000 style 7 // ~1~Jump @MenuExample:MenuExample07If   $MeChoise == 7Else_Jump @MenuExample0800BC: show_text_highpriority GXT 'FEC_NUS' time 3000 flag 101E3: show_text_1number_styled GXT 'NUMBER' number $MeChoise time 1000 style 7 // ~1~Jump @MenuExample:MenuExample08If   $MeChoise == 8Else_Jump @MenuExample0900BC: show_text_highpriority GXT 'FEC_NUS' time 3000 flag 101E3: show_text_1number_styled GXT 'NUMBER' number $MeChoise time 1000 style 7 // ~1~Jump @MenuExample:MenuExample09If   $MeChoise == 9Else_Jump @MenuExample1000BC: show_text_highpriority GXT 'FEC_NUS' time 3000 flag 101E3: show_text_1number_styled GXT 'NUMBER' number $MeChoise time 1000 style 7 // ~1~Jump @MenuExample:MenuExample10If   $MeChoise == 10Else_Jump @MenuExample1100BC: show_text_highpriority GXT 'FEC_NUS' time 3000 flag 101E3: show_text_1number_styled GXT 'NUMBER' number $MeChoise time 1000 style 7 // ~1~Jump @MenuExample:MenuExample11If   $MeChoise == 11Else_Jump @MenuExample00BC: show_text_highpriority GXT 'FEC_NUS' time 3000 flag 101E3: show_text_1number_styled GXT 'NUMBER' number $MeChoise time 1000 style 7 // ~1~Jump @MenuExample:MenuExampleExit08D7: $MeChoise = panel $MeMENU active_row08DA: remove_panel $MeMENU03E6: remove_text_box015D: set_gamespeed 1.0Player.CanMove($PLAYER_CHAR) = TrueWait 1007CC: set_player $PLAYER_CHAR button_15 101F7: set_player $PLAYER_CHAR ignored_by_cops 003BF: set_player $PLAYER_CHAR ignored_by_everyone 000BC: show_text_highpriority GXT 'CAT_EF' time 3000 flag 2 // ~z~Whatever, baby.Jump @MenuExampleJump @MenuExample

 

 

I could not beleive that I couldn't find any full and functional examples of a panel menu, good lord, does no one actually know how to do this, well here you are and it works.

 

CJ

Link to comment
Share on other sites

TheGodfather.
mercie_blink.gif SANNY BUILDER CODE WITHOUT CLEO mercie_blink.gif for a complete and FUNCTIONAL menu, yes it actually works, total shocker!!!

 

 

:MenuExampleWait 500If AND  Player.Defined($PLAYER_CHAR)  $ONMISSION == 0  Actor.Stopped($PLAYER_ACTOR)  NOT Actor.Driving($PLAYER_ACTOR)00E1:   player 0 pressed_key 11 // YESElse_Jump @MenuExampleWait 500If AND  Player.Defined($PLAYER_CHAR)  $ONMISSION == 0  Actor.Stopped($PLAYER_ACTOR)  NOT Actor.Driving($PLAYER_ACTOR)00E1:   player 0 pressed_key 11 // YESElse_Jump @MenuExampleWait 500If AND  Player.Defined($PLAYER_CHAR)  $ONMISSION == 0  Actor.Stopped($PLAYER_ACTOR)  NOT Actor.Driving($PLAYER_ACTOR)00E1:   player 0 pressed_key 11 // YESElse_Jump @MenuExample015D: set_gamespeed 0.0Player.CanMove($PLAYER_CHAR) = False07CC: set_player $PLAYER_CHAR button_15 001F7: set_player $PLAYER_CHAR ignored_by_cops 103BF: set_player $PLAYER_CHAR ignored_by_everyone 103E6: remove_text_box0512: show_permanent_text_box 'AMMU_H3'08D4:  $MeMENU = create_panel_with_title 'FEC_NUS' position 29.0 129.0 width 250.0 columns 1 interactive 1 background 1 alignment 008DB:  set_panel $MeMENU column 0 header 'FEC_NUS' data 'B_NUM_0' 'B_NUM_1' 'B_NUM_2' 'B_NUM_3' 'B_NUM_4' 'B_NUM_5' 'B_NUM_6' 'B_NUM_7' 'B_NUM_8' 'B_NUM_9' 'B_NUM10' 'B_NUM11'// Replace 'FEC_NUS' or 'B_NUM_X' with what text you like from the [MAIN]// section of AMERICAN.GXT or if you wish fewer options or just gaps use 'DUMMY'// the "title" and "header" 'FEC_NUS' do not seem to like underscores (_) but try what you like out and see:MenuExampleLoopWait 008D7: $MeChoise = panel $MeMENU active_rowIf80E1:   NOT player 0 pressed_key 15 // Enter/ExitElse_Jump @MenuExampleExitIf00E1:   player 0 pressed_key 16 // SprintElse_Jump @MenuExampleLoop08D7: $MeChoise = panel $MeMENU active_row08DA: remove_panel $MeMENU03E6: remove_text_box015D: set_gamespeed 1.0Player.CanMove($PLAYER_CHAR) = TrueWait 1007CC: set_player $PLAYER_CHAR button_15 101F7: set_player $PLAYER_CHAR ignored_by_cops 003BF: set_player $PLAYER_CHAR ignored_by_everyone 0:MenuExample00If   $MeChoise == 0Else_Jump @MenuExample0100BC: show_text_highpriority GXT 'FEC_NUS' time 3000 flag 101E3: show_text_1number_styled GXT 'NUMBER' number $MeChoise time 1000 style 7 // ~1~Jump @MenuExample:MenuExample01If   $MeChoise == 1Else_Jump @MenuExample0200BC: show_text_highpriority GXT 'FEC_NUS' time 3000 flag 101E3: show_text_1number_styled GXT 'NUMBER' number $MeChoise time 1000 style 7 // ~1~Jump @MenuExample:MenuExample02If   $MeChoise == 2Else_Jump @MenuExample0300BC: show_text_highpriority GXT 'FEC_NUS' time 3000 flag 101E3: show_text_1number_styled GXT 'NUMBER' number $MeChoise time 1000 style 7 // ~1~Jump @MenuExample:MenuExample03If   $MeChoise == 3Else_Jump @MenuExample0400BC: show_text_highpriority GXT 'FEC_NUS' time 3000 flag 101E3: show_text_1number_styled GXT 'NUMBER' number $MeChoise time 1000 style 7 // ~1~Jump @MenuExample:MenuExample04If   $MeChoise == 4Else_Jump @MenuExample0500BC: show_text_highpriority GXT 'FEC_NUS' time 3000 flag 101E3: show_text_1number_styled GXT 'NUMBER' number $MeChoise time 1000 style 7 // ~1~Jump @MenuExample:MenuExample05If   $MeChoise == 5Else_Jump @MenuExample0600BC: show_text_highpriority GXT 'FEC_NUS' time 3000 flag 101E3: show_text_1number_styled GXT 'NUMBER' number $MeChoise time 1000 style 7 // ~1~Jump @MenuExample:MenuExample06If   $MeChoise == 6Else_Jump @MenuExample0700BC: show_text_highpriority GXT 'FEC_NUS' time 3000 flag 101E3: show_text_1number_styled GXT 'NUMBER' number $MeChoise time 1000 style 7 // ~1~Jump @MenuExample:MenuExample07If   $MeChoise == 7Else_Jump @MenuExample0800BC: show_text_highpriority GXT 'FEC_NUS' time 3000 flag 101E3: show_text_1number_styled GXT 'NUMBER' number $MeChoise time 1000 style 7 // ~1~Jump @MenuExample:MenuExample08If   $MeChoise == 8Else_Jump @MenuExample0900BC: show_text_highpriority GXT 'FEC_NUS' time 3000 flag 101E3: show_text_1number_styled GXT 'NUMBER' number $MeChoise time 1000 style 7 // ~1~Jump @MenuExample:MenuExample09If   $MeChoise == 9Else_Jump @MenuExample1000BC: show_text_highpriority GXT 'FEC_NUS' time 3000 flag 101E3: show_text_1number_styled GXT 'NUMBER' number $MeChoise time 1000 style 7 // ~1~Jump @MenuExample:MenuExample10If   $MeChoise == 10Else_Jump @MenuExample1100BC: show_text_highpriority GXT 'FEC_NUS' time 3000 flag 101E3: show_text_1number_styled GXT 'NUMBER' number $MeChoise time 1000 style 7 // ~1~Jump @MenuExample:MenuExample11If   $MeChoise == 11Else_Jump @MenuExample00BC: show_text_highpriority GXT 'FEC_NUS' time 3000 flag 101E3: show_text_1number_styled GXT 'NUMBER' number $MeChoise time 1000 style 7 // ~1~Jump @MenuExample:MenuExampleExit08D7: $MeChoise = panel $MeMENU active_row08DA: remove_panel $MeMENU03E6: remove_text_box015D: set_gamespeed 1.0Player.CanMove($PLAYER_CHAR) = TrueWait 1007CC: set_player $PLAYER_CHAR button_15 101F7: set_player $PLAYER_CHAR ignored_by_cops 003BF: set_player $PLAYER_CHAR ignored_by_everyone 000BC: show_text_highpriority GXT 'CAT_EF' time 3000 flag 2 // ~z~Whatever, baby.Jump @MenuExampleJump @MenuExample

 

 

I could not beleive that I couldn't find any full and functional examples of a panel menu, good lord, does no one actually know how to do this, well here you are and it works.

 

CJ

Nice work Have some cookie.gifcookie.gifcookie.gifcookie.gif

Link to comment
Share on other sites

does no one actually know how to do this, well here you are and it works.

Sure nobody knows how to do it.

 

It's a pretty bad code, btw.

Link to comment
Share on other sites

 

dozingoff.gif Actually the code is pretty decent considering i choose not to use CLEO but for the sake of argument, please rewrite it better and show me, I really would like to see and maybe improve it. I have desperatley tried using jump tables but have gone insane and I much better now, twitch twitch...

Edited by Tweak1971
Link to comment
Share on other sites

Cleo isn't necessary for making menu's. And why don't you just look into the main.scm to find menu examples?

Link to comment
Share on other sites

please rewrite it better and show me

Challenge accepted.

 

 

:MenuExamplewhile true   0001: wait 250 ms   if and       0038:   $ONMISSION == 0       044B:   actor $PLAYER_ACTOR on_foot       00E1:   player 0 pressed_key 11   then       0006: 32@ = 0       0006: 0@ = true        // still pressed flag              while 001B:   1500 > 32@           if               80E1:   not player 0 pressed_key 11           then               0006: 0@ = false               break           end           0001: wait 0 ms       end              if            0039:   0@ == true       then           015D: set_gamespeed 0.0           01B4: set_player 0 can_move false           0512: show_permanent_text_box 'AMMU_H3'           08D4: 1@ = create_panel_with_title 'FEC_NUS' position 29.0 129.0 width 250.0 columns 1 interactive 1 background 1 alignment 0           08DB: set_panel 1@ column 0 header 'FEC_NUS' data 'B_NUM_0' 'B_NUM_1' 'B_NUM_2' 'B_NUM_3' 'B_NUM_4' 'B_NUM_5' 'B_NUM_6' 'B_NUM_7' 'B_NUM_8' 'B_NUM_9' 'B_NUM10' 'B_NUM11'           0006: 2@ = 0        // Selected option flag                      while true               0001: wait 0 ms               if                   0039:   2@ == 0               then                   if                       00E1:   player 0 pressed_key 15                   then                       0006: 2@ = 1                   end                   if                       00E1:   player 0 pressed_key 16                   then                       0006: 2@ = 2                   end               else                   if                       0039:   2@ == 1                   then                       if                           80E1:   not player 0 pressed_key 15                       then                           gosub @RemoveMenu                           00BC: show_text_highpriority GXT 'CAT_EF' time 3000 flag 2 // ~z~Whatever, baby.                           break                       end                   end                   if                       0039:   2@ == 2                   then                       if                           80E1:   not player 0 pressed_key 16                       then                           08D8: 3@ = panel 1@ selected_row                           gosub @RemoveMenu                           00BC: show_text_highpriority GXT 'FEC_NUS' time 3000 flag 1                           01E3: show_text_1number_styled GXT 'NUMBER' number 3@ time 1000 style 7                           break                       end                   end               end           end              end   endend:RemoveMenu08DA: remove_panel 1@03E6: remove_text_box015D: set_gamespeed 1.001B4: set_player 0 can_move truereturn

 

By the way - I've never used CLEO in any menus I've made. Odd, eh?

Link to comment
Share on other sites

colgate.gif HEHE, o thank god someone out there is A knows what they are doing and B willing to help, I EAT YOUR COOKIE! Thanks tons, I'll be trying it out by the time you read this.

 

BTB, its not that I thought no one actually knew how, I spent nearly 3 weeks searching thru pages and pages for a genuine example and it seemed as tho people knew they just acted a little proprietary over their work.

 

 

Ok, I reviewed your code. It definitly is more elegant but it does not contain a jump table or any means of jump if, it seems that your prime objection to my code was the way in which i activated the menu. I do appreciate the effort tho.

 

STAND BY, testing something out.

Edited by Tweak1971
Link to comment
Share on other sites

Jumptable? Yet there it goes.

Replace

 

 

if   0039:   2@ == 2then   if       80E1:   not player 0 pressed_key 16   then       08D8: 3@ = panel 1@ selected_row       gosub @RemoveMenu       00BC: show_text_highpriority GXT 'FEC_NUS' time 3000 flag 1       01E3: show_text_1number_styled GXT 'NUMBER' number 3@ time 1000 style 7       break   endend

 

 

with

 

 

if   0039:   2@ == 2then   if       80E1:   not player 0 pressed_key 16   then       08D8: 3@ = panel 1@ selected_row       gosub @RemoveMenu              0871: init_jump_table 3@ total_jumps 12 default_jump 0 @MENU_CASE_END jumps 0 @MENU_CASE_0 1 @MENU_CASE_1 2 @MENU_CASE_2 3 @MENU_CASE_3 4 @MENU_CASE_4 5 @MENU_CASE_5 6 @MENU_CASE_6       0872: jump_table_jumps 7 @MENU_CASE_8 8 @MENU_CASE_8 9 @MENU_CASE_9 10 @MENU_CASE_10 11 @MENU_CASE_11 -1 @MENU_CASE_END -1 @MENU_CASE_END -1 @MENU_CASE_END -1 @MENU_CASE_END              :MENU_CASE_0       // 1st entry selected       jump @MENU_CASE_END              :MENU_CASE_1       // 2nd entry selected       jump @MENU_CASE_END              :MENU_CASE_2       // 3rd entry selected       jump @MENU_CASE_END              :MENU_CASE_3       // 4th entry selected       jump @MENU_CASE_END              :MENU_CASE_4       // 5th entry selected       jump @MENU_CASE_END              :MENU_CASE_5       // 6th entry selected       jump @MENU_CASE_END              :MENU_CASE_6       // 7th entry selected       jump @MENU_CASE_END              :MENU_CASE_7       // 8th entry selected       jump @MENU_CASE_END              :MENU_CASE_8       // 9th entry selected       jump @MENU_CASE_END              :MENU_CASE_9       // 10th entry selected       jump @MENU_CASE_END              :MENU_CASE_10       // 11th entry selected       jump @MENU_CASE_END              :MENU_CASE_11       // 12th entry selected              :MENU_CASE_END      // Not the best way to do this, BUT definitely the most R* style       break   endend

 

 

and fill the options using stuff you want. I think you should be able to get how it works.

 

 

Oh yeah, if you run out of 0871 or 0872 params, just add another 0872 opcode below it, like you'd done a newline for your jumptable (up to 75 cases).

Link to comment
Share on other sites

Ok, Ill give jumptables another go, actually im gonna copy/paste this and change the values. A jumptable bit me once, right in the calve, left a numb bruise for weeks but ok, Ill pet your jumptable. And btw you seem like a decent person, thanks much.

 

At the moment Im working on making a parked #BIKE that spawns with a dolphin attached so I can be bizzare, just for giggles mostly. You must still be coding as you came up with the menu fairly easy, what you working on? CJ

 

PS is there a chat room here? Ill go look.

Link to comment
Share on other sites

You must still be coding as you came up with the menu fairly easy, what you working on?

See my sig + my GTA Garage profile.

 

Also, there's no "Chat room" here, but this topic is pretty close to it:

 

http://www.gtaforums.com/index.php?showtopic=508689

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.