adonthell-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[adonthell-wastesedge-commits] Release_0-3-1 662757a 091/237: FIXED a sm


From: Kai Sterker
Subject: [adonthell-wastesedge-commits] Release_0-3-1 662757a 091/237: FIXED a small bug in the python console
Date: Mon, 25 Jul 2016 18:14:59 +0000 (UTC)

tag: Release_0-3-1
commit 662757a9dc6c57dd2dd84408029e0064566e57b6
Author: adondev <adondev>
Commit: adondev <adondev>

    FIXED a small bug in the python console
    CHANGED the timing of the title sequence a little
    ADDED GNU headers to the scripts
---
 scripts/init.py              |   46 +++++++++++++++++++++++++++---------------
 scripts/modules/console.py   |   23 ++++++++++++++++-----
 scripts/modules/main_menu.py |   14 +++++++++++++
 3 files changed, 62 insertions(+), 21 deletions(-)

diff --git a/scripts/init.py b/scripts/init.py
index 3e72821..8b0b1ad 100755
--- a/scripts/init.py
+++ b/scripts/init.py
@@ -1,15 +1,17 @@
-# -- The themes and fonts we'll use
-win_manager_add_theme ("original")
-win_manager_add_theme ("silverleaf")
-
-win_manager_add_font ("yellow")
-win_manager_add_font ("red")
-win_manager_add_font ("violet")
-win_manager_add_font ("blue")
-win_manager_add_font ("green")
-win_manager_add_font ("white")
-win_manager_add_font ("original")
-win_manager_add_font ("silverleaf")
+#
+#  $Id$
+#
+#  (C) Copyright 2001 Kai Sterker <address@hidden>
+#  Part of the Adonthell Project http://adonthell.linuxgames.com
+#
+#  This program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License.
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY.
+#
+#  See the COPYING file for more details
+#
+
 
 from main_menu import *
 import time
@@ -44,12 +46,24 @@ class title_screen:
     def __init__ (self):
         # -- load our music
         audio_load_background (0, "audio/at-menu-full.ogg")
+        audio_play_background (0)
         audio_load_background (1, "audio/at-dummy-1.ogg")
         audio_load_wave (0, "audio/select.wav")
         audio_load_wave (1, "audio/switch.wav")
         audio_load_wave (2, "audio/unselect.wav")
 
-        audio_play_background (0)
+        # -- The themes and fonts we'll use
+        win_manager_add_theme ("original")
+        win_manager_add_theme ("silverleaf")
+
+        win_manager_add_font ("yellow")
+        win_manager_add_font ("red")
+        win_manager_add_font ("violet")
+        win_manager_add_font ("blue")
+        win_manager_add_font ("green")
+        win_manager_add_font ("white")
+        win_manager_add_font ("original")
+        win_manager_add_font ("silverleaf")
 
         # -- load our images
         self.bag_o = win_image ()
@@ -130,12 +144,12 @@ class title_screen:
         if self.alpha == 255:
             # -- display "Adonthell v0.3"
             self.bag_t.set_visible (1)
-            self.wait_time = 25
+            self.wait_time = 30
             self.draw_func = self.wait
 
         else:
             # -- fade in
-            self.alpha = self.alpha + gametime_frames_to_do() + 1
+            self.alpha = self.alpha + gametime_frames_to_do()
             if self.alpha > 255: self.alpha = 255
             self.bag_c.set_alpha (self.alpha)
 
@@ -165,7 +179,7 @@ class title_screen:
 
         else:
             # -- fade in
-            self.alpha = self.alpha + gametime_frames_to_do() + 1
+            self.alpha = self.alpha + gametime_frames_to_do()
             if self.alpha > 255: self.alpha = 255
             self.bag_o.set_alpha (self.alpha)
 
diff --git a/scripts/modules/console.py b/scripts/modules/console.py
index d1d7dc1..b63d541 100755
--- a/scripts/modules/console.py
+++ b/scripts/modules/console.py
@@ -1,3 +1,17 @@
+#
+#  $Id$
+#
+#  (C) Copyright 2001 Kai Sterker <address@hidden>
+#  Part of the Adonthell Project http://adonthell.linuxgames.com
+#
+#  This program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License.
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY.
+#
+#  See the COPYING file for more details
+#
+
 import sys
 from adonthell import *
 
@@ -62,15 +76,14 @@ class console (win_container):
     # -- callback for command execution
     def on_execute (self):
         text = self.entry.text_char ()
-        # print "Execute", text
- 
+
         # -- if we have a command ...
         if text != None:
-            
             # -- ... add it to command history ...
-            if self.hist_idx == 0 or text != self.history[-1]:
+            if self.hist_idx == 0 or text + '\n' != self.history[-1]:
                 self.history.append (text + '\n')
-                self.hist_idx = len (self.history)
+
+            self.hist_idx = len (self.history)
     
             # -- ... and try to execute it
             try:
diff --git a/scripts/modules/main_menu.py b/scripts/modules/main_menu.py
index 5b575df..09cff53 100755
--- a/scripts/modules/main_menu.py
+++ b/scripts/modules/main_menu.py
@@ -1,3 +1,17 @@
+#
+#  $Id$
+#
+#  (C) Copyright 2001 Kai Sterker <address@hidden>
+#  Part of the Adonthell Project http://adonthell.linuxgames.com
+#
+#  This program is free software; you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License.
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY.
+#
+#  See the COPYING file for more details
+#
+
 from adonthell import *
 
 # The Game Menu



reply via email to

[Prev in Thread] Current Thread [Next in Thread]