Skip to content

Commit 3989dc7

Browse files
committed
Version 0.4.9.
Improved the UI.
1 parent cebc7ea commit 3989dc7

14 files changed

+568
-517
lines changed

src/scripts/ace_deleter.nut

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,12 @@ class AceDeleter
2727
//return
2828
}
2929
}
30+
31+
function Flush()
32+
{
33+
foreach(n,current_item in item_list)
34+
SceneDeleteObject(ItemGetScene(current_item), ItemCastToObject(current_item))
35+
36+
item_list = []
37+
}
3038
}

src/scripts/black_screen.nut

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,6 @@ class levels_black_screen
2323
*/
2424
function OnSetup(scene)
2525
{
26-
ui = SceneGetUI(scene)
27-
local _black_screen
28-
_black_screen = UIAddSprite(ui, -1, EngineLoadTexture(g_engine, "graphics/black.jpg"), 1280.0 / 2.0, 960.0 / 2.0, 16.0, 16.0)
29-
WindowSetPivot(_black_screen, 8, 8)
30-
WindowCentre(_black_screen)
31-
WindowSetScale(_black_screen, 2048.0 / 16.0 * 1.5, 2048 / 16.0 * 1.5)
26+
CreateOpaqueScreen(SceneGetUI(scene))
3227
}
3328
}

src/scripts/game_over.nut

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ class GameOverScreen
3333
print("GameOverScreen::ShowStoryImage()")
3434
local story_texture, fname
3535
local ui = SceneGetUI(scene)
36+
37+
CreateOpaqueScreen(ui)
3638

3739
fname = "ui/story_game_over.jpg"
3840
if (FileExists(fname))

src/scripts/level_end_ui.nut

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ class LevelEndUI extends BaseUI
2525

2626
base.constructor(_ui)
2727

28+
CreateOpaqueScreen(_ui)
29+
2830
old_stats = {}
2931

3032
// Scores ...

src/scripts/level_handler.nut

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ class LevelHandler extends SceneWithThreadHandler
471471
if (_dist < Mtr(2.5))
472472
{
473473
// Remove it, from scene & from the bonus list
474-
ItemActivateHierarchy(_item, false)
474+
SceneDeleteItemHierarchy(scene, _item) //ItemActivateHierarchy(_item, false)
475475
feedback_emitter.Emit(ItemGetWorldPosition(_item))
476476
PlaySfxGotItem()
477477

@@ -525,7 +525,8 @@ class LevelHandler extends SceneWithThreadHandler
525525
if (ItemCompare(val, _item))
526526
{
527527
artefact.remove(idx)
528-
ItemActivateHierarchy(_item, false)
528+
//ItemActivateHierarchy(_item, false)
529+
SceneDeleteItemHierarchy(scene, _item)
529530
}
530531

531532
feedback_emitter.Emit(ItemGetWorldPosition(_item))

src/scripts/logo.nut

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ class LogoScreen
3535
local ui, logo, logo_flash, logo_handler
3636
ui = SceneGetUI(scene)
3737

38+
CreateOpaqueScreen(ui)
39+
3840
logo_handler = UIAddWindow(ui, -1, 0, 0, 2, 2)
3941

4042
logo = UIAddSprite(ui, -1, EngineLoadTexture(g_engine, "ui/astrofra_logo.png"), 0, 0, 256, 256)
@@ -51,7 +53,7 @@ class LogoScreen
5153
WindowSetCommandList(logo_handler, "nop 0.5;toposition 0.25,0,8;toposition 0.25,0,10;")
5254
WindowSetCommandList(logo_flash, "toalpha 0,1;toalpha 2.0,0;")
5355

54-
// sfx_channel = MixerSoundStart(g_mixer, EngineLoadSound(g_engine, "audio/sfx/sfx_polaroid.wav"))
56+
sfx_channel = MixerSoundStart(g_mixer, EngineLoadSound(g_engine, "audio/sfx/sfx_polaroid.wav"))
5557
// MixerChannelLock(g_mixer, sfx_channel)
5658
}
5759
}

src/scripts/particle_emitter.nut

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,12 @@ class ParticleEmitter
6464

6565
}
6666

67+
function OnDelete(item)
68+
{
69+
print("ParticleEmitter::OnDelete()")
70+
ace_deleter.Flush()
71+
}
72+
6773
function OnSetupDone(item)
6874
{
6975
current_camera = SceneGetCurrentCamera(scene)

src/scripts/project.nut

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,9 @@
2020
Include("scripts/particle_emitter.nut")
2121
Include("scripts/save.nut")
2222
Include("scripts/stopwatch_handler.nut")
23-
Include("scripts/title.nut")
2423
Include("scripts/ui.nut")
24+
Include("scripts/title_ui.nut")
25+
Include("scripts/title.nut")
2526
Include("scripts/game_ui.nut")
2627
Include("scripts/level_end_ui.nut")
2728
Include("scripts/utils.nut")

0 commit comments

Comments
 (0)