collapse collapse

 Community


 User Info




Willkommen Gast. Bitte einloggen oder registrieren.

 Partnerseiten

rpgvx.net

Das Forum ist offline

Autor Thema: (Tech) [Suche] Edit für "Scene_Menu" >>RGSS 2<<  (Gelesen 1892 mal)

Caith

  • Gast
(Tech) [Suche] Edit für "Scene_Menu" >>RGSS 2<<
« am: März 01, 2008, 17:27:45 »
Also ich möchte über das Menu eine funktion einbauen womit ich den Switch
für meine Minimap an und ausmachen kann.
un der der Menüpunkt müsste über Speichern liegen


hab mir das ungefähr so vorgestellt
wenn Switch 2=ON then
*angezeigter text im Menu = 'Minimap [aus]
switch 2=OFF
else
*angezeigter text im Menu = 'Minimap [an]
switch 2=ON

--Hier mal Screen von der Minimap--
--Mag nähmlich nicht immer ins Inventer unt ein Item benutzen mit einer Show Choice--
Spoiler for Hiden:


------------


Hab mich mal selbst dran probiert.
Man sieht jetzt zwar alles korrekt,
aber wenn ich den Menüpunkt auswähle passiert garnichts
(noch nichtmal ein Error^^)

Bild:
Spoiler for Hiden:


Hier der Code
Spoiler for Hiden:
#==============================================================================
# ¦ Scene_Menu
#------------------------------------------------------------------------------
#  ??????????????????
#==============================================================================

class Scene_Menu < Scene_Base
  #--------------------------------------------------------------------------
  # ? ?????????
  #     menu_index : ?????????????
  #--------------------------------------------------------------------------
  def initialize(menu_index = 0)
    @menu_index = menu_index
  end
  #--------------------------------------------------------------------------
  # ? ????
  #--------------------------------------------------------------------------
  def start
    super
    create_menu_background
    create_command_window
    @gold_window = Window_Gold.new(0, 360)
    @status_window = Window_MenuStatus.new(160, 0)
  end
  #--------------------------------------------------------------------------
  # ? ????
  #--------------------------------------------------------------------------
  def terminate
    super
    dispose_menu_background
    @command_window.dispose
    @gold_window.dispose
    @status_window.dispose
  end
  #--------------------------------------------------------------------------
  # ? ??????
  #--------------------------------------------------------------------------
  def update
    super
    update_menu_background
    @command_window.update
    @gold_window.update
    @status_window.update
    if @command_window.active
      update_command_selection
    elsif @status_window.active
      update_actor_selection
    end
  end
  #--------------------------------------------------------------------------
  # ? ????????????
  #--------------------------------------------------------------------------
  def create_command_window
    s1 = Vocab::item
    s2 = Vocab::skill
    s3 = Vocab::equip
    s4 = Vocab::status
    if $game_switches[2] == true
      s5 = "Minimap [an]"
    else
      s5 = "Minimap [aus]"
    end
    s6 = Vocab::save
    s7 = Vocab::game_end
    @command_window = Window_Command.new(160, [s1, s2, s3, s4, s5, s6, s7])
    @command_window.index = @menu_index
    if $game_party.members.size == 0          # ??????? 0 ????
      @command_window.draw_item(0, false)     # ????????
      @command_window.draw_item(1, false)     # ???????
      @command_window.draw_item(2, false)     # ??????
      @command_window.draw_item(3, false)     # ?????????
    end
    if $game_system.save_disabled             # ????????
      @command_window.draw_item(4, false)     # ???????
    end
  end
  #--------------------------------------------------------------------------
  # ? ?????????
  #--------------------------------------------------------------------------
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_party.members.size == 0 and @command_window.index < 4
        Sound.play_buzzer
        return
      elsif $game_system.save_disabled and @command_window.index == 4
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      case @command_window.index
      when 0      # ????
        $scene = Scene_Item.new
      when 1,2,3  # ????????????
        start_actor_selection
      when 4
        if $game_switches[2] == true
           $game_switches[2] == false
         else
            $game_switches[2] == true
          end
      when 5      # ???
        $scene = Scene_File.new(true, false, false)
      when 6      # ?????
        $scene = Scene_End.new
      end
    end
  end
  #--------------------------------------------------------------------------
  # ? ?????????
  #--------------------------------------------------------------------------
  def start_actor_selection
    @command_window.active = false
    @status_window.active = true
    if $game_party.last_actor_index < @status_window.item_max
      @status_window.index = $game_party.last_actor_index
    else
      @status_window.index = 0
    end
  end
  #--------------------------------------------------------------------------
  # ? ?????????
  #--------------------------------------------------------------------------
  def end_actor_selection
    @command_window.active = true
    @status_window.active = false
    @status_window.index = -1
  end
  #--------------------------------------------------------------------------
  # ? ?????????
  #--------------------------------------------------------------------------
  def update_actor_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      end_actor_selection
    elsif Input.trigger?(Input::C)
      $game_party.last_actor_index = @status_window.index
      Sound.play_decision
      case @command_window.index
      when 1  # ???
        $scene = Scene_Skill.new(@status_window.index)
      when 2  # ??
        $scene = Scene_Equip.new(@status_window.index)
      when 3  # ?????
        $scene = Scene_Status.new(@status_window.index)
      end
    end
  end
