Archiv verlassen und diese Seite im Standarddesign anzeigen : Itemmenu
Ich möchte ein anderes Itemmenu.
Es soll folgendes Aufweisen:
- Beim Druck auf Escape soll man zur Karte teleportiert werden, NICHT INS MENU!
- Wenn es das Item Goldmünze zwei malgibt, sollen sie getrennt angezeigt werden, so als seien sie verschiedene Items.
- Es soll mit dem Befehl
$scene = Scene_Item.new aufgerufen werden können
- Es soll so ähnlich wie das aus Shadowgate 64 (n64) aussehen.
- Die Items sollen auf 5 - 7 verteilt werden
- Wenn es mehr als 32 Items im Menu sind[was ja wegen Extra 2 leicht sein wird] eine zweite Seite geben, in die man mit Q/W wechseln kann
- Die Itembeschreibung soll unten stehen
- Es soll keine Zahlen geben, die sagen, wie oft man das Item hat
- Der Name des Items steht in der Beschreibung, NICHT NEBER DEN ICON
Wie kann ich mir das leichter vorstellen?
A: Jeder, der Shadowgate 64 hat, soll sich ein Beispiel drannehmen.
Wie stelle ich mir das Menu vor?
Ein bissl runterscrollen bitte^^
http://img195.imageshack.us/img195/9729/menuwunsch.jpg
Belohnung:
Creditseintrag, Besonderer Dank an XYZ und [wenn möglich einbaubar] Gastrolle
- Beim Druck auf Escape soll man zur Karte teleportiert werden, NICHT INS MENU!
Wie meinst du das, das wenn man esc drückt die map noch hinter dem menü zu sehen is oder das man auf ne bestimmte map teleportiert wird?
In letzterem Fall kannst du einfach das menu deaktivieren (Menu Disable) und Machst ein common event, das wenn Button "B"(esc) gedrückt wird die coordinaten speichert und den player auf die neue map teleportiert, und bei erneutem drücken wieder auf die coordinaten zurück teleportiert.
man geht zur aktuellen Karte. Aber nicht ins Menu...
er will das man zurück auf die map kommt wenn man es schließt.
einfach nach sowas in der input abfrage suchen
$scene = Scene_Menu.new(0)
und so abändern
$scene = Scene_Map.new
...
das habe ich ja schon gemacht:D
Ruby kann ich ja auch noch ein bissl^^
Aber ich will ein Itemmenu wie aus Shadowgate64
Achso ich verstehe ;). Naja machen könnt ichs schon aber hab im moment nich sehr viel zeit und lust da ich an eigenen projekten arbeite. Die Fenster so anzuordnen das die beschreibung unten steht und sie transparent sind und das im hintergrund die map is is ja nich schwer und geht schnell aber auf den rest hab ich nich so wirklich lust, aber wenn du willst kann ich dir das schonma machen.
wollen schon, ja^^ Aber mach erstmal den leichten Teil:D
Den anderen kannst du oder jemand anders als "Addon" machen:)
Aber bitte kommentiere dies
ok ich mach mich ma dran, wer weis wenn ich grade zeit hab mach ich villt auch noch den rest kann nur 1, 2 tage dauern;)
lass dir ruhig Zeit^^ Ich kann warten.
Es ist auch nicht dringend - momentan kann ich auch so arbeiten...
Blos für die Vollversion bzw. Demo brauche ich sie:D
Ok das aussehen is fertig fehlen nur noch die restlichen sachen. Hier is mal nen screen soll ich das so lassen oder die fenster noch anders anordnen?
4735
darf ich dich küssen?^^
Nein, lass das so. Sehr gut gemacht
- Wenn es das Item Goldmünze zwei malgibt, sollen sie getrennt angezeigt werden, so als seien sie verschiedene Items.
Weis irgentwer wie ich das am besten hinbekomm? Hab jetz schon alles mögliche versucht aber es will nich.
naja, das kann ich selbst machen... Mach dir darum keine sorgen:D
... nur mal so blauäugig gefragt, darf ich das Skript mal sehen? Es würde mich echt interessieren wie es gemacht ist, ich würde es nichtmal benutzen wollen. Aber man lernt ja am besten wenn man sich andrer Leute Arbeit anschaut, und etwas in dieser Richtung wollte ich schon immer mal sehen. :D
Das is schwieriger als es sich anhört.
Das problem is das items generell schon beim aufheben gestapelt werden also hat man quasi jedes item nur einmal, auch wenn man es 3 mal angezeigt wird und es wird nur aus dem Inventar gelöscht wenn es auf 0 steht also verbraucht ist.
Also wär für mich der logischste weg wenn man den interpreter so verändert, das wenn man mehr als ein item bekommt es automatisch neue items mit der gleichen funktion erstellt und diese dem inventar hinzufügt. Allerdings hab ich keinen plan wie ich das machen soll :confused:
@mhm:
Wenns fertig ist, im moment funktionierts ja noch gar nich komplett ;)
Weis irgentwer wie ich das am besten hinbekomm? Hab jetz schon alles mögliche versucht aber es will nich.
Lösung:
Wenn es das Item Goldmünze zwei malgibt, sollen sie getrennt angezeigt werden, so als seien sie verschiedene Items.
Ist mir eben selbst eingefallen:\:eek::rolleyes:...
jap mir is auch grad ne bessere idee gekommen als die eben^^.
Da die nummer von den items ehh nich angezeigt wird zeig ich einfach das item 2 mal, also wenn eine nummer da stehn würde würde bei beiden stehen, das man 2 stück davon hat und wenn man eins benutzt wird beiden eins abgezogen da man die nummer aber nicht sieht siehts aus als hätte man das item 2 mal. naja ich mach heut au nich mehr lange aber du hast ja gesacht es hat zeit^^
ich muss gestehn ich krichs nich hin, aber wenn du weist wies geht mach das ma mit dem normalen item menu dann bau ichs in das neue mit ein
ich mache dann einfach mehrere Items der gleichen Art.
hmm ok ich mach das dann villt später nach. das script is jetz sogut wie fertig fehlt nur noch eine sache :)
immer so geheimnissvoll^^
Bestimmt die zweite Seite.
lol du lucker habs grad durch nen zufall geschafft^^
mehrere items werden nun nebeneinander angezeigt
welche Sache fehlt dir noch?
ja du hattest recht nur noch mehrere seiten, das is aber inch allzu schwer
Eine frage noch, ist es schlimm wenn die nicht ausgerüsteten gegenstände nich im menü angezeigt werden? (im normalen menu sinn die ehh grau un können nicht benutzt werden)
Nein, gar net schlimm... Eher gut^^
ps:
Warum denkt mein PC, ich würde FN drücken?
Gut das erspart ne menge arbeit^^.
Bin warscheinlich bis morgen fertig
Warum denkt mein PC, ich würde FN drücken?
Das prob hatte ich mal mit strg, lag an nem makro das strg aktiviert hatte aber nich mehr deaktiviert so dachte windows ich würde dauerhaft strg drücken, müsste sich aber nach nem neustart beheben^^
ich habemeinen Lap 10 mal neugestartet... Alles ohne erfolg... Google sagte mir: FN + F11^^
Und es geht wieder:D
PS: Lass dir ruhig Zeit. Es eilt wie gesagt net. Und du arbeitest schon seit 2 Tagen... Machst du noch dein Projekt überhaupt???
So fertig is es:
Das Menu kann mit folgendem code aufgerufen werden:
$scene = Scene_Item.new
Es zeigt pro seite 8x4 Items (also 32) und bei mehr als 32 Items erstellt es automatisch eine neue seite, genauso bei mehr als 64 Items usw. Die Seiten können mit Q, W gewechselt werden. Wenn man von einer sorte mehr als 1 Item hat, werden diese nicht gestapelt, sondern nebeneinander angezeigt. Wenn der name des Items angezeigt werden soll schreibt diesen einfach in die Item beschreibung.
Unter CONFIG_ITEM können ein paar sachen eingestellt werden (im script die ersten paar zeilen):
OPACITY = 160
WINDOWSKIN = "menu"
MAP_TRANSFER = true
ITEM_TEXT = "Items"
EQUIP_TEXT = "Equip"
INFO_COLOR = [255, 255, 255] #[RED, GREEN, BLUE]<- Farbmischung
EQUIPMENT = true
OPACITY: Die durchsichtigkeit der Fenster
WINDOWSKIN: Das Windowskin fürs Menü. Achtung: Hierfür bitte ein neues Skin anlegen was die 4 Pfeile (beim skin oben rechts in der ecke, in der mitte von dem kasten) nicht hat, also wenn nötig löschen, da diese sonst im menü angezeigt werden.
MAP_TRANSFER: Auf true/false stellen, wenn der player nach beenden des menüs auf die map stat ins menü soll.
ITEM_TEXT, EQUIP_TEXT: Die Namen der beiden Fenster.
INFO_COLOR: Die Schriftfarben für die Fensternamen
EQUIPMENT: Auf true/false setzen wenn das Equipment fenster angezeigt werden soll
Hier das Script
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# *Item-Menu
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# created by strich
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
module CONFIG_ITEM # Configurations
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#-> Durchsichtigkeit der Fenster
OPACITY = 160
#-> Das Windowskin für die Fenster
#-> Bitte ein neues Skin erstellen was die 4 Pfeile (die oben rechts in der mitte,
#-> einen nach oben, einen nach unten, einen nach rechts und einen nach links)
#-> nicht hat, weil diese sonst im menu erscheinen.
WINDOWSKIN = "menu"
#-> Beim Beenden des fensters kommt man auf die map/ins menü (true/false)
MAP_TRANSFER = true
#-> Beschreibungen der beiden Fenster und die schriftfarbe
ITEM_TEXT = "Items"
EQUIP_TEXT = "Equip"
INFO_COLOR = [255, 255, 255] #[RED, GREEN, BLUE]<- Farbmischung
#Hinweis: Die farbmischungen sind die gleichen wie bei dem Event-Befehl: Change Screen Color Tone
#-> Equipment fenster anzeigen/nicht anzeigen (true/false)
EQUIPMENT = true
#Hinweis: Es wird immer die Aurüstung von dem in der Party obersten angezeigt.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
end # Configurations end
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Here we go!
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#==============================================================================
# ** Window_Help
#------------------------------------------------------------------------------
# This window shows skill and item explanations along with actor status.
#==============================================================================
class Window_Help_Item < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
if CONFIG_ITEM::EQUIPMENT == true
super(32 * 8 / 4, 480 - 64 - 64, 640 - 32 * 8 / 2 - 96, 64)
else
super(32 * 8 / 4, 480 - 64 - 64, 640 - 32 * 8 / 2, 64)
end
self.contents = Bitmap.new(width - 32, height - 32)
self.windowskin = RPG::Cache.windowskin(CONFIG_ITEM::WINDOWSKIN)
self.back_opacity = CONFIG_ITEM::OPACITY
end
#--------------------------------------------------------------------------
# * Set Text
# text : text string displayed in window
# align : alignment (0..flush left, 1..center, 2..flush right)
#--------------------------------------------------------------------------
def set_text(text, align = 0)
# If at least one part of text and alignment differ from last time
if text != @text or align != @align
# Redraw text
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, self.width - 40, 32, text, align)
@text = text
@align = align
@actor = nil
end
self.visible = true
end
#--------------------------------------------------------------------------
# * Set Actor
# actor : status displaying actor
#--------------------------------------------------------------------------
def set_actor(actor)
if actor != @actor
self.contents.clear
draw_actor_name(actor, 4, 0)
draw_actor_state(actor, 140, 0)
draw_actor_hp(actor, 284, 0)
draw_actor_sp(actor, 460, 0)
@actor = actor
@text = nil
self.visible = true
end
end
#--------------------------------------------------------------------------
# * Set Enemy
# enemy : name and status displaying enemy
#--------------------------------------------------------------------------
def set_enemy(enemy)
text = enemy.name
state_text = make_battler_state_text(enemy, 112, false)
if state_text != ""
text += " " + state_text
end
set_text(text, 1)
end
end
#==============================================================================
# ** Window_EquipRight
#------------------------------------------------------------------------------
# This window displays items the actor is currently equipped with on the
# equipment screen.
#==============================================================================
class Window_EquipRight_Item < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
# actor : actor
#--------------------------------------------------------------------------
def initialize(actor)
super(488, 352, 88, 120)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = CONFIG_ITEM::OPACITY
self.windowskin = RPG::Cache.windowskin(CONFIG_ITEM::WINDOWSKIN)
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@data = []
@data.push($data_weapons[@actor.weapon_id])
@data.push($data_armors[@actor.armor1_id])
@data.push($data_armors[@actor.armor2_id])
@data.push($data_armors[@actor.armor3_id])
@data.push($data_armors[@actor.armor4_id])
draw_equip(@data[0], 0 , 0 ) #<-- Weapon
draw_equip(@data[1], 32, 0 ) #<-- Shield
draw_equip(@data[2], 0 , 32) #<-- Helmet
draw_equip(@data[3], 32, 32) #<-- Armor
draw_equip(@data[4], 16, 64) #<-- Accesoir
end
def draw_equip(item, x, y)
if item == nil
return
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y, bitmap, Rect.new(0, 0, 24, 24))
end
end
#==============================================================================
# ** Window_Selectable
#------------------------------------------------------------------------------
# This window class contains cursor movement and scroll functions.
# Ich weis, verbraucht viel platz aber muss leider sein.
#==============================================================================
class Window_Selectable_Item < Window_Base
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :index # cursor position
attr_reader :help_window # help window
#--------------------------------------------------------------------------
# * Object Initialization
# x : window x-coordinate
# y : window y-coordinate
# width : window width
# height : window height
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super(x, y, width, height)
@item_max = 1
@column_max = 1
@index = -1
end
#--------------------------------------------------------------------------
# * Set Cursor Position
# index : new cursor position
#--------------------------------------------------------------------------
def index=(index)
@index = index
# Update Help Text (update_help is defined by the subclasses)
if self.active and @help_window != nil
update_help
end
# Update cursor rectangle
update_cursor_rect
end
#--------------------------------------------------------------------------
# * Get Row Count
#--------------------------------------------------------------------------
def row_max
# Compute rows from number of items and columns
return (@item_max * 2 + @column_max - 1) / @column_max
end
#--------------------------------------------------------------------------
# * Get Top Row
#--------------------------------------------------------------------------
def top_row
# Divide y-coordinate of window contents transfer origin by 1 row
# height of 32
return self.oy / 32
end
#--------------------------------------------------------------------------
# * Set Top Row
# row : row shown on top
#--------------------------------------------------------------------------
def top_row=(row)
# If row is less than 0, change it to 0
if row < 0
row = 0
end
# If row exceeds row_max - 1, change it to row_max - 1
if row > row_max - 1
row = row_max - 1
end
# Multiply 1 row height by 32 for y-coordinate of window contents
# transfer origin
self.oy = row * 32
end
#--------------------------------------------------------------------------
# * Get Number of Rows Displayable on 1 Page
#--------------------------------------------------------------------------
def page_row_max
# Subtract a frame height of 32 from the window height, and divide it by
# 1 row height of 32
return (self.height - 32) / 32
end
#--------------------------------------------------------------------------
# * Get Number of Items Displayable on 1 Page
#--------------------------------------------------------------------------
def page_item_max
# Multiply row count (page_row_max) times column count (@column_max)
return page_row_max * @column_max
end
#--------------------------------------------------------------------------
# * Set Help Window
# help_window : new help window
#--------------------------------------------------------------------------
def help_window=(help_window)
@help_window = help_window
# Update help text (update_help is defined by the subclasses)
if self.active and @help_window != nil
update_help
end
end
#--------------------------------------------------------------------------
# * Update Cursor Rectangle
#--------------------------------------------------------------------------
def update_cursor_rect
# If cursor position is less than 0
if @index < 0
self.cursor_rect.empty
return
end
# Get current row
row = @index / @column_max
# If current row is before top row
if row < self.top_row
# Scroll so that current row becomes top row
#self.top_row = row
end
# If current row is more to back than back row
if row > self.top_row + (self.page_row_max - 1)
# Scroll so that current row becomes back row
#self.top_row = row - (self.page_row_max - 1)
end
# Calculate cursor width
cursor_width = self.width / @column_max - 32
# Calculate cursor coordinates
x = @index % @column_max * (cursor_width + 32)
y = @index / @column_max * (192/3) - self.oy
# Update cursor rectangle
self.cursor_rect.set(x, y, cursor_width, 32)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
# If cursor is movable
if self.active and @item_max > 0 and @index >= 0
# If pressing down on the directional buttons
if Input.repeat?(Input::DOWN)
# If column count is 1 and directional button was pressed down with no
# repeat, or if cursor position is more to the front than
# (item count - column count)
if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
@index <= ($currentpage * 32 - @column_max) - 1
# Move cursor down
$game_system.se_play($data_system.cursor_se)
@index = (@index + @column_max)# % @item_max
end
end
# If the up directional button was pressed
if Input.repeat?(Input::UP)
# If column count is 1 and directional button was pressed up with no
# repeat, or if cursor position is more to the back than column count
if (@column_max == 1 and Input.trigger?(Input::UP)) or
@index >= ($currentpage * 32 + @column_max) -32#@column_max
# Move cursor up
$game_system.se_play($data_system.cursor_se)
@index = (@index - @column_max)
end
end
# If the right directional button was pressed
if Input.repeat?(Input::RIGHT)
# If column count is 2 or more, and cursor position is closer to front
# than (item count -1)
if @column_max >= 2 and @index <= ($currentpage * 32)-2
# Move cursor right
$game_system.se_play($data_system.cursor_se)
@index += 1
end
end
# If the left directional button was pressed
if Input.repeat?(Input::LEFT)
# If column count is 2 or more, and cursor position is more back than 0
if @column_max >= 2 and @index >= ($currentpage * 32) - 32 + 1
# Move cursor left
$game_system.se_play($data_system.cursor_se)
@index -= 1
end
end
# If R button was pressed
if Input.repeat?(Input::R)
# If bottom row being displayed is more to front than bottom data row
#if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
# Move cursor 1 page back#
$currentpage += 1
$game_system.se_play($data_system.cursor_se)
@index += 32#[@index + self.page_item_max, @item_max - 1].min
self.top_row += 8
#end
end
# If L button was pressed
if Input.repeat?(Input::L)
# If top row being displayed is more to back than 0
#if self.top_row > 0
# Move cursor 1 page forward
$currentpage -= 1
$game_system.se_play($data_system.cursor_se)
@index -= 32#[@index - self.page_item_max, 0].max
self.top_row -= 8
#end
end
if $currentpage > $maxpage
$currentpage = 1
self.top_row = 0
@index -= $maxpage*32
end
if $currentpage < 1
$currentpage = $maxpage
self.top_row += ($maxpage - 1) * 8
@index += $maxpage*32
end
end
# Update help text (update_help is defined by the subclasses)
if self.active and @help_window != nil
update_help
end
# Update cursor rectangle
update_cursor_rect
end
end
#==============================================================================
# ** Window_Item
#------------------------------------------------------------------------------
# This window displays items in possession on the item and battle screens.
#==============================================================================
class Window_Item < Window_Selectable_Item
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(32 * 8 / 4, 64, 640 - 32 * 8 / 2, 32 * 8)#640, 416)
@column_max = 8
refresh
self.index = 0
self.windowskin = RPG::Cache.windowskin(CONFIG_ITEM::WINDOWSKIN)
self.back_opacity = CONFIG_ITEM::OPACITY
# If in battle, move window to center of screen
# and make it semi-transparent
if $game_temp.in_battle
self.y = 64
self.height = 256
self.back_opacity = 160
end
end
#--------------------------------------------------------------------------
# * Get Item
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
# Add item
for i in 1...$data_items.size
if $game_party.item_number(i) > 0
item = $data_items[i]
number = $game_party.item_number(item.id)
number.times do
# @item_max = @data.size
# if @item_max < 32
@data.push($data_items[i])
#end
end
end
end
# If item count is not 0, make a bit map and draw all items
@item_max = @data.size
$maxpage = (@item_max-1) / 32 + 1
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * (192 / 3))
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
number = $game_party.item_number(item.id)
x = 4 + index % 8 * 64
y = index / 8 * (192 / 3)
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), 255)
end
#--------------------------------------------------------------------------
# * Help Text Update
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
#==============================================================================
# ** Window_Target
#------------------------------------------------------------------------------
# This window selects a use target for the actor on item and skill screens.
#==============================================================================
class Window_Target_Item < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 336, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.z += 10
self.windowskin = RPG::Cache.windowskin(CONFIG_ITEM::WINDOWSKIN)
self.back_opacity = CONFIG_ITEM::OPACITY
@item_max = $game_party.actors.size
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...$game_party.actors.size
x = 4
y = i * 116
actor = $game_party.actors[i]
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 144, y)
draw_actor_level(actor, x + 8, y + 32)
draw_actor_state(actor, x + 8, y + 64)
draw_actor_hp(actor, x + 152, y + 32)
draw_actor_sp(actor, x + 152, y + 64)
end
end
#--------------------------------------------------------------------------
# * Cursor Rectangle Update
#--------------------------------------------------------------------------
def update_cursor_rect
# Cursor position -1 = all choices, -2 or lower = independent choice
# (meaning the user's own choice)
if @index <= -2
self.cursor_rect.set(0, (@index + 10) * 116, self.width - 32, 96)
elsif @index == -1
self.cursor_rect.set(0, 0, self.width - 32, @item_max * 116 - 20)
else
self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
end
end
end
#==============================================================================
# ** Window_Info
#------------------------------------------------------------------------------
# Zeigt einige infos an
#==============================================================================
class Window_Info < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.windowskin = RPG::Cache.windowskin("")
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
color = CONFIG_ITEM::INFO_COLOR
text1 = CONFIG_ITEM::ITEM_TEXT
text2 = CONFIG_ITEM::EQUIP_TEXT
if $currentpage == nil or $currentpage == 0
$currentpage = 1
end
if $maxpage == nil or $maxpage == 0
$maxpage = 1
end
text3 = $currentpage.to_s + " / " + $maxpage.to_s
self.contents.font.color.set(255, 255, 255)
self.contents.draw_text(448, 352 - 96 - 8, 100, 64, text3, 2)
self.contents.font.color.set(color[0], color[1], color[2])
self.contents.draw_text(32 * 8 / 4 - 16, 0, 200, 64, text1)
if CONFIG_ITEM::EQUIPMENT == true
self.contents.draw_text(488 - 16, 352 - 64, 200, 64, text2)
end
end
end
#==============================================================================
# ** Scene_Item
#------------------------------------------------------------------------------
# This class performs item screen processing.
#==============================================================================
class Scene_Item
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
$currentpage = 1
@spriteset = Spriteset_Map.new #<-------- Map wird als hintergrund angezeigt
# Make help window, item window
@help_window = Window_Help_Item.new
@item_window = Window_Item.new
if CONFIG_ITEM::EQUIPMENT == true
@actor = $game_party.actors[0]
@equip_window = Window_EquipRight_Item.new(@actor)#<-Equip window wird angezeigt
end
# Associate help window
@item_window.help_window = @help_window
# Make target window (set to invisible / inactive)
@target_window = Window_Target_Item.new
@info_window = Window_Info.new
@target_window.visible = false
@target_window.active = false
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@help_window.dispose
@item_window.dispose
@target_window.dispose
if CONFIG_ITEM::EQUIPMENT == true
@equip_window.dispose
end
@info_window.dispose
@spriteset.dispose #<------- Hintergrund wird gelöscht
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@help_window.update
@item_window.update
@target_window.update
if CONFIG_ITEM::EQUIPMENT == true
@equip_window
end
@info_window.update
# If item window is active: call update_item
if @item_window.active
update_item
return
end
# If target window is active: call update_target
if @target_window.active
update_target
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when item window is active)
#--------------------------------------------------------------------------
def update_item
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen oder zur map^^
if CONFIG_ITEM::MAP_TRANSFER == true
$scene = Scene_Map.new
else
$scene = Scene_Menu.new(0)
end
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Get currently selected data on the item window
@item = @item_window.item
# If not a use item
unless @item.is_a?(RPG::Item)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# If it can't be used
unless $game_party.item_can_use?(@item.id)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# If effect scope is an ally
if @item.scope >= 3
# Activate target window
@item_window.active = false
@target_window.x = (480 - 336+8)#(@item_window.index + 1) % 8 * 64# * 304
@target_window.visible = true
@target_window.active = true
# Set cursor position to effect scope (single / all)
if @item.scope == 4 || @item.scope == 6
@target_window.index = -1
else
@target_window.index = 0
end
# If effect scope is other than an ally
else
# If command event ID is valid
if @item.common_event_id > 0
# Command event call reservation
$game_temp.common_event_id = @item.common_event_id
# Play item use SE
$game_system.se_play(@item.menu_se)
# If consumable
if @item.consumable
# Decrease used items by 1
$game_party.lose_item(@item.id, 1)
# Draw item window item
#@item_window.draw_item(@item_window.index)
end
# Switch to map screen
$scene = Scene_Map.new
return
end
end
return
end
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@info_window.refresh
@item_window.refresh
end
#--------------------------------------------------------------------------
# * Frame Update (when target window is active)
#--------------------------------------------------------------------------
def update_target
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# If unable to use because items ran out
unless $game_party.item_can_use?(@item.id)
# Remake item window contents
@item_window.refresh
end
# Erase target window
@item_window.active = true
@target_window.visible = false
@target_window.active = false
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# If items are used up
if $game_party.item_number(@item.id) == 0
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# If target is all
if @target_window.index == -1
# Apply item effects to entire party
used = false
for i in $game_party.actors
used |= i.item_effect(@item)
end
end
# If single target
if @target_window.index >= 0
# Apply item use effects to target actor
target = $game_party.actors[@target_window.index]
used = target.item_effect(@item)
end
# If an item was used
if used
# Play item use SE
$game_system.se_play(@item.menu_se)
# If consumable
if @item.consumable
# Decrease used items by 1
$game_party.lose_item(@item.id, 1)
# Redraw item window item
# Erase target window
#@item_window.draw_item(@item_window.index)
end
# Remake target window contents
@target_window.refresh
# If all party members are dead
if $game_party.all_dead?
# Switch to game over screen
$scene = Scene_Gameover.new
return
end
# If common event ID is valid
if @item.common_event_id > 0
# Common event call reservation
$game_temp.common_event_id = @item.common_event_id
# Switch to map screen
$scene = Scene_Map.new
return
end
if @item.consumable
@item_window.active = true
@target_window.visible = false
@target_window.active = false
return
end
end
# If item wasn't used
unless used
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
end
return
end
end
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
end # Fertig :)
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Falls irgentwer bugs findet oder verbesserungsvorschläge hat sagt bescheid ;)
sehr geiles Menu:D:D:D
Creditseintrag
danke falls de noch irgentwas zu dem menü brauchst sach bescheid
achja, stimmt genau:
Willst du eine Gastrolle mit einen von dir gewählten Namen[mit kleinen Einschränkungen] in dem Spiel Warcraft II haben?
warum nich nenn mich einfach strich und wenn du mit charset machst nimm die Monster011 grafik (sofern das keine wichtige figur im game is^^)
Monstero11???...
Bin mal wiederein noob...
Strich, der eine Held der Menschen?^^ Klingt doch gut^^^^
Oh, eine Frage noch:
Du hast ein Bild hier reingepostet. Wie hast du das genau gemacht?
Und Deamonic ist der Böse, der die Welt in den Untergang treibt }:) ... hahaha
(*hust*,*hust*, an dem Lachen muss ich wohl noch arbeiten)
...............
irgendwie hast du dich verklickt, oder? ;)
Monstero11???...Bin mal wiederein noob...
Monster011 is ne rtp chrackter grafik.
Strich, der eine Held der Menschen?^^ Klingt doch gut^^^^
Wenn schon: strich, gott aller religionen, würde besser zu meinem projekt passen :D.
Du hast ein Bild hier reingepostet. Wie hast du das genau gemacht?
Unten bei zusätzliche einstellungen kann man anhänge verwalten, da lädste dann das bild hoch und schon is es da.
Und Deamonic ist der Böse, der die Welt in den Untergang treibt ... hahaha
Cool wenn ich der held wär würd ich dich ja dann töten^^.
Monster11?
Ist ja auch Warcraft II, gel?^^
Naja, dann halt Nebenrolle in meinen anderen Spiel^^
dann nimm dir halt irgendeine mir ziemlich egal
uff... Peinlich xD
Im einen Spiel, das Spiel, dass ich am Laptop mache, wenn ich unterwegs bin(und das bin ich viel xD) brauchte ich das nun. Aber wie stelle ich es so ein, das mehrere Items wieder *gluck* gestappelt werden:confused::eek::Dhttp://www.multimediaxis.de/images/smilies/old/sm_12.gif
Puuh da müsste man einiges wieder umkrempeln, da ich damals einfach alles was die items gestapelt angezeigt hat rausgenommen hatte.
Sollen nur bestimmte items gestapelt werden oder alle?
Ok war leichter als ich dachte, in den config zeilen unter "UPDATE" kann man nun einstellen welche items gestapelt/nebeneinander angezeigt werden sollen, sowie die farbe der zahlen, und ob items die nicht gestapelt werden auch mit nummern versehen sein sollen.
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# *Item-Menu
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# created by strich
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
module CONFIG_ITEM # Configurations
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#-> Durchsichtigkeit der Fenster
OPACITY = 160
#-> Das Windowskin für die Fenster
#-> Bitte ein neues Skin erstellen was die 4 Pfeile (die oben rechts in der mitte,
#-> einen nach oben, einen nach unten, einen nach rechts und einen nach links)
#-> nicht hat, weil diese sonst im menu erscheinen.
WINDOWSKIN = "menu"
#-> Beim Beenden des fensters kommt man auf die map/ins menü (true/false)
MAP_TRANSFER = true
#-> Beschreibungen der beiden Fenster und die schriftfarbe
ITEM_TEXT = "Items"
EQUIP_TEXT = "Equip"
INFO_COLOR = [255, 255, 255] #[RED, GREEN, BLUE]<- Farbmischung
#Hinweis: Die farbmischungen sind die gleichen wie bei dem Event-Befehl: Change Screen Color Tone
#-> Equipment fenster anzeigen/nicht anzeigen (true/false)
EQUIPMENT = true
#Hinweis: Es wird immer die Aurüstung von dem in der Party obersten angezeigt.
#--->UPDATE<---
###############
#-> Setze hinter die items die gestapelt werden sollen eine 1 und hinter die die
#-> nebeneinander gesetzt werden sollen ein "nil" (ohne "")
#-> !Nicht vergessen hinter jede zeile nen komma
ITEM_STAPEL = {
1=>1, # Item-ID=>nil/1
2=>nil,
3=>1,
#usw...
#du kannst die die nicht gestapelt werden sollen auch einfach garnicht eintragen
}
SHOW_NUMBERS = true #<- true: alle items die NICHT gestapelt werden sind mit
#<- 1 versehen, false: nur GESTAPELTE items über 1 haben zahlen
#-> Die farben der nummern
NUM_COLOR = [255, 255, 255] #[RED, GREEN, BLUE]<- Farbmischung
################################################################################
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
end # Configurations end
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Here we go!
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#==============================================================================
# ** Window_Help
#------------------------------------------------------------------------------
# This window shows skill and item explanations along with actor status.
#==============================================================================
class Window_Help_Item < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
if CONFIG_ITEM::EQUIPMENT == true
super(32 * 8 / 4, 480 - 64 - 64, 640 - 32 * 8 / 2 - 96, 64)
else
super(32 * 8 / 4, 480 - 64 - 64, 640 - 32 * 8 / 2, 64)
end
self.contents = Bitmap.new(width - 32, height - 32)
self.windowskin = RPG::Cache.windowskin(CONFIG_ITEM::WINDOWSKIN)
self.back_opacity = CONFIG_ITEM::OPACITY
end
#--------------------------------------------------------------------------
# * Set Text
# text : text string displayed in window
# align : alignment (0..flush left, 1..center, 2..flush right)
#--------------------------------------------------------------------------
def set_text(text, align = 0)
# If at least one part of text and alignment differ from last time
if text != @text or align != @align
# Redraw text
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, self.width - 40, 32, text, align)
@text = text
@align = align
@actor = nil
end
self.visible = true
end
#--------------------------------------------------------------------------
# * Set Actor
# actor : status displaying actor
#--------------------------------------------------------------------------
def set_actor(actor)
if actor != @actor
self.contents.clear
draw_actor_name(actor, 4, 0)
draw_actor_state(actor, 140, 0)
draw_actor_hp(actor, 284, 0)
draw_actor_sp(actor, 460, 0)
@actor = actor
@text = nil
self.visible = true
end
end
#--------------------------------------------------------------------------
# * Set Enemy
# enemy : name and status displaying enemy
#--------------------------------------------------------------------------
def set_enemy(enemy)
text = enemy.name
state_text = make_battler_state_text(enemy, 112, false)
if state_text != ""
text += " " + state_text
end
set_text(text, 1)
end
end
#==============================================================================
# ** Window_EquipRight
#------------------------------------------------------------------------------
# This window displays items the actor is currently equipped with on the
# equipment screen.
#==============================================================================
class Window_EquipRight_Item < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
# actor : actor
#--------------------------------------------------------------------------
def initialize(actor)
super(488, 352, 88, 120)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = CONFIG_ITEM::OPACITY
self.windowskin = RPG::Cache.windowskin(CONFIG_ITEM::WINDOWSKIN)
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@data = []
@data.push($data_weapons[@actor.weapon_id])
@data.push($data_armors[@actor.armor1_id])
@data.push($data_armors[@actor.armor2_id])
@data.push($data_armors[@actor.armor3_id])
@data.push($data_armors[@actor.armor4_id])
draw_equip(@data[0], 0 , 0 ) #<-- Weapon
draw_equip(@data[1], 32, 0 ) #<-- Shield
draw_equip(@data[2], 0 , 32) #<-- Helmet
draw_equip(@data[3], 32, 32) #<-- Armor
draw_equip(@data[4], 16, 64) #<-- Accesoir
end
def draw_equip(item, x, y)
if item == nil
return
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y, bitmap, Rect.new(0, 0, 24, 24))
end
end
#==============================================================================
# ** Window_Selectable
#------------------------------------------------------------------------------
# This window class contains cursor movement and scroll functions.
# Ich weis, verbraucht viel platz aber muss leider sein.
#==============================================================================
class Window_Selectable_Item < Window_Base
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :index # cursor position
attr_reader :help_window # help window
#--------------------------------------------------------------------------
# * Object Initialization
# x : window x-coordinate
# y : window y-coordinate
# width : window width
# height : window height
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super(x, y, width, height)
@item_max = 1
@column_max = 1
@index = -1
end
#--------------------------------------------------------------------------
# * Set Cursor Position
# index : new cursor position
#--------------------------------------------------------------------------
def index=(index)
@index = index
# Update Help Text (update_help is defined by the subclasses)
if self.active and @help_window != nil
update_help
end
# Update cursor rectangle
update_cursor_rect
end
#--------------------------------------------------------------------------
# * Get Row Count
#--------------------------------------------------------------------------
def row_max
# Compute rows from number of items and columns
return (@item_max * 2 + @column_max - 1) / @column_max
end
#--------------------------------------------------------------------------
# * Get Top Row
#--------------------------------------------------------------------------
def top_row
# Divide y-coordinate of window contents transfer origin by 1 row
# height of 32
return self.oy / 32
end
#--------------------------------------------------------------------------
# * Set Top Row
# row : row shown on top
#--------------------------------------------------------------------------
def top_row=(row)
# If row is less than 0, change it to 0
if row < 0
row = 0
end
# If row exceeds row_max - 1, change it to row_max - 1
if row > row_max - 1
row = row_max - 1
end
# Multiply 1 row height by 32 for y-coordinate of window contents
# transfer origin
self.oy = row * 32
end
#--------------------------------------------------------------------------
# * Get Number of Rows Displayable on 1 Page
#--------------------------------------------------------------------------
def page_row_max
# Subtract a frame height of 32 from the window height, and divide it by
# 1 row height of 32
return (self.height - 32) / 32
end
#--------------------------------------------------------------------------
# * Get Number of Items Displayable on 1 Page
#--------------------------------------------------------------------------
def page_item_max
# Multiply row count (page_row_max) times column count (@column_max)
return page_row_max * @column_max
end
#--------------------------------------------------------------------------
# * Set Help Window
# help_window : new help window
#--------------------------------------------------------------------------
def help_window=(help_window)
@help_window = help_window
# Update help text (update_help is defined by the subclasses)
if self.active and @help_window != nil
update_help
end
end
#--------------------------------------------------------------------------
# * Update Cursor Rectangle
#--------------------------------------------------------------------------
def update_cursor_rect
# If cursor position is less than 0
if @index < 0
self.cursor_rect.empty
return
end
# Get current row
row = @index / @column_max
# If current row is before top row
if row < self.top_row
# Scroll so that current row becomes top row
#self.top_row = row
end
# If current row is more to back than back row
if row > self.top_row + (self.page_row_max - 1)
# Scroll so that current row becomes back row
#self.top_row = row - (self.page_row_max - 1)
end
# Calculate cursor width
cursor_width = self.width / @column_max - 32
# Calculate cursor coordinates
x = @index % @column_max * (cursor_width + 32)
y = @index / @column_max * (192/3) - self.oy
# Update cursor rectangle
self.cursor_rect.set(x, y, cursor_width, 32)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
# If cursor is movable
if self.active and @item_max > 0 and @index >= 0
# If pressing down on the directional buttons
if Input.repeat?(Input::DOWN)
# If column count is 1 and directional button was pressed down with no
# repeat, or if cursor position is more to the front than
# (item count - column count)
if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
@index <= ($currentpage * 32 - @column_max) - 1
# Move cursor down
$game_system.se_play($data_system.cursor_se)
@index = (@index + @column_max)# % @item_max
end
end
# If the up directional button was pressed
if Input.repeat?(Input::UP)
# If column count is 1 and directional button was pressed up with no
# repeat, or if cursor position is more to the back than column count
if (@column_max == 1 and Input.trigger?(Input::UP)) or
@index >= ($currentpage * 32 + @column_max) -32#@column_max
# Move cursor up
$game_system.se_play($data_system.cursor_se)
@index = (@index - @column_max)
end
end
# If the right directional button was pressed
if Input.repeat?(Input::RIGHT)
# If column count is 2 or more, and cursor position is closer to front
# than (item count -1)
if @column_max >= 2 and @index <= ($currentpage * 32)-2
# Move cursor right
$game_system.se_play($data_system.cursor_se)
@index += 1
end
end
# If the left directional button was pressed
if Input.repeat?(Input::LEFT)
# If column count is 2 or more, and cursor position is more back than 0
if @column_max >= 2 and @index >= ($currentpage * 32) - 32 + 1
# Move cursor left
$game_system.se_play($data_system.cursor_se)
@index -= 1
end
end
# If R button was pressed
if Input.repeat?(Input::R)
# If bottom row being displayed is more to front than bottom data row
#if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
# Move cursor 1 page back#
$currentpage += 1
$game_system.se_play($data_system.cursor_se)
@index += 32#[@index + self.page_item_max, @item_max - 1].min
self.top_row += 8
#end
end
# If L button was pressed
if Input.repeat?(Input::L)
# If top row being displayed is more to back than 0
#if self.top_row > 0
# Move cursor 1 page forward
$currentpage -= 1
$game_system.se_play($data_system.cursor_se)
@index -= 32#[@index - self.page_item_max, 0].max
self.top_row -= 8
#end
end
if $currentpage > $maxpage
$currentpage = 1
self.top_row = 0
@index -= $maxpage*32
end
if $currentpage < 1
$currentpage = $maxpage
self.top_row += ($maxpage - 1) * 8
@index += $maxpage*32
end
end
# Update help text (update_help is defined by the subclasses)
if self.active and @help_window != nil
update_help
end
# Update cursor rectangle
update_cursor_rect
end
end
#==============================================================================
# ** Window_Item
#------------------------------------------------------------------------------
# This window displays items in possession on the item and battle screens.
#==============================================================================
class Window_Item < Window_Selectable_Item
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(32 * 8 / 4, 64, 640 - 32 * 8 / 2, 32 * 8)#640, 416)
@column_max = 8
refresh
self.index = 0
self.windowskin = RPG::Cache.windowskin(CONFIG_ITEM::WINDOWSKIN)
self.back_opacity = CONFIG_ITEM::OPACITY
# If in battle, move window to center of screen
# and make it semi-transparent
if $game_temp.in_battle
self.y = 64
self.height = 256
self.back_opacity = 160
end
end
#--------------------------------------------------------------------------
# * Get Item
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
# Add item
for i in 1...$data_items.size
if $game_party.item_number(i) > 0
item = $data_items[i]
#--->UPDATE
abc = CONFIG_ITEM::ITEM_STAPEL[item.id]
if abc == nil
number = $game_party.item_number(item.id)
else
number = 1
end
#########################
number.times do
@data.push($data_items[i])
end
end
end
# If item count is not 0, make a bit map and draw all items
@item_max = @data.size
$maxpage = (@item_max-1) / 32 + 1
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * (192 / 3))
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
number = $game_party.item_number(item.id)
x = 4 + index % 8 * 64
y = index / 8 * (192 / 3)
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), 255)
#--->UPDATE
abc = CONFIG_ITEM::ITEM_STAPEL[item.id]
cba = CONFIG_ITEM::NUM_COLOR
self.contents.font.color.set(cba[0], cba[1], cba[2])
if abc != nil
if CONFIG_ITEM::SHOW_NUMBERS == false and number > 1
self.contents.draw_text(x, y, 24, 32, number.to_s, 2)
elsif CONFIG_ITEM::SHOW_NUMBERS == true
self.contents.draw_text(x, y, 24, 32, number.to_s, 2)
end
elsif CONFIG_ITEM::SHOW_NUMBERS == true
self.contents.draw_text(x, y, 24, 32, 1.to_s, 2)
end
#########################
end
#--------------------------------------------------------------------------
# * Help Text Update
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
#==============================================================================
# ** Window_Target
#------------------------------------------------------------------------------
# This window selects a use target for the actor on item and skill screens.
#==============================================================================
class Window_Target_Item < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 336, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.z += 10
self.windowskin = RPG::Cache.windowskin(CONFIG_ITEM::WINDOWSKIN)
self.back_opacity = CONFIG_ITEM::OPACITY
@item_max = $game_party.actors.size
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...$game_party.actors.size
x = 4
y = i * 116
actor = $game_party.actors[i]
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 144, y)
draw_actor_level(actor, x + 8, y + 32)
draw_actor_state(actor, x + 8, y + 64)
draw_actor_hp(actor, x + 152, y + 32)
draw_actor_sp(actor, x + 152, y + 64)
end
end
#--------------------------------------------------------------------------
# * Cursor Rectangle Update
#--------------------------------------------------------------------------
def update_cursor_rect
# Cursor position -1 = all choices, -2 or lower = independent choice
# (meaning the user's own choice)
if @index <= -2
self.cursor_rect.set(0, (@index + 10) * 116, self.width - 32, 96)
elsif @index == -1
self.cursor_rect.set(0, 0, self.width - 32, @item_max * 116 - 20)
else
self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
end
end
end
#==============================================================================
# ** Window_Info
#------------------------------------------------------------------------------
# Zeigt einige infos an
#==============================================================================
class Window_Info < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.windowskin = RPG::Cache.windowskin("")
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
color = CONFIG_ITEM::INFO_COLOR
text1 = CONFIG_ITEM::ITEM_TEXT
text2 = CONFIG_ITEM::EQUIP_TEXT
if $currentpage == nil or $currentpage == 0
$currentpage = 1
end
if $maxpage == nil or $maxpage == 0
$maxpage = 1
end
text3 = $currentpage.to_s + " / " + $maxpage.to_s
self.contents.font.color.set(255, 255, 255)
self.contents.draw_text(448, 352 - 96 + 4, 100, 64, text3, 2)
self.contents.font.color.set(color[0], color[1], color[2])
self.contents.draw_text(32 * 8 / 4 - 16, 0, 200, 64, text1)
if CONFIG_ITEM::EQUIPMENT == true
self.contents.draw_text(488 - 16, 352 - 64, 200, 64, text2)
end
end
end
#==============================================================================
# ** Scene_Item
#------------------------------------------------------------------------------
# This class performs item screen processing.
#==============================================================================
class Scene_Item
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
$currentpage = 1
@spriteset = Spriteset_Map.new #<-------- Map wird als hintergrund angezeigt
# Make help window, item window
@help_window = Window_Help_Item.new
@item_window = Window_Item.new
if CONFIG_ITEM::EQUIPMENT == true
@actor = $game_party.actors[0]
@equip_window = Window_EquipRight_Item.new(@actor)#<-Equip window wird angezeigt
end
# Associate help window
@item_window.help_window = @help_window
# Make target window (set to invisible / inactive)
@target_window = Window_Target_Item.new
@info_window = Window_Info.new
@target_window.visible = false
@target_window.active = false
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@help_window.dispose
@item_window.dispose
@target_window.dispose
if CONFIG_ITEM::EQUIPMENT == true
@equip_window.dispose
end
@info_window.dispose
@spriteset.dispose #<------- Hintergrund wird gelöscht
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@help_window.update
@item_window.update
@target_window.update
if CONFIG_ITEM::EQUIPMENT == true
@equip_window
end
@info_window.update
# If item window is active: call update_item
if @item_window.active
update_item
return
end
# If target window is active: call update_target
if @target_window.active
update_target
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when item window is active)
#--------------------------------------------------------------------------
def update_item
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen oder zur map^^
if CONFIG_ITEM::MAP_TRANSFER == true
$scene = Scene_Map.new
else
$scene = Scene_Menu.new(0)
end
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Get currently selected data on the item window
@item = @item_window.item
# If not a use item
unless @item.is_a?(RPG::Item)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# If it can't be used
unless $game_party.item_can_use?(@item.id)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# If effect scope is an ally
if @item.scope >= 3
# Activate target window
@item_window.active = false
@target_window.x = (480 - 336+8)#(@item_window.index + 1) % 8 * 64# * 304
@target_window.visible = true
@target_window.active = true
# Set cursor position to effect scope (single / all)
if @item.scope == 4 || @item.scope == 6
@target_window.index = -1
else
@target_window.index = 0
end
# If effect scope is other than an ally
else
# If command event ID is valid
if @item.common_event_id > 0
# Command event call reservation
$game_temp.common_event_id = @item.common_event_id
# Play item use SE
$game_system.se_play(@item.menu_se)
# If consumable
if @item.consumable
# Decrease used items by 1
$game_party.lose_item(@item.id, 1)
# Draw item window item
#@item_window.draw_item(@item_window.index)
end
# Switch to map screen
$scene = Scene_Map.new
return
end
end
return
end
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@info_window.refresh
@item_window.refresh
end
#--------------------------------------------------------------------------
# * Frame Update (when target window is active)
#--------------------------------------------------------------------------
def update_target
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# If unable to use because items ran out
unless $game_party.item_can_use?(@item.id)
# Remake item window contents
@item_window.refresh
end
# Erase target window
@item_window.active = true
@target_window.visible = false
@target_window.active = false
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# If items are used up
if $game_party.item_number(@item.id) == 0
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# If target is all
if @target_window.index == -1
# Apply item effects to entire party
used = false
for i in $game_party.actors
used |= i.item_effect(@item)
end
end
# If single target
if @target_window.index >= 0
# Apply item use effects to target actor
target = $game_party.actors[@target_window.index]
used = target.item_effect(@item)
end
# If an item was used
if used
# Play item use SE
$game_system.se_play(@item.menu_se)
# If consumable
if @item.consumable
# Decrease used items by 1
$game_party.lose_item(@item.id, 1)
# Redraw item window item
# Erase target window
#@item_window.draw_item(@item_window.index)
end
# Remake target window contents
@target_window.refresh
# If all party members are dead
if $game_party.all_dead?
# Switch to game over screen
$scene = Scene_Gameover.new
return
end
# If common event ID is valid
if @item.common_event_id > 0
# Common event call reservation
$game_temp.common_event_id = @item.common_event_id
# Switch to map screen
$scene = Scene_Map.new
return
end
if @item.consumable
@item_window.active = true
@target_window.visible = false
@target_window.active = false
return
end
end
# If item wasn't used
unless used
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
end
return
end
end
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
end # Fertig :)
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Falls nen bug auftauchen sollte her damit :D
Edit: Ohh sry für doppelpost >.<
Okaj, dafür bekommst du in mein Spiel, welches hier bald als Demo auftauchen wird(viele kennen ja vielleicht noch "Der Diamant") eine Gastrolle im XP-RTP Spiel. Also Monster011 hast du gesagt xD
Jeah, es funzt xD Und die Veränderungen sind so leicht einzustellen, dass sogar ich sie verstanden habe xD
Na dann: Ich werde die Gastrolle mal Platzieren.
Gut :).
Bin mal gespannt was das fürn game wird, un voll allem welche rolle ich spiele :D
Zu Monster11 ich hab auch noch nicht rtp chars die du nehmen kannst :rolleyes:
zu spät xD Und wenn es ok ist, bist du ein einfacher NPC xDDDD
Ja is ok, aber lass mich bitte nich nur so nen standard satz wie "Heute is das Wetter aber schön" sagen, wie wärs denn zum beispiel passend zum itemmenu mit:
Ich weis welche Gegenstände du gerade in deinem Inventar trägst.
Ich kann Gegenstände daraus zerstören oder dir neue hineinlegen.
Ich beweise es dir...
Daraufhin ein Hinweis wie:
Du bemerktst das sich in deinem Inventar ein neuer Heiltrank befindet, dabei bist du dir sicher, es nichtmal geöffnet zu haben.
Dann schaltet sich nen switch on damit man sich nicht 100 Heiltränke hohlen kann, und wenn man mich dann das nächste mal anspricht:
Schon bald werden alle Inventare durch mich gesteuert sein, und niemand kann mich aufhalten *böse lach*!
na dann ist ja meine bisherige Ausgabe ja nicht dein Gescmach:
\name[Strich]\p[19]Hallo. Ich bin Strich. Ein ganz
normaler Mensch.
Anmerkung vom Macher des Spiels: Nein, das bist
du nicht... Erzähl uns doch mal deine Geschichte,
wie du hier her kamst.
\name[Strich]\p[19]Okaj, ich bin eine Gastrolle.
Von mir stand dieses Wunderbare Item-Menu.
*Notiz an mich: Nicht mehr so viel angeben*
Play SE: ´060-Cheer01´ 100, 100
Anmerkung vom Macher des Spiels:
Richtig!!!
Ich kann es noch variieren...
Oder deins nehmen...
Überrasch mich^^
So jetzt is aber auch mal schluss mit dem ganzen gespamme hier, das Menü geht ja schließlich :D
ufffff... Entweder bin ich zu blöd, stell was falsch ein oder dein Script ist geht nicht. Hier ist es mal:
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# *Item-Menu
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# created by strich
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
module CONFIG_ITEM # Configurations
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#-> Durchsichtigkeit der Fenster
OPACITY = 160
#-> Das Windowskin für die Fenster
#-> Bitte ein neues Skin erstellen was die 4 Pfeile (die oben rechts in der mitte,
#-> einen nach oben, einen nach unten, einen nach rechts und einen nach links)
#-> nicht hat, weil diese sonst im menu erscheinen.
WINDOWSKIN = "Menu"
#-> Beim Beenden des fensters kommt man auf die map/ins menü (true/false)
MAP_TRANSFER = true
#-> Beschreibungen der beiden Fenster und die schriftfarbe
ITEM_TEXT = "Items"
EQUIP_TEXT = "Ausrüstung"
INFO_COLOR = [255, 255, 255] #[RED, GREEN, BLUE]<- Farbmischung
#Hinweis: Die farbmischungen sind die gleichen wie bei dem Event-Befehl: Change Screen Color Tone
#-> Equipment fenster anzeigen/nicht anzeigen (true/false)
EQUIPMENT = true
#Hinweis: Es wird immer die Aurüstung von dem in der Party obersten angezeigt.
#--->UPDATE<---
###############
#-> Setze hinter die items die gestapelt werden sollen eine 1 und hinter die die
#-> nebeneinander gesetzt werden sollen ein "nil" (ohne "")
#-> !Nicht vergessen hinter jede zeile nen komma
ITEM_STAPEL = {
1=>1, # Item-ID=>nil/1
2=>1,
3=>1,
#usw...
#du kannst die die nicht gestapelt werden sollen auch einfach garnicht eintragen
}
SHOW_NUMBERS = false #<- true: alle items die NICHT gestapelt werden sind mit
#<- 1 versehen, false: nur GESTAPELTE items über 1 haben zahlen
#-> Die farben der nummern
NUM_COLOR = [255, 255, 255] #[RED, GREEN, BLUE]<- Farbmischung
################################################################################
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
end # Configurations end
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
# Here we go!
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
#==============================================================================
# ** Window_Help
#------------------------------------------------------------------------------
# This window shows skill and item explanations along with actor status.
#==============================================================================
class Window_Help_Item < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
if CONFIG_ITEM::EQUIPMENT == true
super(32 * 8 / 4, 480 - 64 - 64, 640 - 32 * 8 / 2 - 96, 64)
else
super(32 * 8 / 4, 480 - 64 - 64, 640 - 32 * 8 / 2, 64)
end
self.contents = Bitmap.new(width - 32, height - 32)
self.windowskin = RPG::Cache.windowskin(CONFIG_ITEM::WINDOWSKIN)
self.back_opacity = CONFIG_ITEM::OPACITY
end
#--------------------------------------------------------------------------
# * Set Text
# text : text string displayed in window
# align : alignment (0..flush left, 1..center, 2..flush right)
#--------------------------------------------------------------------------
def set_text(text, align = 0)
# If at least one part of text and alignment differ from last time
if text != @text or align != @align
# Redraw text
self.contents.clear
self.contents.font.color = normal_color
self.contents.draw_text(4, 0, self.width - 40, 32, text, align)
@text = text
@align = align
@actor = nil
end
self.visible = true
end
#--------------------------------------------------------------------------
# * Set Actor
# actor : status displaying actor
#--------------------------------------------------------------------------
def set_actor(actor)
if actor != @actor
self.contents.clear
draw_actor_name(actor, 4, 0)
draw_actor_state(actor, 140, 0)
draw_actor_hp(actor, 284, 0)
draw_actor_sp(actor, 460, 0)
@actor = actor
@text = nil
self.visible = true
end
end
#--------------------------------------------------------------------------
# * Set Enemy
# enemy : name and status displaying enemy
#--------------------------------------------------------------------------
def set_enemy(enemy)
text = enemy.name
state_text = make_battler_state_text(enemy, 112, false)
if state_text != ""
text += " " + state_text
end
set_text(text, 1)
end
end
#==============================================================================
# ** Window_EquipRight
#------------------------------------------------------------------------------
# This window displays items the actor is currently equipped with on the
# equipment screen.
#==============================================================================
class Window_EquipRight_Item < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
# actor : actor
#--------------------------------------------------------------------------
def initialize(actor)
super(488, 352, 88, 120)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = CONFIG_ITEM::OPACITY
self.windowskin = RPG::Cache.windowskin(CONFIG_ITEM::WINDOWSKIN)
@actor = actor
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
@data = []
@data.push($data_weapons[@actor.weapon_id])
@data.push($data_armors[@actor.armor1_id])
@data.push($data_armors[@actor.armor2_id])
@data.push($data_armors[@actor.armor3_id])
@data.push($data_armors[@actor.armor4_id])
draw_equip(@data[0], 0 , 0 ) #<-- Weapon
draw_equip(@data[1], 32, 0 ) #<-- Shield
draw_equip(@data[2], 0 , 32) #<-- Helmet
draw_equip(@data[3], 32, 32) #<-- Armor
draw_equip(@data[4], 16, 64) #<-- Accesoir
end
def draw_equip(item, x, y)
if item == nil
return
end
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y, bitmap, Rect.new(0, 0, 24, 24))
end
end
#==============================================================================
# ** Window_Selectable
#------------------------------------------------------------------------------
# This window class contains cursor movement and scroll functions.
# Ich weis, verbraucht viel platz aber muss leider sein.
#==============================================================================
class Window_Selectable_Item < Window_Base
#--------------------------------------------------------------------------
# * Public Instance Variables
#--------------------------------------------------------------------------
attr_reader :index # cursor position
attr_reader :help_window # help window
#--------------------------------------------------------------------------
# * Object Initialization
# x : window x-coordinate
# y : window y-coordinate
# width : window width
# height : window height
#--------------------------------------------------------------------------
def initialize(x, y, width, height)
super(x, y, width, height)
@item_max = 1
@column_max = 1
@index = -1
end
#--------------------------------------------------------------------------
# * Set Cursor Position
# index : new cursor position
#--------------------------------------------------------------------------
def index=(index)
@index = index
# Update Help Text (update_help is defined by the subclasses)
if self.active and @help_window != nil
update_help
end
# Update cursor rectangle
update_cursor_rect
end
#--------------------------------------------------------------------------
# * Get Row Count
#--------------------------------------------------------------------------
def row_max
# Compute rows from number of items and columns
return (@item_max * 2 + @column_max - 1) / @column_max
end
#--------------------------------------------------------------------------
# * Get Top Row
#--------------------------------------------------------------------------
def top_row
# Divide y-coordinate of window contents transfer origin by 1 row
# height of 32
return self.oy / 32
end
#--------------------------------------------------------------------------
# * Set Top Row
# row : row shown on top
#--------------------------------------------------------------------------
def top_row=(row)
# If row is less than 0, change it to 0
if row < 0
row = 0
end
# If row exceeds row_max - 1, change it to row_max - 1
if row > row_max - 1
row = row_max - 1
end
# Multiply 1 row height by 32 for y-coordinate of window contents
# transfer origin
self.oy = row * 32
end
#--------------------------------------------------------------------------
# * Get Number of Rows Displayable on 1 Page
#--------------------------------------------------------------------------
def page_row_max
# Subtract a frame height of 32 from the window height, and divide it by
# 1 row height of 32
return (self.height - 32) / 32
end
#--------------------------------------------------------------------------
# * Get Number of Items Displayable on 1 Page
#--------------------------------------------------------------------------
def page_item_max
# Multiply row count (page_row_max) times column count (@column_max)
return page_row_max * @column_max
end
#--------------------------------------------------------------------------
# * Set Help Window
# help_window : new help window
#--------------------------------------------------------------------------
def help_window=(help_window)
@help_window = help_window
# Update help text (update_help is defined by the subclasses)
if self.active and @help_window != nil
update_help
end
end
#--------------------------------------------------------------------------
# * Update Cursor Rectangle
#--------------------------------------------------------------------------
def update_cursor_rect
# If cursor position is less than 0
if @index < 0
self.cursor_rect.empty
return
end
# Get current row
row = @index / @column_max
# If current row is before top row
if row < self.top_row
# Scroll so that current row becomes top row
#self.top_row = row
end
# If current row is more to back than back row
if row > self.top_row + (self.page_row_max - 1)
# Scroll so that current row becomes back row
#self.top_row = row - (self.page_row_max - 1)
end
# Calculate cursor width
cursor_width = self.width / @column_max - 32
# Calculate cursor coordinates
x = @index % @column_max * (cursor_width + 32)
y = @index / @column_max * (192/3) - self.oy
# Update cursor rectangle
self.cursor_rect.set(x, y, cursor_width, 32)
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
super
# If cursor is movable
if self.active and @item_max > 0 and @index >= 0
# If pressing down on the directional buttons
if Input.repeat?(Input::DOWN)
# If column count is 1 and directional button was pressed down with no
# repeat, or if cursor position is more to the front than
# (item count - column count)
if (@column_max == 1 and Input.trigger?(Input::DOWN)) or
@index <= ($currentpage * 32 - @column_max) - 1
# Move cursor down
$game_system.se_play($data_system.cursor_se)
@index = (@index + @column_max)# % @item_max
end
end
# If the up directional button was pressed
if Input.repeat?(Input::UP)
# If column count is 1 and directional button was pressed up with no
# repeat, or if cursor position is more to the back than column count
if (@column_max == 1 and Input.trigger?(Input::UP)) or
@index >= ($currentpage * 32 + @column_max) -32#@column_max
# Move cursor up
$game_system.se_play($data_system.cursor_se)
@index = (@index - @column_max)
end
end
# If the right directional button was pressed
if Input.repeat?(Input::RIGHT)
# If column count is 2 or more, and cursor position is closer to front
# than (item count -1)
if @column_max >= 2 and @index <= ($currentpage * 32)-2
# Move cursor right
$game_system.se_play($data_system.cursor_se)
@index += 1
end
end
# If the left directional button was pressed
if Input.repeat?(Input::LEFT)
# If column count is 2 or more, and cursor position is more back than 0
if @column_max >= 2 and @index >= ($currentpage * 32) - 32 + 1
# Move cursor left
$game_system.se_play($data_system.cursor_se)
@index -= 1
end
end
# If R button was pressed
if Input.repeat?(Input::R)
# If bottom row being displayed is more to front than bottom data row
#if self.top_row + (self.page_row_max - 1) < (self.row_max - 1)
# Move cursor 1 page back#
$currentpage += 1
$game_system.se_play($data_system.cursor_se)
@index += 32#[@index + self.page_item_max, @item_max - 1].min
self.top_row += 8
#end
end
# If L button was pressed
if Input.repeat?(Input::L)
# If top row being displayed is more to back than 0
#if self.top_row > 0
# Move cursor 1 page forward
$currentpage -= 1
$game_system.se_play($data_system.cursor_se)
@index -= 32#[@index - self.page_item_max, 0].max
self.top_row -= 8
#end
end
if $currentpage > $maxpage
$currentpage = 1
self.top_row = 0
@index -= $maxpage*32
end
if $currentpage < 1
$currentpage = $maxpage
self.top_row += ($maxpage - 1) * 8
@index += $maxpage*32
end
end
# Update help text (update_help is defined by the subclasses)
if self.active and @help_window != nil
update_help
end
# Update cursor rectangle
update_cursor_rect
end
end
#==============================================================================
# ** Window_Item
#------------------------------------------------------------------------------
# This window displays items in possession on the item and battle screens.
#==============================================================================
class Window_Item < Window_Selectable_Item
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(32 * 8 / 4, 64, 640 - 32 * 8 / 2, 32 * 8)#640, 416)
@column_max = 8
refresh
self.index = 0
self.windowskin = RPG::Cache.windowskin(CONFIG_ITEM::WINDOWSKIN)
self.back_opacity = CONFIG_ITEM::OPACITY
# If in battle, move window to center of screen
# and make it semi-transparent
if $game_temp.in_battle
self.y = 64
self.height = 256
self.back_opacity = 160
end
end
#--------------------------------------------------------------------------
# * Get Item
#--------------------------------------------------------------------------
def item
return @data[self.index]
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
if self.contents != nil
self.contents.dispose
self.contents = nil
end
@data = []
# Add item
for i in 1...$data_items.size
if $game_party.item_number(i) > 0
item = $data_items[i]
#--->UPDATE
abc = CONFIG_ITEM::ITEM_STAPEL[item.id]
if abc == nil
number = $game_party.item_number(item.id)
else
number = 1
end
#########################
number.times do
@data.push($data_items[i])
end
end
end
# If item count is not 0, make a bit map and draw all items
@item_max = @data.size
$maxpage = (@item_max-1) / 32 + 1
if @item_max > 0
self.contents = Bitmap.new(width - 32, row_max * (192 / 3))
for i in 0...@item_max
draw_item(i)
end
end
end
#--------------------------------------------------------------------------
# * Draw Item
# index : item number
#--------------------------------------------------------------------------
def draw_item(index)
item = @data[index]
number = $game_party.item_number(item.id)
x = 4 + index % 8 * 64
y = index / 8 * (192 / 3)
rect = Rect.new(x, y, self.width / @column_max - 32, 32)
self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))
bitmap = RPG::Cache.icon(item.icon_name)
self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), 255)
#--->UPDATE
abc = CONFIG_ITEM::ITEM_STAPEL[item.id]
cba = CONFIG_ITEM::NUM_COLOR
self.contents.font.color.set(cba[0], cba[1], cba[2])
if abc != nil
if CONFIG_ITEM::SHOW_NUMBERS == false and number > 1
self.contents.draw_text(x, y, 24, 32, number.to_s, 2)
elsif CONFIG_ITEM::SHOW_NUMBERS == true
self.contents.draw_text(x, y, 24, 32, number.to_s, 2)
end
elsif CONFIG_ITEM::SHOW_NUMBERS == true
self.contents.draw_text(x, y, 24, 32, 1.to_s, 2)
end
#########################
end
#--------------------------------------------------------------------------
# * Help Text Update
#--------------------------------------------------------------------------
def update_help
@help_window.set_text(self.item == nil ? "" : self.item.description)
end
end
#==============================================================================
# ** Window_Target
#------------------------------------------------------------------------------
# This window selects a use target for the actor on item and skill screens.
#==============================================================================
class Window_Target_Item < Window_Selectable
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 336, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.z += 10
self.windowskin = RPG::Cache.windowskin(CONFIG_ITEM::WINDOWSKIN)
self.back_opacity = CONFIG_ITEM::OPACITY
@item_max = $game_party.actors.size
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
for i in 0...$game_party.actors.size
x = 4
y = i * 116
actor = $game_party.actors[i]
draw_actor_name(actor, x, y)
draw_actor_class(actor, x + 144, y)
draw_actor_level(actor, x + 8, y + 32)
draw_actor_state(actor, x + 8, y + 64)
draw_actor_hp(actor, x + 152, y + 32)
draw_actor_sp(actor, x + 152, y + 64)
end
end
#--------------------------------------------------------------------------
# * Cursor Rectangle Update
#--------------------------------------------------------------------------
def update_cursor_rect
# Cursor position -1 = all choices, -2 or lower = independent choice
# (meaning the user's own choice)
if @index <= -2
self.cursor_rect.set(0, (@index + 10) * 116, self.width - 32, 96)
elsif @index == -1
self.cursor_rect.set(0, 0, self.width - 32, @item_max * 116 - 20)
else
self.cursor_rect.set(0, @index * 116, self.width - 32, 96)
end
end
end
#==============================================================================
# ** Window_Info
#------------------------------------------------------------------------------
# Zeigt einige infos an
#==============================================================================
class Window_Info < Window_Base
#--------------------------------------------------------------------------
# * Object Initialization
#--------------------------------------------------------------------------
def initialize
super(0, 0, 640, 480)
self.contents = Bitmap.new(width - 32, height - 32)
self.windowskin = RPG::Cache.windowskin("")
refresh
end
#--------------------------------------------------------------------------
# * Refresh
#--------------------------------------------------------------------------
def refresh
self.contents.clear
color = CONFIG_ITEM::INFO_COLOR
text1 = CONFIG_ITEM::ITEM_TEXT
text2 = CONFIG_ITEM::EQUIP_TEXT
if $currentpage == nil or $currentpage == 0
$currentpage = 1
end
if $maxpage == nil or $maxpage == 0
$maxpage = 1
end
text3 = $currentpage.to_s + " / " + $maxpage.to_s
self.contents.font.color.set(255, 255, 255)
self.contents.draw_text(448, 352 - 96 + 4, 100, 64, text3, 2)
self.contents.font.color.set(color[0], color[1], color[2])
self.contents.draw_text(32 * 8 / 4 - 16, 0, 200, 64, text1)
if CONFIG_ITEM::EQUIPMENT == true
self.contents.draw_text(488 - 16, 352 - 64, 200, 64, text2)
end
end
end
#==============================================================================
# ** Scene_Item
#------------------------------------------------------------------------------
# This class performs item screen processing.
#==============================================================================
class Scene_Item
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
$currentpage = 1
@spriteset = Spriteset_Map.new #<-------- Map wird als hintergrund angezeigt
# Make help window, item window
@help_window = Window_Help_Item.new
@item_window = Window_Item.new
if CONFIG_ITEM::EQUIPMENT == true
@actor = $game_party.actors[0]
@equip_window = Window_EquipRight_Item.new(@actor)#<-Equip window wird angezeigt
end
# Associate help window
@item_window.help_window = @help_window
# Make target window (set to invisible / inactive)
@target_window = Window_Target_Item.new
@info_window = Window_Info.new
@target_window.visible = false
@target_window.active = false
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if $scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@help_window.dispose
@item_window.dispose
@target_window.dispose
if CONFIG_ITEM::EQUIPMENT == true
@equip_window.dispose
end
@info_window.dispose
@spriteset.dispose #<------- Hintergrund wird gelöscht
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@help_window.update
@item_window.update
@target_window.update
if CONFIG_ITEM::EQUIPMENT == true
@equip_window
end
@info_window.update
# If item window is active: call update_item
if @item_window.active
update_item
return
end
# If target window is active: call update_target
if @target_window.active
update_target
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when item window is active)
#--------------------------------------------------------------------------
def update_item
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# Switch to menu screen oder zur map^^
if CONFIG_ITEM::MAP_TRANSFER == true
$scene = Scene_Map.new
else
$scene = Scene_Menu.new(0)
end
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Get currently selected data on the item window
@item = @item_window.item
# If not a use item
unless @item.is_a?(RPG::Item)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# If it can't be used
unless $game_party.item_can_use?(@item.id)
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# Play decision SE
$game_system.se_play($data_system.decision_se)
# If effect scope is an ally
if @item.scope >= 3
# Activate target window
@item_window.active = false
@target_window.x = (480 - 336+8)#(@item_window.index + 1) % 8 * 64# * 304
@target_window.visible = true
@target_window.active = true
# Set cursor position to effect scope (single / all)
if @item.scope == 4 || @item.scope == 6
@target_window.index = -1
else
@target_window.index = 0
end
# If effect scope is other than an ally
else
# If command event ID is valid
if @item.common_event_id > 0
# Command event call reservation
$game_temp.common_event_id = @item.common_event_id
# Play item use SE
$game_system.se_play(@item.menu_se)
# If consumable
if @item.consumable
# Decrease used items by 1
$game_party.lose_item(@item.id, 1)
# Draw item window item
#@item_window.draw_item(@item_window.index)
end
# Switch to map screen
$scene = Scene_Map.new
return
end
end
return
end
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
@info_window.refresh
@item_window.refresh
end
#--------------------------------------------------------------------------
# * Frame Update (when target window is active)
#--------------------------------------------------------------------------
def update_target
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
$game_system.se_play($data_system.cancel_se)
# If unable to use because items ran out
unless $game_party.item_can_use?(@item.id)
# Remake item window contents
@item_window.refresh
end
# Erase target window
@item_window.active = true
@target_window.visible = false
@target_window.active = false
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# If items are used up
if $game_party.item_number(@item.id) == 0
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
return
end
# If target is all
if @target_window.index == -1
# Apply item effects to entire party
used = false
for i in $game_party.actors
used |= i.item_effect(@item)
end
end
# If single target
if @target_window.index >= 0
# Apply item use effects to target actor
target = $game_party.actors[@target_window.index]
used = target.item_effect(@item)
end
# If an item was used
if used
# Play item use SE
$game_system.se_play(@item.menu_se)
# If consumable
if @item.consumable
# Decrease used items by 1
$game_party.lose_item(@item.id, 1)
# Redraw item window item
# Erase target window
#@item_window.draw_item(@item_window.index)
end
# Remake target window contents
@target_window.refresh
# If all party members are dead
if $game_party.all_dead?
# Switch to game over screen
$scene = Scene_Gameover.new
return
end
# If common event ID is valid
if @item.common_event_id > 0
# Common event call reservation
$game_temp.common_event_id = @item.common_event_id
# Switch to map screen
$scene = Scene_Map.new
return
end
if @item.consumable
@item_window.active = true
@target_window.visible = false
@target_window.active = false
return
end
end
# If item wasn't used
unless used
# Play buzzer SE
$game_system.se_play($data_system.buzzer_se)
end
return
end
end
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
end # Fertig :)
#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Und hier meine Einstellungen des Items:
http://img12.imageshack.us/img12/4796/unbenanntorv.png
Problem: Nichts bedeutendes.... Gar nix außer das ich und ein paar andere User zu blöd sind, Items zu benutzen xD
Und ja, jeder hatte auf die Entertaste gedrückt:D
>.< Das Item benutzen funktioniert genau wie vorher, das einzige was ich daran verstellt hab is, das es mehrmals refresht damit die seitenzahlen und alles aktuell sind.
Außerdem kann das Item auch garnicht gehen, guck mal was du unter Scope eingestellt hast.
uppsi.... Peinlich:(
Es geht jetzt ...
Kein problem sorry wenn ich n bisschen unfreundlich war, ich war nur grad erst aufgestanden und wenn man dann sowas sieht...
Powered by vBulletin® Version 4.2.3 Copyright ©2025 Adduco Digital e.K. und vBulletin Solutions, Inc. Alle Rechte vorbehalten.