Skip to content

Commit

Permalink
Test case for object controller.
Browse files Browse the repository at this point in the history
- Press i⃣ to bring up the inventory screen.
- You should see (but don't) a large frogatto, and beneath him two smaller frogattos. Instead, you see a large frogatto, and one smaller frogatto in the upper-left of the window.
  • Loading branch information
David committed Apr 3, 2015
1 parent ebccda0 commit 88f915a
Showing 1 changed file with 40 additions and 4 deletions.
44 changes: 40 additions & 4 deletions data/objects/effects/general/inventory_screen_controller_2.cfg
Expand Up @@ -28,7 +28,7 @@ properties: {

panel_offset: {
type: "function() -> Vector",
init: "def() [-600,0]",
init: "def() [0,0]",
},


Expand Down Expand Up @@ -56,7 +56,7 @@ on_create: "[
if(pause_level, set(me.paused, false)),
//Fade black backdrop in.
set(draw_area, if(pause_level,
null or set(draw_area, if(pause_level,
[0, 0, level.camera_position[2]/2 + panel_separation, level.camera_position[3]/2],
[0, 0, 0, 0]
)),
Expand All @@ -75,6 +75,38 @@ on_create: "[
//Left Pane
add_object(left_pane),
execute(left_pane, set_widgets([{
type: 'rich_text_label',
id: 'chat',
width: 500, height: 400,
font_size: 16,
parent: left_pane,
auto_scroll_bottom: true,
alpha: 50,
},{
//Frogatto image.
type: 'image',
image: 'characters/frogatto-spritesheet1.png',
area: [2,89,33,121],
image_width: (33-2)*4,
image_height: (121-89)*4,
x: 370, y: 25,
}] + if(not player.swallowed_object, [], [{
//Frogatto belly contents image.
type: 'object',
object: (obj throwable <- player.swallowed_object).type,
x: 370, y: 125,
}]) + [{
//Frogatto belly contents image.
type: 'object',
object: player.type,
x: 370, y: 125,
},{
//Frogatto belly contents image.
type: 'object',
object: player,
x: 370, y: 175,
}])),
//Right Pane
Expand Down Expand Up @@ -119,6 +151,11 @@ on_create: "[
),
",

on_type_updated: "[
debug('Killed inventory screen on reload. (c${level.cycle})'),
die(),
]",

on_die: "[
/* Doesn't work with blend_modes set.
//Fade black backdrop out.
Expand All @@ -143,8 +180,7 @@ on_process: "[
if(pause_level, add(player.cycle, 1)), //pump cycle to get keyboard inputs
if(cycle > 1 and player.ctrl_keyboard('i') = 1, [ //>1: Prevent open then close.
fire_event('die'),
remove_object(me),
die()
]),
if(player.ctrl_keyboard(left) = 1, slide_from_to(panel_offset(), [0,0])), //Can't put panel_offset() in slide_from_to.
Expand Down

0 comments on commit 88f915a

Please sign in to comment.