end

mfg Caith
« Letzte Änderung: August 12, 2010, 19:43:03 von Colonios »

[Suche] Edit für "Scene_Menu" >>RGSS 2<<

ERZENGEL

  • Gast
[Suche] Edit für "Scene_Menu" >>RGSS 2<<
« Antwort #1 am: März 01, 2008, 18:01:15 »
  when 4
    if $game_switches[2] == true
      $game_switches[2] == false
    else
      $game_switches[2] == true
    end
== ist zum vergleichen da. = hingegen zum Zuweisen und da du den Switch 2 den Wert true zuweisen willst müsstest du hier = schreiben.when 4
    if $game_switches[2] == true
      $game_switches[2] = false
    else
      $game_switches[2] = true
    end
Hab das mit der Minimapoption mal erledigt für dich:
Spoiler for Hiden:
#==============================================================================
# ** Scene_Menu
#------------------------------------------------------------------------------
#  This class performs menu screen processing.
#==============================================================================

class Scene_Menu < Scene_Base
  #--------------------------------------------------------------------------
  # * Create command window
  #--------------------------------------------------------------------------
  def create_command_window
    c = []
    c[0] = Vocab::item
    c[1] = Vocab::skill
    c[2] = Vocab::equip
    c[3] = Vocab::status
    if $game_switches[2]
      c[4] = "Minimap [EIN]"
    else
      c[4] = "Minimap [AUS]"
    end
    c[5] = Vocab::save
    c[6] = Vocab::game_end
    @command_window = Window_Command.new(160, c)
    @command_window.index = @menu_index
    if $game_party.members.size == 0
      @command_window.draw_item(0, false)
      @command_window.draw_item(1, false)
      @command_window.draw_item(2, false)
      @command_window.draw_item(3, false)
    end
    if $game_system.save_disabled
      @command_window.draw_item(5, false)
    end
  end
  #--------------------------------------------------------------------------
  # * Frame Update (when command window is active)
  #--------------------------------------------------------------------------
  def update_command_selection
    if Input.trigger?(Input::B)
      Sound.play_cancel
      $scene = Scene_Map.new
    elsif Input.trigger?(Input::C)
      if $game_party.members.size == 0 and @command_window.index < 4
        Sound.play_buzzer
        return
      elsif $game_system.save_disabled and @command_window.index == 4
        Sound.play_buzzer
        return
      end
      Sound.play_decision
      case @command_window.index
      when 0
        $scene = Scene_Item.new
      when 1,2,3
        start_actor_selection
      when 4
        if $game_switches[2]  # == true kann man bei if wegelassen
          $game_switches[2] = false  # nur ein =, da es eine Zuweisung ist
        else
          $game_switches[2] = true
        end
        @command_window.dispose  # altes ausblenden
        @menu_index = @command_window.index  # alter index den neuen zuweisen
        create_command_window # neues erstellen
      when 5
        $scene = Scene_File.new(true, false, false)
      when 6
        $scene = Scene_End.new
      end
    end
  end
end
Außerdem würde ich in ca. Zeile 42 von Scene_End die 5 mit 6 austauschen und in Scene_File in ca. 54 die 4 durch ne 5 ersetzen.
« Letzte Änderung: März 01, 2008, 18:02:56 von ERZENGEL »

[Suche] Edit für "Scene_Menu" >>RGSS 2<<

Caith

  • Gast
[Suche] Edit für "Scene_Menu" >>RGSS 2<<
« Antwort #2 am: März 01, 2008, 18:07:37 »
ah thx klappt super^^
*hats anfangs mit " := " versucht weil ich des noch von Delhi kannte xD*

Edit: funzt alles, hatte des in Scene File übersehen.
« Letzte Änderung: März 01, 2008, 18:17:29 von Caith »

[Suche] Edit für "Scene_Menu" >>RGSS 2<<

ERZENGEL

  • Gast
[Suche] Edit für "Scene_Menu" >>RGSS 2<<
« Antwort #3 am: März 01, 2008, 18:15:28 »
Zitat von: ERZENGEL
Außerdem würde ich in ca. Zeile 42 von Scene_End die 5 mit 6 austauschen und in Scene_File in ca. 54 die 4 durch ne 5 ersetzen.
Also wenn du das erledigt hast sollte es funktionieren.

EDIT: Okay, jetzt ist dieser Post sinnlos :)
« Letzte Änderung: März 01, 2008, 18:16:54 von ERZENGEL »

 


 Bild des Monats

rooftop party

Views: 4448
By: papilion

 Umfrage

  • Wer soll das BdM gewinnen?
  • Dot Kandidat 1
  • 3 (25%)
  • Dot Kandidat 2
  • 1 (8%)
  • Dot Kandidat 3
  • 2 (16%)
  • Dot Kandidat 4
  • 0 (0%)
  • Dot Kandidat 5
  • 6 (50%)
  • Stimmen insgesamt: 12
  • View Topic

 Schnellsuche





SimplePortal 2.3.3 © 2008-2010, SimplePortal